/* ==========================================================================
   EPISODE DETAIL PAGE - MODERN UI (DARK & LIGHT THEME COMPATIBLE)
   ========================================================================== */

/* Ortak Değişken Tanımlamaları (Eğer globalde yoksa fallback olarak çalışır) */
:root {
    --ep-gap-lg: 40px;
    --ep-gap-md: 20px;
    --ep-gap-sm: 10px;
    --ep-radius: 16px;
    --ep-radius-sm: 8px;
    --ep-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -- HEADER KARTI (Hero Section) -- */
.ep-hero-card {
    display: flex;
    gap: var(--ep-gap-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--ep-radius);
    padding: var(--ep-gap-lg);
    margin-bottom: var(--ep-gap-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    overflow: hidden;
}

.ep-hero-still {
    flex: 0 0 35%;
    max-width: 400px;
    position: relative;
    border-radius: var(--ep-radius-sm);
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.ep-hero-still img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
    display: block;
    transition: var(--ep-transition);
}

.ep-hero-still:hover img {
    transform: scale(1.03);
}

.ep-hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ep-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.2;
}

.ep-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ep-gap-sm);
    margin-bottom: 25px;
}

.ep-badge {
    background: var(--bg-body, rgba(128, 128, 128, 0.1));
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-light);
}

.ep-badge.rating {
    background: rgba(255, 193, 7, 0.1);
    color: #d97706; /* Koyu sarı/turuncu tonu - tema fark etmeksizin okunur */
    border-color: rgba(255, 193, 7, 0.3);
}

.ep-overview {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* -- YÖNLENDİRME (Navigation) BUTONLARI -- */
.ep-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    gap: var(--ep-gap-md);
    flex-wrap: wrap;
}

.ep-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--ep-transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.ep-nav-btn:hover:not(.disabled) {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(225, 29, 72, 0.2); /* Accent rengine uyumlu gölge */
}

.ep-nav-btn.season-link {
    background: var(--bg-body);
}

.ep-nav-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: transparent;
}

/* -- BÖLÜM BAŞLIKLARI -- */
.ep-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ep-section-title i {
    color: var(--accent);
}

/* -- FRAGMANLAR GRID -- */
.ep-trailers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--ep-gap-md);
    margin-bottom: 50px;
}

.ep-trailer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--ep-radius-sm);
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    transition: var(--ep-transition);
    display: flex;
    flex-direction: column;
}

.ep-trailer-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.ep-trailer-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.ep-trailer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--ep-transition);
}

.ep-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--ep-transition);
}

.ep-play-overlay i {
    font-size: 3.5rem;
    color: #fff;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    transform: scale(0.8);
    transition: var(--ep-transition);
}

.ep-trailer-card:hover .ep-play-overlay {
    opacity: 1;
}

.ep-trailer-card:hover .ep-play-overlay i {
    transform: scale(1);
    color: var(--accent);
}

.ep-trailer-info {
    padding: 15px;
}

.ep-trailer-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-trailer-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* -- DİĞER BÖLÜMLER (LIST GRID) -- */
.ep-others-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--ep-gap-md);
    margin-bottom: 50px;
}

.ep-other-card {
    display: flex;
    gap: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--ep-radius-sm);
    padding: 12px;
    transition: var(--ep-transition);
}

.ep-other-card:hover {
    border-color: var(--text-muted);
    background: var(--bg-body);
}

.ep-other-card.active-ep {
    border-color: var(--accent);
    background: rgba(225, 29, 72, 0.03); /* Accent renginin çok hafif transparan hali */
}

.ep-other-thumb {
    flex: 0 0 120px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

.ep-other-thumb img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.ep-other-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.ep-other-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ep-other-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
}

.ep-other-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-other-title a:hover {
    color: var(--accent);
}

.ep-active-label {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ep-other-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

/* -- VİDEO MODAL (POP-UP) -- */
.ep-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.ep-modal.show {
    opacity: 1;
}

.ep-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: #000;
    border-radius: var(--ep-radius-sm);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s;
}

.ep-modal.show .ep-modal-content {
    transform: scale(1);
}

.ep-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.ep-modal-close:hover {
    color: var(--accent);
}

.ep-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--ep-radius-sm);
}

.ep-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* -- RESPONSIVE TASARIM -- */
@media (max-width: 992px) {
    .ep-hero-card {
        flex-direction: column;
        padding: var(--ep-gap-md);
    }
    .ep-hero-still {
        max-width: 100%;
        width: 100%;
    }
    .ep-hero-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .ep-navigation {
        justify-content: center;
    }
    .ep-nav-btn {
        width: 100%;
        justify-content: center;
    }
    .ep-nav-btn.season-link {
        order: -1; /* Tüm bölümler butonunu mobilde en üste alır */
    }
    .ep-other-card {
        flex-direction: column;
    }
    .ep-other-thumb {
        flex: auto;
    }
}