/* Base Styles */
:root {
    --background-dark: #13151a;
    --background-light: #1c1f26;
    --text-color: #ffffff;
    --text-color-secondary: #a0a0a0;
    --accent-color: #0070ba;
    --card-background: #252830;
    --border-color: #32364a;
    --rating-good: #ffb400;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
header {
    background-color: rgba(13, 15, 20, 0.9);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Main Navigation */
.main-nav {
    background-color: #000;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav li {
    padding: 0.5rem 0;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
}

.main-nav li.active a {
    color: var(--accent-color);
    font-weight: 600;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
}


.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0.5rem 0;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-secondary);
}

#searchInput {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border-radius: 50px;
    border: none;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 1rem;
}

#searchInput::placeholder {
    color: var(--text-color-secondary);
}

.stats {
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Hero Background */
.hero-background {
    background-size: cover;
    background-position: center;
    height: 300px;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(13, 15, 20, 0.7), rgba(13, 15, 20, 0.9));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
}

.hero-overlay h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    max-width: 800px;
}

.hero-overlay p {
    font-size: 1.2rem;
    color: var(--text-color-secondary);
    max-width: 600px;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.content-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.media-card {
    background-color: var(--card-background);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.media-card:hover {
    transform: translateY(-5px);
}

.media-poster {
    position: relative;
    padding-top: 150%; /* Aspect ratio for poster */
}

.media-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-info {
    padding: 1rem;
}

.media-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-genre {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
}

/* Details Page Styles */
.details-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.series-info {
    display: flex;
    gap: 2rem;
}

.series-poster {
    flex: 0 0 250px;
}

.series-poster img {
    width: 100%;
    border-radius: 8px;
}

.series-details {
    flex: 1;
}

.series-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.series-metadata {
    color: var(--text-color-secondary);
    margin-bottom: 1rem;
}

.series-description {
    margin-bottom: 1.5rem;
}

.metadata-item {
    margin-bottom: 0.5rem;
}

.metadata-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.rating-faces {
    display: flex;
    gap: 0.5rem;
}

.rating-face {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--background-light);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.rating-face.active {
    background-color: var(--rating-good);
}

.rating-value {
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

/* Seasons and Episodes */
.season-tabs {
    display: flex;
    margin-bottom: 1rem;
    overflow-x: auto;
    gap: 0.5rem;
}

.season-tab {
    padding: 0.5rem 1rem;
    background-color: var(--background-light);
    border-radius: 4px;
    cursor: pointer;
}

.season-tab.active {
    background-color: var(--accent-color);
}

.episode-tabs {
    display: flex;
    margin-bottom: 1rem;
    overflow-x: auto;
    gap: 0.5rem;
}

.episode-tab {
    padding: 0.5rem 1rem;
    background-color: var(--background-light);
    border-radius: 4px;
    cursor: pointer;
}

.episode-tab.active {
    background-color: var(--accent-color);
}

.episodes-list {
    border-collapse: collapse;
    width: 100%;
}

.episodes-list th,
.episodes-list td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.episodes-list th {
    color: var(--text-color-secondary);
    font-weight: normal;
}

.episode-watched {
    color: var(--text-color-secondary);
}

.language-flags img {
    width: 24px;
    height: 16px;
    margin-right: 0.3rem;
}

.play-button {
    color: var(--accent-color);
    cursor: pointer;
}

/* Video Player */
.video-container {
    margin-top: 2rem;
    position: relative;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-color-secondary);
}

/* Footer */
footer {
    background-color: var(--background-light);
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-color-secondary);
    padding: 0 1rem;
}

/* Responsive */
@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .logo h1 {
        margin-bottom: 0;
    }

    .search-container {
        margin: 0 1rem;
    }

    .stats {
        margin-top: 0;
    }
}

@media (max-width: 767px) {
    .series-info {
        flex-direction: column;
    }

    .series-poster {
        flex: 0 0 auto;
        max-width: 200px;
        margin: 0 auto;
    }
}
.video-error-container {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.download-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0070ba;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
}
.video-error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.video-error-container button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}


.plyr__controls button[data-plyr="captions"] {
    display: block !important;
    visibility: visible !important;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.5);
    z-index: 10;
}

.play-button {
    font-size: 48px;
    color: white;
    cursor: pointer;
}

.subtitle-controls {
    margin: 10px 0;
    text-align: center;
}

#subtitleSelector {
    padding: 5px;
    min-width: 200px;
}
/* Add these styles to your styles.css file */

/* Video Player Styles - Add to your styles.css file */


#videoPlayer.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    object-fit: contain;
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

/* Subtitle Controls */
.subtitle-controls {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    text-align: center;
    background-color: rgba(0,0,0,0.5);
    padding: 8px;
    z-index: 10;
}

#subtitleSelector {
    padding: 5px;
    min-width: 200px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
}

.status-message {
    color: rgba(255,255,255,0.7);
    margin-left: 10px;
}

/* Video Header */
.video-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    align-items: center;
    z-index: 10;
}

.video-title {
    margin-left: 15px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.back-button {
    cursor: pointer;
    padding: 5px 10px;
    display: inline-block;
    background: rgba(0,0,0,0.5);
    color: white;
    border-radius: 4px;
}

/* Play Button Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.5);
    z-index: 20;
}

.play-overlay .play-button {
    font-size: 72px;
    color: white;
    cursor: pointer;
    background-color: rgba(0,112,186,0.7);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.play-overlay .play-button:hover {
    transform: scale(1.1);
    background-color: rgba(0,112,186,0.9);
}

/* Error Message */
.video-error-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: rgba(0,0,0,0.8);
    color: white;
    border-radius: 8px;
    text-align: center;
    max-width: 80%;
}

.video-error-container button {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Fullscreen Adjustments */
:-webkit-full-screen #videoPlayer {
    width: 100%;
    height: 100%;
}

:-moz-full-screen #videoPlayer {
    width: 100%;
    height: 100%;
}

:-ms-fullscreen #videoPlayer {
    width: 100%;
    height: 100%;
}

:fullscreen #videoPlayer {
    width: 100%;
    height: 100%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .video-title {
        font-size: 16px;
    }

    .subtitle-controls {
        padding: 5px;
    }

    #subtitleSelector {
        min-width: 150px;
    }

    .play-overlay .play-button {
        width: 60px;
        height: 60px;
        font-size: 48px;
    }
}




/* Professional subtitle styles - designed to work with your existing CSS */
        .professional-video-container {
            position: relative;
            width: 100%;
            background: #000;
            border-radius: 8px;
            overflow: hidden;
        }

        .professional-video {
            width: 100%;
            height: auto;
            display: block;
        }

        .professional-subtitle-overlay {
            position: absolute;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.85);
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            font-size: 18px;
            font-weight: 500;
            text-align: center;
            max-width: 90%;
            display: none;
            z-index: 1000;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
            line-height: 1.4;
            font-family: 'Segoe UI', Arial, sans-serif;
            pointer-events: none;
        }

        /* Fullscreen subtitle adjustments */
        .professional-video-container:fullscreen .professional-subtitle-overlay {
            position: fixed !important;
            bottom: 100px !important;
            left: 50% !important;
            transform: translateX(-50%) !important;
            z-index: 2147483647 !important;
            font-size: 24px !important;
        }

        .professional-video-container:-webkit-full-screen .professional-subtitle-overlay {
            position: fixed !important;
            bottom: 100px !important;
            left: 50% !important;
            transform: translateX(-50%) !important;
            z-index: 2147483647 !important;
            font-size: 24px !important;
        }

        .professional-video-container:-moz-full-screen .professional-subtitle-overlay {
            position: fixed !important;
            bottom: 100px !important;
            left: 50% !important;
            transform: translateX(-50%) !important;
            z-index: 2147483647 !important;
            font-size: 24px !important;
        }

        .professional-video-container:-ms-fullscreen .professional-subtitle-overlay {
            position: fixed !important;
            bottom: 100px !important;
            left: 50% !important;
            transform: translateX(-50%) !important;
            z-index: 2147483647 !important;
            font-size: 24px !important;
        }

        /* Native subtitle styling - works in fullscreen */
        video::cue {
            background: rgba(0, 0, 0, 0.85) !important;
            color: white !important;
            font-size: 18px !important;
            font-family: 'Segoe UI', Arial, sans-serif !important;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
            line-height: 1.4 !important;
            padding: 8px 16px !important;
            border-radius: 6px !important;
        }
        
        /* Larger font in fullscreen */
        .professional-video-container:fullscreen video::cue,
        .professional-video-container:-webkit-full-screen video::cue,
        .professional-video-container:-moz-full-screen video::cue {
            font-size: 24px !important;
            padding: 12px 20px !important;
        }

        .language-selector-container {
            position: absolute;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(74, 158, 255, 0.9);
            border-radius: 20px;
            padding: 8px 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            z-index: 600;
            font-size: 14px;
            font-weight: 500;
            color: white;
            cursor: pointer;
            transition: background-color 0.2s ease;
        }

        .language-selector-container:hover {
            background: rgba(74, 158, 255, 1);
        }

        .language-selector-container.disabled {
            background: rgba(100, 100, 100, 0.7);
            cursor: not-allowed;
        }

        .language-label {
            margin-right: 4px;
        }

        .language-flags {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .language-flag {
            width: 20px;
            height: 15px;
            border-radius: 2px;
            object-fit: cover;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .subtitle-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: rgba(30, 30, 30, 0.95);
            border-radius: 8px;
            margin-top: 5px;
            padding: 8px 0;
            display: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .subtitle-dropdown.show {
            display: block;
        }

        .subtitle-option {
            padding: 8px 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background-color 0.2s ease;
            color: white;
        }

        .subtitle-option:hover {
            background: rgba(74, 158, 255, 0.2);
        }

        .subtitle-option.selected {
            background: rgba(74, 158, 255, 0.3);
        }

        .subtitle-option .language-flag {
            width: 18px;
            height: 13px;
        }

        .professional-header {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            display: flex;
            align-items: center;
            padding: 15px;
            background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
            z-index: 500;
        }

        .professional-back-button {
            background: rgba(0, 0, 0, 0.6);
            color: white;
            border: none;
            padding: 8px 12px;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 14px;
            transition: background-color 0.2s ease;
        }

        .professional-back-button:hover {
            background: rgba(0, 0, 0, 0.8);
        }

        .professional-title {
            margin-left: 20px;
            color: white;
            font-size: 18px;
            font-weight: 600;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
        }

        .loading-indicator {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-size: 16px;
            display: none;
            z-index: 600;
        }

        /* Mobile responsiveness */
        @media (max-width: 768px) {
            .language-selector-container {
                top: 50px;
                font-size: 12px;
                padding: 6px 12px;
            }
            
            .language-flag {
                width: 18px;
                height: 13px;
            }
            
            .professional-subtitle-overlay {
                font-size: 16px;
                bottom: 60px;
            }
        }