/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основные стили */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
    padding: 20px;
}

/* Sidebar Menu */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 30px 20px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 15px 20px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    color: #667eea;
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 2001;
    backdrop-filter: blur(10px);
}

.menu-toggle:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.menu-toggle.open svg {
    transform: rotate(90deg);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1999;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Menu */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 30px 20px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: block;
    padding: 15px 20px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    color: #667eea;
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 2001;
    backdrop-filter: blur(10px);
}

.menu-toggle:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.menu-toggle.open svg {
    transform: rotate(90deg);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1999;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Кнопка в главное меню */
.home-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.home-button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.home-button svg {
    width: 20px;
    height: 20px;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 40px;
}

/* Заголовок */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
    font-weight: 300;
}

/* Кнопка добавления заметки */
.add-note-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.add-note-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.add-note-btn:hover::before {
    left: 100%;
}

.add-note-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.add-note-btn:active {
    transform: translateY(0);
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
    opacity: 0.8;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.empty-state h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    opacity: 0.8;
}

.empty-state.hidden {
    display: none;
}

/* Сетка заметок */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* Стикер заметки */
.note-sticker {
    background: #fef08a;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: rotate(-1deg);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.note-sticker:nth-child(even) {
    transform: rotate(1deg);
}

.note-sticker:nth-child(3n) {
    transform: rotate(-0.5deg);
}

.note-sticker:hover {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Цвета стикеров */
.note-sticker.color-yellow { background: #fef08a; }
.note-sticker.color-pink { background: #fce7f3; }
.note-sticker.color-blue { background: #dbeafe; }
.note-sticker.color-green { background: #dcfce7; }
.note-sticker.color-orange { background: #fed7aa; }
.note-sticker.color-purple { background: #f3e8ff; }

/* Заголовок стикера */
.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.note-date {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.note-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.note-sticker:hover .note-actions {
    opacity: 1;
}

.note-action {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-action:hover {
    background: white;
    transform: scale(1.1);
}

.note-action.delete:hover {
    background: #fef2f2;
    color: #ef4444;
}

.note-action svg {
    width: 14px;
    height: 14px;
}

/* Текст заметки */
.note-text {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    color: #1f2937;
    resize: none;
    outline: none;
    min-height: 120px;
    overflow: hidden;
}

.note-text::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.note-text:focus {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 8px;
    margin: -8px;
}

/* Палитра цветов */
.color-palette {
    position: absolute;
    top: -10px;
    right: 40px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: all 0.3s ease;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

.note-sticker:hover .color-palette {
    opacity: 1;
    top: -15px;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-option:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-option.yellow { background: #fef08a; }
.color-option.pink { background: #fce7f3; }
.color-option.blue { background: #dbeafe; }
.color-option.green { background: #dcfce7; }
.color-option.orange { background: #fed7aa; }
.color-option.purple { background: #f3e8ff; }

/* Анимация появления */
@keyframes noteAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(-1deg);
    }
}

.note-sticker.new {
    animation: noteAppear 0.5s ease-out;
}

/* Анимация удаления */
@keyframes noteDisappear {
    from {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    to {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
}

.note-sticker.removing {
    animation: noteDisappear 0.3s ease-in forwards;
}

/* Уведомления */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #10b981;
    max-width: 300px;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

.notification-text {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding-top: 20px;
    }
    
    .title {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 16px;
    }
    
    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .note-sticker {
        min-height: 180px;
        padding: 16px;
    }
    
    .note-text {
        font-size: 15px;
        min-height: 100px;
    }
    
    .color-palette {
        position: static;
        opacity: 1;
        margin-top: 12px;
        justify-content: center;
    }
    
    .note-actions {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .home-button {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .home-button span {
        display: none;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .note-sticker {
        min-height: 160px;
        padding: 14px;
    }
    
    .add-note-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .empty-state {
        padding: 60px 20px;
    }
    
    .empty-icon {
        font-size: 48px;
    }
    
    .empty-state h2 {
        font-size: 24px;
    }
}