/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ ЗАМЕТОК ===== */

/* Заголовки видов */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-header h1 {
    font-size: 2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Стили для выбора года в тепловой карте */
.year-selector select,
.year-button {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.year-button.active {
    background: rgba(59, 130, 246, 0.2) !important;
    color: var(--accent-blue) !important;
}

@media (max-width: 480px) {
    .view-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .view-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===== СТИЛИ ДЛЯ РАЗНЫХ ТИПОВ ЗАМЕТОК ===== */

/* Ссылки - фиолетовая полоса */
.note-item.note-type-link {
    border-left: 4px solid #9c27b0 !important;
    background: linear-gradient(135deg, var(--bg-surface), rgba(156, 39, 176, 0.05));
}

/* Фото - красная полоса */
.note-item.note-type-image {
    border-left: 4px solid #f44336 !important;
    background: linear-gradient(135deg, var(--bg-surface), rgba(244, 67, 54, 0.05));
}

/* Аудио - зеленая полоса */
.note-item.note-type-transcription {
    border-left: 4px solid #4caf50 !important;
    background: linear-gradient(135deg, var(--bg-surface), rgba(76, 175, 80, 0.05));
}

/* Бадж типа заметки */
.note-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.note-type-badge.link-badge {
    background: rgba(156, 39, 176, 0.15);
    color: #9c27b0;
}

.note-type-badge.image-badge {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.note-type-badge.transcription-badge {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.note-type-badge i {
    font-size: 0.65rem;
}

/* Контейнер для ссылки */
.note-link-container {
    margin: 8px 0;
    word-break: break-all;
}

.note-link {
    color: #9c27b0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.note-link:hover {
    color: #7b1fa2;
    text-decoration: underline;
}

/* Превью ссылки */
.link-preview {
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 12px;
    background: rgba(156, 39, 176, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(156, 39, 176, 0.2);
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.link-preview-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-surface);
}

.link-preview-content {
    flex: 1;
    min-width: 0;
}

.link-preview-title {
    font-weight: 600;
    color: #9c27b0;
    margin-bottom: 5px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.link-preview-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    line-height: 1.4;
}

.link-preview-domain {
    font-size: 0.75rem;
    color: rgba(156, 39, 176, 0.6);
    text-transform: lowercase;
}

/* Тип в метаданных */
.note-type-meta {
    opacity: 0.8;
}

.note-type-meta i {
    color: var(--text-tertiary);
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .link-preview {
        flex-direction: column;
        gap: 10px;
    }
    
    .link-preview-image {
        width: 100%;
        height: 120px;
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ГОЛОСОВЫХ ЗАМЕТОК ===== */

.voice-note-container {
    width: 100%;
    position: relative;
    z-index: 5;
    max-width: 100%;
    overflow: hidden;
}

.voice-transcript {
    color: var(--text-primary);
    margin-bottom: 12px; /* Уменьшил отступ */
    font-size: 0.9rem; /* Уменьшил шрифт */
    line-height: 1.5;
    padding: 10px; /* Уменьшил паддинг */
    background: rgba(76, 175, 80, 0.05);
    border-radius: var(--radius-md);
    border-left: 3px solid #4caf50;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.voice-player {
    background: rgba(76, 175, 80, 0.08);
    border-radius: var(--radius-lg);
    padding: 12px; /* Уменьшил паддинг */
    border: 1px solid rgba(76, 175, 80, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.voice-player:hover {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.2);
}

.voice-player-controls {
    display: flex;
    align-items: center;
    gap: 12px; /* Уменьшил gap */
    position: relative;
    z-index: 15;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* УМЕНЬШАЕМ ВЫСОТУ ЗВУКОВОЙ ДОРОЖКИ */
.voice-waveform {
    flex: 1;
    height: 36px; /* Было 48px - уменьшил */
    background: rgba(76, 175, 80, 0.1);
    border-radius: 18px; /* Подогнал под новую высоту */
    overflow: hidden;
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.waveform-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        rgba(76, 175, 80, 0.2) 0px,
        rgba(76, 175, 80, 0.2) 3px, /* Уменьшил ширину полосок */
        transparent 3px,
        transparent 7px
    );
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px; /* Уменьшил отступ */
    box-sizing: border-box;
    border-radius: 18px; /* Подогнал под новую высоту */
    background-size: 10px 100%; /* Уменьшил размер паттерна */
    background-position: 0 0;
    background-repeat: repeat-x;
    max-width: 100%;
    overflow: hidden;
}

.waveform-placeholder .duration {
    color: #4caf50;
    font-size: 0.8rem; /* Уменьшил шрифт */
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px; /* Уменьшил паддинг */
    border-radius: 10px; /* Уменьшил радиус */
    backdrop-filter: blur(2px);
    z-index: 2;
    position: relative;
    pointer-events: none;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* УМЕНЬШАЕМ ВЫСОТУ КНОПКИ */
.voice-play-btn {
    flex-shrink: 0;
    width: 36px; /* Было 48px - уменьшил */
    height: 36px; /* Было 48px - уменьшил */
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #45a049);
    border: none;
    color: white;
    font-size: 1rem; /* Уменьшил шрифт иконки */
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    
    /* аппаратное ускорение */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
    -webkit-font-smoothing: antialiased;
    will-change: transform;
    
    /* плавность */
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease;
    
    /* гарантия кликабельности */
    pointer-events: auto !important;
    position: relative !important;
    z-index: 20 !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-right: 0;
}

.voice-play-btn:hover {
    transform: scale(1.1) translateZ(0);
    background: linear-gradient(135deg, #4caf50, #45a049) !important;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.5);
}

.voice-play-btn:active {
    transform: scale(0.95) translateZ(0);
    transition: transform 0.05s ease;
}

.voice-play-btn.playing {
    background: linear-gradient(135deg, #f44336, #e53935) !important;
}

.voice-play-btn.playing:hover {
    background: linear-gradient(135deg, #f44336, #e53935) !important;
    box-shadow: 0 8px 20px rgba(244, 67, 54, 0.5);
}

/* Информация под плеером */
.voice-info {
    display: flex;
    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.75rem; /* Уменьшил шрифт */
    width: 100%;
    max-width: 100%;
}

.voice-info span {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .voice-player-controls {
        gap: 8px;
    }
    
    .voice-play-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .voice-waveform {
        height: 32px;
        border-radius: 16px;
    }
    
    .waveform-placeholder {
        border-radius: 16px;
        padding-right: 8px;
    }
    
    .voice-transcript {
        font-size: 0.85rem;
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .waveform-placeholder .duration {
        font-size: 0.7rem;
        padding: 2px 4px;
    }
    
    .voice-info {
        font-size: 0.7rem;
        margin-top: 6px;
        padding-top: 6px;
    }
}

/* ===== УЛУЧШЕННАЯ ПЛАВАЮЩАЯ ПАНЕЛЬ ДЛЯ ССЫЛОК ===== */

/* АНИМАЦИИ */
@keyframes panelSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes panelSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* ОСНОВНЫЕ СТИЛИ ПАНЕЛИ */
.floating-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1500;
}

.floating-panel {
    position: absolute;
    width: 80vw;
    max-width: 1200px;
    height: 70vh;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    overflow: auto; /* Для внешнего ресайза */
    pointer-events: auto;
    min-width: 400px;
    min-height: 300px;
    resize: both; /* ВКЛЮЧАЕМ внешний ресайз */
    transition: box-shadow 0.2s ease;
    animation: panelSlideIn 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.floating-panel.dragging {
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    opacity: 0.95;
    transition: none;
}

.floating-panel.closing {
    animation: panelSlideOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Заголовок */
.floating-panel-header {
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.floating-panel-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.floating-panel-header h3 i {
    color: #9c27b0;
}

.floating-panel-actions {
    display: flex;
    gap: 8px;
}

/* КРУГЛАЯ КНОПКА ЗАКРЫТИЯ С КРАСНОЙ ОКАНТОВКОЙ */
.modal-close-circle {
    background: none;
    border: 1px solid transparent;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 28px;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.modal-close-circle:hover {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
    transform: rotate(90deg);
}

.modal-close-circle:active {
    transform: rotate(180deg);
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
}

/* Контейнер с двумя панелями */
.floating-panel-content {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

/* Левая панель - теперь фиксированная ширина */
.floating-left-panel {
    width: 30%;
    overflow-y: auto;
    padding: 1rem;
    border-right: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    /* Убираем transition, так как внутреннего ресайза больше нет */
}

/* Правая панель */
.floating-right-panel {
    flex: 1;
    overflow: hidden;
    background: white;
    border-radius: 0 0 8px 0;
    position: relative;
}

.floating-right-panel iframe {
    width: 100%;
    height: 100%;
    border: none;
    margin-top: 40px;
}

/* Превью сайта */
.site-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: linear-gradient(90deg, #9c27b0, #7b1fa2);
    color: white;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    pointer-events: none;
}

.site-domain {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
}

/* УЛУЧШЕННЫЙ FALLBACK */
.floating-fallback {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1e2e, #2d1a3a);
    padding: 30px;
    box-sizing: border-box;
    text-align: center;
}

.floating-fallback .lock-icon {
    width: 80px;
    height: 80px;
    background: rgba(156,39,176,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 40px;
    color: #9c27b0;
    border: 2px solid rgba(156,39,176,0.3);
    animation: pulse 2s infinite;
}

.floating-fallback h3 {
    margin: 0 0 10px 0;
    color: #9c27b0;
    font-size: 1.4rem;
}

.floating-fallback p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    max-width: 400px;
    line-height: 1.6;
}

.floating-fallback .fallback-domain {
    background: rgba(156,39,176,0.1);
    padding: 12px 24px;
    border-radius: 40px;
    margin-bottom: 25px;
    border: 1px solid rgba(156,39,176,0.2);
    font-family: monospace;
    font-size: 1.1rem;
    color: #9c27b0;
    max-width: 100%;
    word-break: break-all;
}

.floating-fallback .fallback-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.floating-fallback .btn-primary {
    padding: 12px 30px;
    background: #9c27b0;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(156,39,176,0.3);
}

.floating-fallback .btn-primary:hover {
    transform: scale(1.05);
}

.floating-fallback .btn-secondary {
    padding: 12px 30px;
    background: transparent;
    color: #9c27b0;
    border: 1px solid rgba(156,39,176,0.3);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.floating-fallback .btn-secondary:hover {
    background: rgba(156,39,176,0.05);
}

.floating-fallback .fallback-note {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-top: 25px;
    max-width: 400px;
}

/* СТИЛИ ДЛЯ МЕТАДАННЫХ */
.metadata-section {
    margin-bottom: 15px;
}

.metadata-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 8px;
}

.metadata-item:last-child {
    margin-bottom: 0;
}

.metadata-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.metadata-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Текст заметки */
.note-text-section {
    margin-top: 15px;
}

.note-text-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.note-text-content {
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
    word-break: break-word;
    white-space: pre-wrap;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Оригинальная ссылка */
.original-link {
    margin-top: 15px;
    padding: 8px;
    background: rgba(156,39,176,0.1);
    border-radius: 8px;
    word-break: break-all;
}

.original-link-label {
    color: #9c27b0;
    font-size: 0.75rem;
    margin-bottom: 3px;
}

.original-link-url {
    color: #9c27b0;
    text-decoration: underline;
    font-size: 0.85rem;
}

/* ПОЛНОСТЬЮ УБИРАЕМ ВНУТРЕННИЙ РЕСАЙЗЕР */
.floating-resizer {
    display: none;
}

/* Кастомный угловой ресайзер */
.floating-panel::-webkit-resizer {
    background: rgba(156,39,176,0.3);
    border: none;
    width: 15px;
    height: 15px;
    border-radius: 0 0 8px 0;
}

.floating-panel::-webkit-resizer:hover {
    background: rgba(156,39,176,0.6);
}

/* Красивая иконка в углу */
.floating-panel::before {
    content: '⤡';
    position: absolute;
    bottom: 4px;
    right: 6px;
    color: rgba(156,39,176,0.5);
    font-size: 14px;
    z-index: 31;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.floating-panel:hover::before {
    opacity: 1;
    color: #9c27b0;
}
