/* Details Page - Complete CSS */
:root {
    --primary-text-color: #c9d1d9;
    --secondary-text-color: #8b949e;
    --accent-color: #e53935;
    --bg-dark: #0d1117;
    --bg-card: rgba(22,27,34,0.8);
    --border-color: #30363d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Assistant', sans-serif; background: var(--bg-dark); color: var(--primary-text-color); line-height: 1.6; padding: 20px; min-height: 100vh; }

.loader-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; gap: 20px; }
.loader { border: 4px solid rgba(229,57,53,0.2); border-top: 4px solid var(--accent-color); border-radius: 50%; width: 60px; height: 60px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.page-header { max-width: 1400px; margin: 0 auto 30px; text-align: center; }
.details-header { margin-bottom: 20px; }
.back-link { background-color: var(--bg-card); color: var(--primary-text-color); padding: 0.7rem 1.5rem; border-radius: 25px; text-decoration: none; font-weight: 600; transition: all 0.3s; border: 1px solid var(--border-color); display: inline-flex; align-items: center; gap: 0.5rem; }
.back-link:hover { background-color: var(--accent-color); transform: translateY(-2px); }
.back-link::before { content: '←'; font-size: 1.2rem; }

.details-container { max-width: 1400px; margin: 0 auto; }
.backdrop { position: fixed; top: 0; left: 0; right: 0; height: 50vh; background-size: cover; background-position: center; opacity: 0.15; z-index: -1; }

.details-layout-grid { display: grid; grid-template-columns: 280px 1fr 240px; gap: 25px; margin-bottom: 50px; }

.poster-column { position: sticky; top: 20px; align-self: start; }
.details-poster { width: 100%; max-width: 280px; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.7); }

.main-details-column { min-width: 0; }
.title-container { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.title-container h1 { font-size: 42px; font-weight: 800; color: #fff; line-height: 1.2; }
.tmdb-logo { height: 28px; opacity: 0.6; }
.movie-title-english-details { color: var(--secondary-text-color); font-size: 18px; margin-bottom: 20px; }
.series-stats-top { display: flex; flex-wrap: wrap; gap: 15px; margin: 20px 0; font-size: 15px; color: var(--secondary-text-color); }

.genres { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
#genres-container { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-tag { background: rgba(229,57,53,0.2); color: var(--accent-color); padding: 6px 14px; border-radius: 16px; font-size: 13px; font-weight: 700; border: 1px solid rgba(229,57,53,0.3); }

.details-overview { font-size: 17px; line-height: 1.8; margin: 25px 0; }
.overview-header { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 15px; }
.overview-header h2 { font-size: 22px; color: #fff; }
.language-selector { display: flex; gap: 6px; }
.language-btn { background: rgba(88,166,255,0.1); border: 1px solid rgba(88,166,255,0.3); color: var(--primary-text-color); padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.language-btn.active { background: linear-gradient(135deg, #58a6ff, #764ba2); color: #fff; }

.financial-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.financial-card { background: linear-gradient(135deg, rgba(88,166,255,0.08), rgba(118,75,162,0.08)); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 15px; }
.financial-card h3 { font-size: 13px; color: var(--secondary-text-color); margin-bottom: 6px; }
.financial-card .amount { font-size: 20px; font-weight: 700; background: linear-gradient(135deg, #58a6ff, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.cast-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; position: sticky; top: 20px; max-height: 480px; overflow-y: auto; }
.cast-container::-webkit-scrollbar { width: 4px; }
.cast-container::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 10px; }
.cast-container h2 { font-size: 15px; margin-bottom: 10px; color: #fff; }
.cast-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.cast-member { text-align: center; background: rgba(13,17,23,0.5); border-radius: 6px; padding: 4px; transition: all 0.3s; }
.cast-member:hover { border: 1px solid var(--accent-color); transform: translateY(-2px); }
.cast-member img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; margin-bottom: 3px; }
.cast-member strong { font-size: 9px; color: var(--primary-text-color); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Seasons & Episodes - Professional Style */
.seasons-container { 
    margin: 50px 0; 
    background: linear-gradient(135deg, rgba(88,166,255,0.03), rgba(118,75,162,0.03));
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.05);
}

.seasons-container h2 { 
    font-size: 28px; 
    margin-bottom: 25px; 
    color: #fff; 
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.seasons-container h2::before {
    content: '📺';
    font-size: 32px;
}

.season-accordion { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    margin-bottom: 15px; 
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.season-accordion:hover {
    border-color: rgba(229,57,53,0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.season-header { 
    width: 100%; 
    background: linear-gradient(135deg, rgba(88,166,255,0.05), rgba(118,75,162,0.05));
    border: none; 
    color: var(--primary-text-color); 
    padding: 18px 20px; 
    cursor: pointer; 
    font-size: 18px; 
    font-weight: 700; 
    display: flex; 
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    font-family: 'Assistant', sans-serif;
    text-align: right;
}

.season-header:hover { 
    background: linear-gradient(135deg, rgba(229,57,53,0.15), rgba(211,47,47,0.1));
}

.season-accordion.active .season-header {
    background: linear-gradient(135deg, rgba(229,57,53,0.2), rgba(211,47,47,0.15));
    border-bottom: 2px solid var(--accent-color);
}

.season-header-text { 
    display: flex; 
    align-items: center;
    gap: 15px;
    font-size: 18px;
}

.season-header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.season-header-text span {
    font-size: 14px;
    color: var(--secondary-text-color);
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 12px;
}

.season-header::after {
    content: '▼';
    font-size: 14px;
    transition: transform 0.3s;
    color: var(--accent-color);
}

.season-accordion.active .season-header::after {
    transform: rotate(180deg);
}

.episodes-list { 
    max-height: 0; 
    overflow: hidden; 
    transition: max-height 0.4s ease-out;
    background: rgba(13,17,23,0.4);
}

.season-accordion.active .episodes-list { 
    border-top: 1px solid var(--border-color); 
}

.episode-item { 
    display: flex; 
    gap: 20px; 
    padding: 20px; 
    border-bottom: 1px solid rgba(48,54,61,0.5);
    transition: all 0.3s;
}

.episode-item:hover {
    background: rgba(229,57,53,0.05);
    transform: translateX(5px);
}

.episode-item:last-child { 
    border-bottom: none; 
}

.episode-image-container { 
    width: 200px; 
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.episode-image-container img { 
    width: 100%; 
    border-radius: 8px;
    transition: transform 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.episode-item:hover .episode-image-container img {
    transform: scale(1.05);
}

.episode-info { 
    flex: 1;
    min-width: 0;
}

.episode-info h4 { 
    color: #fff; 
    margin-bottom: 8px; 
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.episode-info p { 
    color: var(--secondary-text-color); 
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.episode-info p:first-of-type {
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .seasons-container {
        padding: 20px 15px;
    }
    
    .episode-item { 
        flex-direction: column; 
        gap: 12px;
    }
    
    .episode-image-container { 
        width: 100%; 
        max-width: 100%;
    }
    
    .season-header {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .season-header-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}


.recommendations-section { margin: 40px 0; }
.recommendations-section h2 { font-size: 26px; margin-bottom: 20px; color: #fff; }
.recommendations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
.rec-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; text-decoration: none; transition: all 0.3s; position: relative; }
.rec-card:hover { transform: translateY(-5px); border-color: var(--accent-color); }
.rec-card img { width: 100%; aspect-ratio: 2/3; }
.rec-card-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.95), transparent); padding: 12px; }
.rec-card-overlay h3 { color: #fff; font-size: 13px; }

.ad-section { margin: 30px 0; text-align: center; }
.sticky-ad-footer { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(13,17,23,0.98); padding: 8px; text-align: center; z-index: 1000; }
.ad-close-btn { position: absolute; top: 3px; left: 3px; background: var(--accent-color); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }

@media (max-width: 1200px) {
    .details-layout-grid { grid-template-columns: 240px 1fr; }
    .sidebar-column { grid-column: 1 / -1; }
    .cast-grid { grid-template-columns: repeat(5, 1fr); }
}



/* Trailer Section - Wide & Prominent */
.trailer-section {
    margin: 40px 0;
    background: linear-gradient(135deg, rgba(88,166,255,0.06), rgba(118,75,162,0.06));
    border-radius: 14px;
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.trailer-section h2 {
    margin: 0 0 25px 0;
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.trailer-section h2::before {
    content: '🎬';
    font-size: 32px;
}

#trailer-container {
    max-width: 100%;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    width: 100%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transition: all 0.3s;
}

.video-responsive:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 70px rgba(88,166,255,0.35);
}

.video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

.youtube-search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 50px 20px;
    text-align: center;
}

.youtube-search-icon {
    font-size: 70px;
    opacity: 0.4;
    filter: grayscale(1);
    transition: all 0.3s;
}

.youtube-search-container:hover .youtube-search-icon {
    opacity: 0.7;
    filter: grayscale(0);
    transform: scale(1.12);
}

.youtube-search-text {
    font-size: 18px;
    color: var(--secondary-text-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.youtube-search-btn {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s;
    box-shadow: 0 8px 28px rgba(255,0,0,0.45);
    text-decoration: none;
    font-family: 'Assistant', sans-serif;
}

.youtube-search-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255,0,0,0.6);
}

.youtube-search-btn::before {
    content: '▶';
    font-size: 18px;
    background: white;
    color: #FF0000;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

@media (max-width: 768px) {
    .details-layout-grid { grid-template-columns: 1fr; }
    .details-poster { max-width: 280px; margin: 0 auto; }
    .title-container h1 { font-size: 28px; }
    .cast-grid { grid-template-columns: repeat(4, 1fr); }


    .trailer-section {
        padding: 22px;
        margin: 30px 0;
    }

    .trailer-section h2 {
        font-size: 22px;
    }

    .video-responsive {
        border-radius: 10px;
    }

    .youtube-search-icon {
        font-size: 52px;
    }

    .youtube-search-btn {
        padding: 13px 32px;
        font-size: 16px;
    }
}
