/* ==========================================
   TIMECODE NAVIGATION (Навигация по таймкодам)
   Интегрирована в нижнюю панель плеера (cp-controls)
   ========================================== */

/* Старый floating nav скрыт — таймкоды теперь в cp-controls */
.player-timecode-nav {
    display: none !important;
}

/* Выпадающий список таймкодов */
.timecodes-dropdown {
    position: absolute;
    bottom: 56px;
    left: 12px;
    width: min(380px, calc(100% - 24px));
    max-height: 340px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 150;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.timecodes-dropdown-header {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 600;
    color: #f59e0b;
}

.timecodes-dropdown-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Кастомный скроллбар */
.timecodes-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.timecodes-dropdown-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.timecodes-dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.timecodes-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.timecode-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

.timecode-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.timecode-dropdown-item.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.3));
    border-left: 3px solid #f59e0b;
    padding-left: 7px;
}

.timecode-dropdown-item .timecode-num {
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
    min-width: 22px;
}

.timecode-dropdown-item.active .timecode-num {
    color: #f59e0b;
}

.timecode-dropdown-item .timecode-time {
    font-size: 12px;
    font-weight: 600;
    color: #f59e0b;
    min-width: 60px;
    font-family: 'Courier New', monospace;
}

.timecode-dropdown-item.active .timecode-time {
    color: #fbbf24;
}

.timecode-dropdown-item .timecode-title {
    flex: 1;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timecode-dropdown-item.active .timecode-title {
    color: #fff;
    font-weight: 500;
}

/* ══ Tablet: dropdown компактный ══ */
@media (min-width: 521px) and (max-width: 768px) {
    .timecodes-dropdown {
        left: 4px;
        right: 4px;
        bottom: 40px;
        width: auto;
        max-width: none;
        max-height: min(40vh, 200px);
        border-radius: 8px;
        transform: none;
    }

    .timecodes-dropdown-header {
        padding: 5px 8px;
        font-size: 10px;
    }

    .timecodes-dropdown-list {
        padding: 3px;
        scroll-snap-type: y proximity;
    }

    .timecode-dropdown-item {
        padding: 5px 7px;
        gap: 6px;
        margin-bottom: 2px;
        border-radius: 5px;
    }

    .timecode-dropdown-item:hover {
        transform: none;
    }

    .timecode-dropdown-item .timecode-num {
        font-size: 10px;
        min-width: 18px;
    }

    .timecode-dropdown-item .timecode-time {
        min-width: 44px;
        font-size: 10px;
    }

    .timecode-dropdown-item .timecode-title {
        font-size: 10px;
    }
}

/* ══ Mobile: fullscreen overlay (как настройки качества/озвучки) ══ */
@media (max-width: 520px) {
    .timecodes-dropdown {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: none !important;
        max-height: none !important;
        min-width: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        background: rgba(0, 0, 0, 0.95) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        display: flex !important;
        flex-direction: column;
        z-index: 9999 !important;
        transform: none !important;
        transition: opacity 0.15s ease !important;
        box-shadow: none !important;
    }

    .timecodes-dropdown-header {
        padding: 16px 20px 12px;
        font-size: 13px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #f59e0b;
        border-bottom: 1px solid rgba(255, 255, 255, 0.10);
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
    }

    .timecodes-dropdown-list {
        flex: 1;
        padding: 8px 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        scroll-snap-type: y proximity;
    }

    .timecode-dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        margin-bottom: 4px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
        cursor: pointer;
        transition: background 0.2s ease;
        scroll-snap-align: start;
        min-height: 48px;
        -webkit-tap-highlight-color: transparent;
    }

    .timecode-dropdown-item:active {
        background: rgba(255, 255, 255, 0.15);
    }

    .timecode-dropdown-item:hover {
        transform: none;
    }

    .timecode-dropdown-item.active {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.25));
        border-left: 4px solid #f59e0b;
        padding-left: 12px;
    }

    .timecode-dropdown-item .timecode-num {
        font-size: 14px;
        font-weight: 700;
        min-width: 28px;
        text-align: center;
    }

    .timecode-dropdown-item .timecode-time {
        font-size: 14px;
        font-weight: 600;
        min-width: 64px;
    }

    .timecode-dropdown-item .timecode-title {
        flex: 1;
        font-size: 15px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.95);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .timecode-dropdown-item.active .timecode-title {
        color: #fff;
        font-weight: 600;
    }

    .timecode-dropdown-item.active .timecode-num {
        color: #f59e0b;
        font-size: 15px;
    }

    .timecode-dropdown-item.active .timecode-time {
        color: #fbbf24;
    }
}
