/* ============================================================
   VIDEO PAGE SPECIFIC STYLES
   Extends the main style.css with video player functionality
   ============================================================ */

/* ============================================================
   VIDEO PAGE LAYOUT
   ============================================================ */

.video-page-section {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 200px);
}

.video-page-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
    padding: 0 1.5rem;
    align-items: start;
}

/* ============================================================
   SIDEBAR: Timeline Navigation
   ============================================================ */

.video-sidebar {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-line);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--color-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent-strong);
    margin: 0;
}

.sidebar-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-text);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sidebar-toggle:hover {
    opacity: 1;
}

.sidebar-content {
    overflow-y: auto;
    flex: 1;
    padding-bottom: 1rem;
}

/* Custom scrollbar */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--color-line);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ============================================================
   WATCH PROGRESS INDICATOR
   ============================================================ */

.watch-progress {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--color-line);
}

.progress-text {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    opacity: 0.85;
    font-weight: 500;
}

.progress-text #watchedCount {
    color: var(--color-accent-strong);
    font-weight: 700;
}

.progress-bar {
    height: 6px;
    background: var(--color-bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-strong));
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

/* ============================================================
   MOBILE SESSION DROPDOWN
   ============================================================ */

.mobile-session-select {
    display: none; /* Hidden on desktop */
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-line);
}

.session-dropdown-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.session-dropdown-btn:hover {
    border-color: var(--color-accent);
    background: var(--color-surface);
}

/* ============================================================
   SESSION TIMELINE
   ============================================================ */

.session-timeline {
    padding: 0.5rem 0;
}

/* Timeline Block Headers */
.timeline-block {
    padding: 1.25rem 1.25rem 0.5rem;
    margin-top: 0.75rem;
}

.timeline-block:first-child {
    margin-top: 0;
}

.block-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    margin-bottom: 0.25rem;
}

.block-time {
    font-size: 0.8rem;
    opacity: 0.65;
    font-weight: 500;
}

/* Individual Session Items */
.session-item {
    display: grid;
    grid-template-columns: 35px 1fr 24px;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.session-item:hover {
    background: var(--color-bg);
    border-left-color: var(--color-accent);
}

.session-item.active {
    background: var(--color-bg);
    border-left-color: var(--color-accent-strong);
}

.session-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--color-accent), var(--color-accent-strong));
}

.session-time {
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0.8;
    color: var(--color-accent);
    white-space: nowrap;
    text-align: center;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.session-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text);
}

.session-speaker {
    font-size: 0.8rem;
    opacity: 0.75;
    color: var(--color-text-light);
    line-height: 1.4;
}

.session-speaker-company {
    font-size: 0.70rem;
    font-style: italic;
    opacity: 0.7;
    color: var(--color-text-light);
}

/* Watch Status Indicator */
.watch-status {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--color-accent);
    opacity: 0.4;
    transition: all 0.2s ease;
}

.session-item.watched .watch-status {
    opacity: 1;
    color: var(--color-accent-strong);
}

.session-item.watched .watch-status::before {
    content: '✓';
    font-weight: bold;
}

.session-item:not(.watched) .watch-status::before {
    content: '○';
}

/* ============================================================
   MAIN VIDEO PLAYER AREA
   ============================================================ */

.video-main {
    display: flex;
    flex-direction: column;
}

.video-player-wrapper {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-line);
    overflow: hidden;
}

/* Current Session Header */
.video-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-line);
}

.current-session-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.current-session-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.current-session-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1.3;
}

.current-session-speaker {
    font-size: 1rem;
    opacity: 0.8;
    color: var(--color-text-light);
}

/* Video Embed Container */
.video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================================
   UP NEXT CARD
   ============================================================ */

.up-next-card {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-line);
    background: var(--color-bg);
}

.up-next-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.up-next-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
}

.auto-play-toggle {
    background: transparent;
    border: 1px solid var(--color-line);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text);
}

.auto-play-toggle:hover {
    border-color: var(--color-accent);
    background: var(--color-surface);
}

.auto-play-toggle.active .toggle-status {
    display: inline;
}

.auto-play-toggle.active .toggle-status::after {
    content: 'Auto-play: ON';
}

.auto-play-toggle:not(.active) .toggle-status {
    display: inline;
}

.auto-play-toggle:not(.active) .toggle-status::after {
    content: 'Auto-play: OFF';
}

.up-next-content {
    display: grid;
    grid-template-columns: 100px 1fr minmax(110px, auto);
    gap: 1rem;
    align-items: center;
}

.up-next-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    opacity: 0.8;
}

.up-next-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.up-next-speaker {
    font-size: 0.85rem;
    opacity: 0.7;
    color: var(--color-text-light);
    margin-top: 0.2rem;
}

.play-next-btn {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-strong));
    color: #fff;
    padding: 0.65rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    font-size: 0.9rem;
    min-width: fit-content;
}

.play-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 166, 201, 0.3);
}

/* ============================================================
   VIDEO NAVIGATION BUTTONS
   ============================================================ */

.video-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-line);
}

.nav-btn {
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-line);
    background: var(--color-bg);
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-btn:hover:not(:disabled) {
    border-color: var(--color-accent);
    background: var(--color-surface);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.next-btn {
    background: var(--color-surface);
}

/* ============================================================
   RESPONSIVE DESIGN - TABLET
   ============================================================ */

@media (max-width: 1024px) {
    .video-page-container {
        grid-template-columns: 280px 1fr;
        gap: 2rem;
    }

    .current-session-title {
        font-size: 1.5rem;
    }

    .up-next-content {
        grid-template-columns: 90px 1fr minmax(110px, auto);
        gap: 0.75rem;
    }
}

/* ============================================================
   RESPONSIVE DESIGN - MOBILE
   ============================================================ */

@media (max-width: 900px) {
    .video-page-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .video-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        order: 2; /* Move sidebar below video on mobile */
    }

    .video-main {
        order: 1;
    }

    /* Show mobile dropdown */
    .mobile-session-select {
        display: block;
    }

    /* Collapse timeline by default on mobile */
    .session-timeline {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .session-timeline.expanded {
        max-height: 2000px;
    }

    .sidebar-toggle {
        display: block;
    }

    .video-sidebar.collapsed .sidebar-content {
        display: none;
    }

    .video-header {
        padding: 1.25rem 1.5rem;
    }

    .current-session-title {
        font-size: 1.35rem;
    }

    .up-next-card {
        padding: 1.25rem 1.5rem;
    }

    .up-next-content {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .play-next-btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    .video-navigation {
        padding: 1.25rem 1.5rem;
    }
}

@media (max-width: 600px) {
    .page-main-title {
        font-size: 1.6rem;
        margin-top: 20px;
    }

    .video-page-section {
        padding: 1.5rem 0 3rem;
    }

    .video-page-container {
        padding: 0 1rem;
    }

    .current-session-title {
        font-size: 1.2rem;
    }

    .current-session-speaker {
        font-size: 0.9rem;
    }

    .video-navigation {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .session-item {
        grid-template-columns: 32px 1fr 20px;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .session-title {
        font-size: 0.825rem;
    }

    .up-next-title {
        font-size: 0.95rem;
    }
}

/* ============================================================
   ANIMATIONS & TRANSITIONS
   ============================================================ */

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.session-item {
    animation: slideInFromLeft 0.3s ease;
}

.timeline-block {
    animation: fadeIn 0.4s ease;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.session-item:focus,
.nav-btn:focus,
.play-next-btn:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}