/* Lights Off Overlay Styles */
#lightbox-overlay {
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
    z-index: 40;
}

#lightbox-overlay:not(.hidden) {
    animation: fadeInOverlay 0.3s ease-out;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(2px);
    }
}

/* Lights toggle button in overlay - Subtle design */
#lightbox-overlay .lights-button-container {
    transition: opacity 0.5s ease;
    z-index: 60;
}

#lightbox-overlay .lights-button-container:hover {
    opacity: 1 !important;
}

#lightbox-overlay .lights-button-container button {
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Lights Off Mode - Video Player Above Overlay */
body.lights-off-mode {
    overflow: hidden;
}

body.lights-off-mode .enhanced-video-player-container {
    position: relative;
    z-index: 50;
}

body.lights-off-mode .jwplayer-container {
    position: relative;
    z-index: 50;
}

/* Ensure JWPlayer iframe/video elements stay above overlay */
body.lights-off-mode .jwplayer-container iframe,
body.lights-off-mode .jwplayer-container video,
body.lights-off-mode .jwplayer-container object,
body.lights-off-mode .jwplayer-container embed {
    position: relative;
    z-index: 50;
}

/* Ensure player controls stay accessible */
body.lights-off-mode .jwplayer-container .jw-controls,
body.lights-off-mode .jwplayer-container .jw-overlays {
    z-index: 51;
}

/* Keep video player area interactive */
body.lights-off-mode .enhanced-video-player-container,
body.lights-off-mode .jwplayer-container {
    pointer-events: auto;
}

/* Overlay clickable area should not interfere with video player */
body.lights-off-mode .lights-overlay-clickable {
    pointer-events: auto;
}

/* Video player area should be above overlay clickable area */
body.lights-off-mode .enhanced-video-player-container {
    position: relative;
    z-index: 50;
    pointer-events: auto;
}

/* Ensure all video player controls remain accessible */
body.lights-off-mode .enhanced-video-player-container * {
    pointer-events: auto;
}

#lightbox-overlay .lights-button-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Show button on overlay hover */
#lightbox-overlay:hover .lights-button-container {
    opacity: 1 !important;
}

/* ===== SERVER SELECTOR STYLES REMOVED - SINGLE SOURCE ONLY ===== */

/* ===== BREADCRUMB STYLES ===== */

.breadcrumb-container {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.breadcrumb-item {
    position: relative;
    transition: all 0.3s ease;
}

.breadcrumb-item:hover {
    transform: translateY(-1px);
}

.breadcrumb-separator {
    transition: all 0.3s ease;
    opacity: 0.6;
}

.breadcrumb-item:hover + .breadcrumb-separator {
    opacity: 1;
    transform: scale(1.1);
}

/* Breadcrumb Animation */
@keyframes breadcrumbFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ENHANCED SIDEBAR STYLES ===== */

.sidebar-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-tertiary) var(--theme-primary);
}

.sidebar-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scrollbar::-webkit-scrollbar-track {
    background: var(--theme-primary);
    border-radius: 3px;
}

.sidebar-scrollbar::-webkit-scrollbar-thumb {
    background: var(--theme-tertiary);
    border-radius: 3px;
}

.sidebar-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--main-color);
}

/* ===== COMPACT EPISODE LIST STYLES ===== */

/* Compact Episode List for Sidebar */
.episode-list-sidebar .episode-item {
    min-height: 32px;
    font-size: 0.75rem;
    padding: 0.5rem;
}

.episode-list-sidebar .episode-item.current {
    background: var(--main-color);
    color: white;
    font-weight: 600;
}

/* ===== SMOOTH TRANSITIONS ===== */

.episode-item, .server-item, .nav-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.episode-item:hover, .server-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== LOADING STATES ===== */

.loading-skeleton {
    background: linear-gradient(90deg, var(--theme-tertiary) 25%, var(--theme-secondary) 50%, var(--theme-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Enhanced Focus States for Accessibility */
.episode-item:focus, .server-item:focus, .nav-button:focus {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

/* ===== VISUAL HIERARCHY ===== */

/* Improved Visual Hierarchy */
.section-header {
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* ===== SERVER SELECTOR COMPONENT STYLES REMOVED - SINGLE SOURCE ONLY ===== */

/* ===== RESPONSIVE DESIGN ===== */

/* Enhanced Responsive Design */
@media (max-width: 1024px) {
    .sidebar-sticky {
        position: static !important;
        max-height: none !important;
    }

    .episode-navigation-mobile {
        order: -1;
    }
}

@media (max-width: 768px) {
    .mobile-episode-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 50;
        background: var(--theme-secondary);
        border-top: 1px solid var(--theme-tertiary);
        padding: 1rem;
    }

    .mobile-episode-nav.hidden {
        transform: translateY(100%);
    }
}

.episode-list-component .server-tab {
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
}

.episode-list-component .server-tab.active {
    color: var(--main-color);
    border-color: var(--main-color);
    background-color: rgba(26, 26, 26, 0.2);
}

.episode-list-component .server-tab:hover:not(.active) {
    color: var(--text-primary);
    background-color: rgba(26, 26, 26, 0.1);
}

.episode-list-component .episode-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.episode-list-component .episode-item.current-episode {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.episode-list-component .scrollbar-thin::-webkit-scrollbar {
    height: 4px;
}

.episode-list-component .scrollbar-thin::-webkit-scrollbar-track {
    background-color: var(--bg-primary);
}

.episode-list-component .scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: var(--bg-tertiary);
    border-radius: 9999px;
}

.episode-list-component .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: var(--main-color);
}

/* ===== MOVIE INFORMATION SECTION STYLING ===== */

/* Movie Information Section */
.movie-info-section {
    background: var(--theme-secondary);
    border: 1px solid var(--theme-tertiary);
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.movie-info-section:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

/* Movie Poster Styling */
.movie-poster {
    transition: transform 0.3s ease;
    overflow: hidden;
    border-radius: 0.5rem;
}

.movie-poster:hover {
    transform: scale(1.02);
}

.movie-poster img {
    transition: transform 0.3s ease;
}

.movie-poster:hover img {
    transform: scale(1.05);
}

/* Stat Cards */
.stat-card {
    background: var(--theme-tertiary);
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.stat-card:hover {
    background: var(--bg-button-hover);
    transform: translateY(-2px);
    border-color: var(--main-color);
    box-shadow: 0 4px 12px rgba(0, 255, 102, 0.1);
}

/* Action Buttons */
.action-button {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile Responsive for Movie Info */
@media (max-width: 768px) {
    .movie-info-section {
        padding: 1rem;
        margin: 1rem 0;
    }

    .movie-info-section .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .movie-info-section .md\\:col-span-1,
    .movie-info-section .md\\:col-span-3 {
        grid-column: span 1;
    }

    .stat-card {
        padding: 0.5rem;
    }

    .action-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .movie-info-section {
        padding: 0.75rem;
    }

    .movie-info-section h4 {
        font-size: 1.25rem;
    }

    .stat-card {
        padding: 0.375rem;
    }

    .stat-card .font-bold {
        font-size: 1rem;
    }

    .action-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* ===== EPISODE NAVIGATION MAIN AREA STYLING ===== */

/* Episode Navigation in Main Area */
.episode-navigation-main {
    background: var(--theme-secondary);
    border: 1px solid var(--theme-tertiary);
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.episode-navigation-main:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

/* Episode Navigation Cards */
.episode-nav-card {
    transition: all 0.3s ease;
    border: 1px solid var(--theme-tertiary);
}

.episode-nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.episode-nav-card.current {
    border: 2px solid var(--main-color);
    background: var(--main-color-20);
}

.episode-nav-card.next {
    background: var(--main-color);
    border: 2px solid var(--main-color);
}

.episode-nav-card.next:hover {
    background: #16a34a; /* green-600 */
    border-color: #16a34a;
}

.episode-nav-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Episode Navigation Icons */
.episode-nav-icon {
    transition: all 0.3s ease;
}

.episode-nav-card:hover .episode-nav-icon {
    transform: scale(1.1);
}

/* Mobile Responsive for Episode Navigation */
@media (max-width: 768px) {
    .episode-navigation-main {
        padding: 1rem;
    }

    .episode-navigation-main .grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .episode-nav-card {
        padding: 0.75rem;
    }

    .episode-nav-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .episode-nav-card .text-sm {
        font-size: 0.75rem;
    }

    .episode-nav-card .font-semibold,
    .episode-nav-card .font-bold {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .episode-navigation-main {
        padding: 0.75rem;
    }

    .episode-nav-card {
        padding: 0.5rem;
        gap: 0.75rem;
    }

    .episode-nav-icon {
        width: 2rem;
        height: 2rem;
    }

    .episode-nav-card .text-sm {
        font-size: 0.625rem;
    }

    .episode-nav-card .font-semibold,
    .episode-nav-card .font-bold {
        font-size: 0.75rem;
    }
}
