/* Формы и модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    
    /* СКРОЛЛБАР КАК В КОЛЛЕКЦИЯХ */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* ДИНАМИЧЕСКИЙ СКРОЛЛБАР КАК В КОЛЛЕКЦИЯХ */
.modal::-webkit-scrollbar {
    width: 8px;
}

.modal::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
    margin: 10px 0;
}

.modal::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.modal:hover::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
}

.modal::-webkit-scrollbar-thumb:hover {
    background: #2563eb; /* Темнее при наведении на скролл */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-content {
    padding: 1.5rem;
    
    /* ДИНАМИЧЕСКИЙ СКРОЛЛБАР */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
    margin: 10px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.modal-content:hover::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Экран приветствия */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.welcome-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.welcome-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-blue);
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-blue);
}

.feature-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Статус загрузки */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-blue);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

/* Пустые состояния */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--accent-blue);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left-color: var(--accent-green);
}

.notification.error {
    border-left-color: var(--accent-red);
}

.notification.warning {
    border-left-color: var(--accent-orange);
}

.notification-content {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .modal {
        width: 95%;
        padding: 0;
    }
    .modal-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .modal {
        width: 95%;
        padding: 0;
    }
    .modal-content {
        padding: 1rem;
    }
}

/* Анимации */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============ УНИФИЦИРОВАННЫЕ ПОЛЯ ВВОДА ============ */

/* СБРОС ВСЕХ СТАРЫХ СТИЛЕЙ ДЛЯ ПОЛЕЙ В МОДАЛКЕ */
.modal input:not([type="checkbox"]):not([type="radio"]),
.modal select,
.modal textarea {
    all: unset; /* Сбрасываем все стили */
    box-sizing: border-box;
}

/* БАЗОВЫЙ СТИЛЬ для всех полей ввода в модалке */
.modal input:not([type="checkbox"]):not([type="radio"]),
.modal select,
.modal textarea {
    height: 42px;
    padding: 0 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    width: 100%;
    line-height: normal;
}

/* Специально для textarea - больше высота */
.modal textarea {
    height: auto;
    min-height: 120px;
    padding: 12px;
    line-height: 1.5;
    resize: vertical;
}

/* Стили для селектов (стрелочка) */
.modal select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

/* Стили для инпутов */
.modal input:not([type="checkbox"]):not([type="radio"]) {
    height: 42px;
}

/* Ховер и фокус состояния */
.modal input:not([type="checkbox"]):not([type="radio"]):hover,
.modal select:hover,
.modal textarea:hover {
    border-color: var(--accent-blue);
}

.modal input:not([type="checkbox"]):not([type="radio"]):focus,
.modal select:focus,
.modal textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ============ СПЕЦИАЛЬНО ДЛЯ КОЛЛЕКЦИИ ============ */

/* Контейнер для поля коллекции */
.modal .collection-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

/* Поле ввода коллекции */
.modal .collection-selector input {
    flex: 2;
    min-width: 0; /* Позволяет сжиматься */
}

/* Селект выбора коллекции */
.modal .collection-selector select {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .modal .collection-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal .collection-selector input,
    .modal .collection-selector select {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }
}

/* ============ СТИЛИ ДЛЯ КНОПОК ============ */

.modal .btn-primary,
.modal .btn-secondary {
    height: 42px;
    padding: 0 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-sizing: border-box;
}

.modal .btn-primary {
    background: var(--accent-blue);
    color: white;
}

.modal .btn-primary:hover {
    background: var(--accent-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.modal .btn-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal .btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent-blue);
}


/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ ФОТО ===== */
.photo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.photo-modal-container {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 3001;
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.photo-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 3001;
}

.photo-modal-prev {
    left: 20px;
}

.photo-modal-next {
    right: 20px;
}

.photo-modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.photo-modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.photo-modal-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 3001;
}

.photo-modal-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.photo-modal-action:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.photo-modal-error {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f44336;
    font-size: 3rem;
}


/* ===== МОДАЛЬНЫЕ ОКНА ДЛЯ ЗАМЕТОК НА ЗЕМЛЕ ===== */

/* Основная модалка заметки */
.note-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    width: 600px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: hidden;
    z-index: 9999;
    box-shadow: 
        0 25px 100px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(59, 130, 246, 0.2);
    animation: noteModalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.note-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--accent-blue), 
        transparent
    );
}

@keyframes noteModalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Контейнер для фото по центру */
.note-modal .photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 15px 0;
}

.note-modal .photo-container img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
    transition: transform 0.2s ease;
}

.note-modal .photo-container img:hover {
    transform: scale(1.02);
    cursor: pointer;
}

/* Карточка для контента */
.note-modal .content-card {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.note-modal .content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-blue);
}

.note-modal .content-card.image-card::before {
    background: #f44336;
}

.note-modal .content-card.link-card::before {
    background: #9c27b0;
}

.note-modal .content-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.note-modal .content-card.image-card h3 {
    color: #f44336;
}

.note-modal .content-card.link-card h3 {
    color: #9c27b0;
}

.note-modal .content-card.text-card h3 {
    color: var(--accent-blue);
}

/* Метаданные */
.note-modal .meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.note-modal .meta-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 15px;
}

.note-modal .meta-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.note-modal .meta-value {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Теги */
.note-modal .tags-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 15px;
    margin-bottom: 20px;
}

.note-modal .tags-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.note-modal .tags-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.note-modal .tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.note-modal .tag:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

/* Кнопки действий */
.note-modal .action-buttons {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.note-modal .btn-primary,
.note-modal .btn-secondary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
    border: none;
}

.note-modal .btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.note-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.note-modal .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.note-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Контекстное меню */
.goal-context-menu {
    position: fixed;
    z-index: 10000;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    overflow: hidden;
    animation: contextMenuAppear 0.15s ease;
}

@keyframes contextMenuAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-primary);
}

.context-menu-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.context-menu-item.danger {
    color: #EF4444;
    border-top: 1px solid var(--border-color-light);
}

.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Адаптивность */
@media (max-width: 768px) {
    .note-modal {
        width: 95vw;
        max-height: 90vh;
    }
    
    .note-modal .meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .note-modal .action-buttons {
        flex-direction: column;
        padding: 1rem;
    }
    
    .note-modal .btn-primary,
    .note-modal .btn-secondary {
        width: 100%;
    }
    
    .note-modal .photo-container img {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .note-modal .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .note-modal .content-card {
        padding: 1rem;
    }
    
    .note-modal .content-card h3 {
        font-size: 1rem;
    }
    
    .note-modal .photo-container img {
        max-height: 250px;
    }
    
    .note-modal .tags-list {
        gap: 5px;
    }
    
    .note-modal .tag {
        padding: 3px 8px;
        font-size: 0.8rem;
    }
}

/* ===== КНОПКА ЗАКРЫТИЯ С АНИМАЦИЕЙ ===== */
.note-modal .modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.note-modal .modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border-color: var(--accent-red);
    transform: rotate(90deg);
}

/* ===== СКРОЛЛ В МОДАЛКЕ ===== */
.note-modal .modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    
    /* Кастомный скроллбар */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.note-modal .modal-content::-webkit-scrollbar {
    width: 8px;
}

.note-modal .modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    margin: 10px 0;
}

.note-modal .modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.note-modal .modal-content:hover::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
}

.note-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* ===== КОНТЕЙНЕР ДЛЯ ФОТО ===== */
.note-modal .photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 20px 0;
}

.note-modal .photo-container img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
    transition: transform 0.2s ease;
}

.note-modal .photo-container img:hover {
    transform: scale(1.02);
    cursor: pointer;
}


/* ===== МОДАЛКА ДЛЯ ОБЫЧНЫХ ЗАМЕТОК ===== */
.note-modal .content-card {
    background: rgba(59, 130, 246, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-blue);
    position: relative;
    overflow: hidden;
}

.note-modal .content-card.link-card {
    border-left-color: #9c27b0;
    background: rgba(156, 39, 176, 0.05);
}

.note-modal .content-card.image-card {
    border-left-color: #f44336;
    background: rgba(244, 67, 54, 0.05);
}

.note-modal .content-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.note-modal .content-card.link-card h3 {
    color: #9c27b0;
}

.note-modal .content-card.image-card h3 {
    color: #f44336;
}

.note-modal .content-card.text-card h3 {
    color: var(--accent-blue);
}

.note-modal .content-card p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.note-modal .meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.note-modal .meta-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all 0.2s ease;
}

.note-modal .meta-item:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.note-modal .meta-item .meta-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-modal .meta-item .meta-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.note-modal .meta-item i {
    width: 20px;
    color: var(--accent-blue);
}

.note-modal .tags-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.note-modal .tags-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-modal .tags-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-modal .tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.note-modal .tag:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.note-modal .goals-container {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.note-modal .goals-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-modal .goals-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-modal .goal-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.note-modal .goal-tag i {
    font-size: 0.7rem;
}

@media (max-width: 480px) {
    .note-modal .meta-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .note-modal .content-card {
        padding: 1rem;
    }
    
    .note-modal .content-card p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* ===== ГОЛОСОВАЯ МОДАЛКА (исправленная, без дубликатов) ===== */
.voice-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.voice-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4caf50, transparent);
    z-index: 1;
}

.voice-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.voice-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.voice-modal .modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.voice-modal .modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.voice-modal .modal-content {
    padding: 1.5rem;
    background: var(--bg-secondary);
}

/* Стильный аудиоплеер */
.voice-modal .audio-player {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.voice-modal .audio-player audio {
    display: none;
}

.voice-modal .custom-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.voice-modal .play-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #45a049);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.voice-modal .play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4);
}

.voice-modal .play-button.playing {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.voice-modal .waveform-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-modal .waveform {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.voice-modal .waveform-bar {
    flex: 1;
    height: 30px;
    background: linear-gradient(to top, #4caf50, #81c784);
    border-radius: 3px;
    transition: height 0.1s ease, opacity 0.2s ease, background 0.2s ease;
    opacity: 0.7;
}

.voice-modal .waveform-bar.active {
    opacity: 1;
    background: linear-gradient(to top, #4caf50, #a5d6a7);
}

.voice-modal .time-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: monospace;
    min-width: 45px;
    text-align: right;
}

.voice-modal .duration-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.voice-modal .duration-info i {
    color: #4caf50;
    margin-right: 4px;
}

/* Транскрипция */
.voice-modal .full-transcript {
    background: rgba(76, 175, 80, 0.05);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #4caf50;
}

.voice-modal .full-transcript h3 {
    color: #4caf50;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.voice-modal .full-transcript p {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
    white-space: pre-wrap;
    margin: 0;
    word-break: break-word;
}

/* Метаданные */
.voice-modal .meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.voice-modal .meta-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.voice-modal .meta-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voice-modal .meta-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.voice-modal .meta-value i {
    color: #4caf50;
    width: 20px;
}

/* Теги */
.voice-modal .tags-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.voice-modal .tags-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voice-modal .tags-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.voice-modal .tag {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.voice-modal .modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.voice-modal .modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border-color: var(--accent-red);
    transform: rotate(90deg);
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .voice-modal .meta-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .voice-modal .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .voice-modal .full-transcript {
        padding: 1rem;
    }
    
    .voice-modal .full-transcript p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* ===== ЦВЕТНЫЕ СВЕЧЕНИЯ ДЛЯ РАЗНЫХ ТИПОВ ===== */
.note-modal.link-modal::before {
    background: linear-gradient(90deg, transparent, #9c27b0, transparent);
}

.note-modal.image-modal::before {
    background: linear-gradient(90deg, transparent, #f44336, transparent);
}



/* ===== КРУГЛЫЙ КРЕСТИК В МОДАЛКЕ СОЗДАНИЯ ЗАМЕТКИ ===== */
#noteModal .modal-close,
.modal:has(#noteForm) .modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

#noteModal .modal-close:hover,
.modal:has(#noteForm) .modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border-color: var(--accent-red);
    transform: rotate(90deg);
}
