/* ========================================================
   🌸 Ashame Fansub — Sub-Page & Detail Styling
   ======================================================== */

@font-face {
    font-family: 'UD Digi Kyokasho NP-B';
    src: url('/font/UD Digi Kyokasho NP-B.woff2') format('woff2');
    font-display: swap;
}

/* Detail Page Shell */
.movie-container {
    max-width: 1040px;
    margin: 20px auto 60px;
    padding: 0 24px;
}

/* Header Detail */
.movie-header {
    text-align: center;
    margin-bottom: 36px;
}

.movie-header h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 8px;
}

.movie-header p {
    font-family: var(--font-jp);
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* Content (Poster & Synopsis) */
.movie-content {
    margin-bottom: 50px;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    position: relative;
    isolation: isolate;
    /* clearfix untuk float */
}

/* ========================================================
   ✨ Ambient Light / Glow Poster Backdrop (Memenuhi movie-content)
   ======================================================== */
.movie-ambient-backdrop {
    position: absolute;
    inset: -30px;
    width: calc(100% + 60px);
    height: calc(100% + 60px);
    background-size: cover;
    background-position: center;
    filter: blur(65px) saturate(180%);
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
    border-radius: var(--radius-lg);
    transform: translate3d(0, 0, 0);
    transition: opacity var(--transition-smooth, 0.3s ease);
}

body.SwitchMode .movie-ambient-backdrop {
    opacity: 0.16;
    filter: blur(75px) saturate(150%);
}

.movie-poster {
    width: 300px;
    max-width: 100%;
    float: left;
    margin: 0 32px 20px 0;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45),
        0 0 35px rgba(129, 41, 144, 0.25);
    object-fit: cover;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    transition: transform var(--transition-smooth, 0.3s ease), box-shadow var(--transition-smooth, 0.3s ease);
}

.movie-poster:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55),
        0 0 50px rgba(129, 41, 144, 0.45);
}

.movie-desc {
    position: relative;
    z-index: 1;
    font-family: var(--font-jp);
    font-size: 1.02rem;
    line-height: 1.9;
    color: var(--text-secondary);
    text-align: justify;
    overflow: visible;
    /* agar teks tidak overlapping dengan float */
}

.movie-desc p {
    margin-bottom: 14px;
    text-indent: 1.2em;
}

/* ========================================================
   🏷️ Genre Tags
   ======================================================== */
.movie-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 20px;
    align-items: center;
    text-align: left;
    text-indent: 0;
}

.genre-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: var(--surface-color-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    user-select: none;
    transition: border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);

}


.genre-tag:hover {
    border-color: #ec4899;
    color: #ec4899;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.25);
    transform: translateY(-2px);
}

body.SwitchMode .genre-tag {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

body.SwitchMode .genre-tag:hover {
    border-color: #ec4899;
    color: #db2777;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.2);
}

/* Media, Download & Actions */
.media-section-series {
    margin-top: 30px;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    box-shadow: var(--card-shadow);
}

.media-section-attention {
    margin-top: 30px;
    background: var(--color-merah-menyala);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    box-shadow: var(--card-shadow);
}

.no-reupload {
    font-family: var(--font-body);
    text-align: center;
    color: #ffffff;
    -webkit-text-stroke: 0.5px #000000;
    paint-order: stroke fill;
    text-transform: uppercase;
}

body.SwitchMode .no-reupload {
    color: #000000;
    -webkit-text-stroke: 0.5px #000000;
}

.media-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 30px;
}

.media-section-attention {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 30px;
}


.section-label {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 20px 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================================
   🎬 Aesthetic Cinema Player Box (Movie Trailer)
   ======================================================== */
.cinema-trailer-box {
    width: 100%;
    max-width: 980px;
    margin: 12px auto 32px;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), 0 0 35px rgba(129, 41, 144, 0.18);
    position: relative;
    transition: transform var(--transition-smooth, 0.3s ease), border-color var(--transition-smooth, 0.3s ease), box-shadow var(--transition-smooth, 0.3s ease);
}

.cinema-trailer-box:hover {
    transform: translateY(-3px);
    border-color: rgba(236, 72, 153, 0.45);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.65), 0 0 45px rgba(129, 41, 144, 0.32);
}

.cinema-trailer-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    background: var(--surface-color-elevated);
    border-bottom: 1px solid var(--border-color);
    user-select: none;
}

.cinema-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-body);
    letter-spacing: 0.6px;
}

.cinema-title svg {
    color: #ec4899;
}

.cinema-trailer-box .video-wrapper {
    margin: 16px 18px 18px;
    width: calc(100% - 36px);
    aspect-ratio: 16 / 9;
    height: auto;
    padding-bottom: 0;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* Rasio 16:9 Cinema */
    height: 0;
    overflow: hidden;
    background: #000000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Day Mode (Light Theme) */
body.SwitchMode .cinema-trailer-box {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08), 0 0 20px rgba(129, 41, 144, 0.06);
}

body.SwitchMode .cinema-trailer-box .video-wrapper {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

body.SwitchMode .cinema-trailer-box:hover {
    border-color: #ec4899;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 0 25px rgba(236, 72, 153, 0.18);
}

body.SwitchMode .cinema-trailer-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}


.detail-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.button-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface-color-elevated);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.button-info:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.2);
}

.button-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface-color-elevated);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    padding: 12px 26px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.button-share:hover {
    border-color: var(--accent-purple, #8b5cf6);
    color: var(--accent-purple, #8b5cf6);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.25);
}

.button-share svg {
    transition: transform var(--transition-fast);
}

.button-share:hover svg {
    transform: rotate(-15deg) scale(1.1);
}

/* ── Tutorial Unduh Button ───────────────────────── */
.button-tutorial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface-color-elevated);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    padding: 12px 26px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-decoration: none;
    white-space: nowrap;
}

.button-tutorial:hover {
    border-color: #ec4899;
    color: #ec4899;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.25);
}

.button-tutorial svg {
    transition: transform var(--transition-fast);
}

.button-tutorial:hover svg {
    transform: scale(1.15);
}

body.SwitchMode .button-tutorial {
    background: var(--surface-color-elevated);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.SwitchMode .button-tutorial:hover {
    border-color: #db2777;
    color: #db2777;
    box-shadow: 0 6px 18px rgba(219, 39, 119, 0.18);
}

/* Toast Notifikasi Salin Link */
#shareToast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
}

#shareToast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Day Mode Tweaks */
body.SwitchMode .button-share:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

@media (max-width: 520px) {
    .detail-actions-row {
        gap: 8px;
    }

    .button-info,
    .button-share,
    .button-tutorial {
        padding: 10px 20px;
        font-size: 0.88rem;
    }

    #shareToast {
        left: 20px;
        right: 20px;
        bottom: 24px;
        text-align: center;
        justify-content: center;
    }
}

/* Episode Buttons */
.button-series {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 28px;
}

.btn-download-series {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-md);
    background: var(--surface-color-elevated);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
}

.btn-download-series:hover {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
}

/* --- Episode Tracker State (Sudah Diunduh/Ditonton) --- */
.tracker-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tracker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.2px;
}

.tracker-reset-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.tracker-reset-btn:hover {
    color: var(--color-trakteer, #ef4444);
}

.btn-download-series.is-downloaded {
    position: relative;
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.08);
    color: #94a3b8;
}

.btn-download-series.is-downloaded::after {
    content: "✓";
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #10b981;
    font-family: system-ui, sans-serif;
}

.btn-download-series.is-downloaded:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
}

/* Day Mode untuk Tracker */
body.SwitchMode .btn-download-series.is-downloaded {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

body.SwitchMode .tracker-badge {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

/* Movie Single Download & Trakteer */
.btn-download {
    background: var(--accent-blue);
    color: #ffffff;
    padding: 12px 36px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 1rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-smooth);
}

.btn-download:hover {
    background: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
}

.btn-download-trakteer {
    background: linear-gradient(135deg, #e02424, #b91c1c);
    color: #ffffff;
    padding: 12px 32px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(224, 36, 36, 0.3);
}

.btn-download-trakteer:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 22px rgba(224, 36, 36, 0.5);
}

/* About Me Page */
.about-me {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin: 20px 0 36px;
    color: var(--text-primary);
}

.opening-about-me {
    max-width: 980px;
    margin: 0 auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--card-shadow);
}

.gambar-about-me {
    width: 220px;
    max-width: 100%;
    float: left;
    margin: 0 28px 20px 0;
    border-radius: 10px;
    border: 0;

}

.teks-about-me {
    font-family: var(--font-jp);
    font-size: 1.02rem;
    line-height: 1.9;
    color: var(--text-secondary);
    text-align: justify;
}

.teks-about-me p {
    margin-bottom: 16px;
    text-indent: 1.2em;
}


/* ========================================================
   🎭 Cast & Character Section (Kotak Pemeran)
   ======================================================== */
.cast-box {
    max-width: 980px;
    width: 100%;
    margin: 60px auto 40px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    box-sizing: border-box;
}

.cast-heading {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 16px;
}

.cast-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-color-elevated, #141416);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-fast, 0.2s ease),
        border-color var(--transition-fast, 0.2s ease),
        box-shadow var(--transition-fast, 0.2s ease);
    cursor: pointer;
}

.cast-card:hover {
    transform: translateY(-5px);
    border-color: #812990;
    box-shadow: var(--card-shadow-hover, 0 8px 24px rgba(0, 0, 0, 0.45));
}

.cast-photo-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.cast-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform var(--transition-smooth, 0.3s ease);
}

.cast-card:hover .cast-photo {
    transform: scale(1.05);
}

.cast-info {
    padding: 10px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    text-align: center;
}

.nama-pemeran {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    word-break: break-word;
    transition: color var(--transition-fast, 0.2s ease);
}

.cast-card:hover .nama-pemeran {
    color: var(--accent-blue, #0ea5e9);
}

.cast-karakter {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
    word-break: break-word;
}

.cast-role {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    padding-top: 6px;
}

.cast-role.role-main {
    color: #38bdf8;
}

.cast-role.role-side {
    color: #a78bfa;
}

.cast-role.role-guest {
    color: var(--text-muted, #9ca3af);
}

/* Day Mode Tweaks */
body.SwitchMode .cast-card {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.SwitchMode .cast-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

body.SwitchMode .cast-photo-wrapper {
    background: #f1f5f9;
}

body.SwitchMode .cast-role.role-main {
    color: #0284c7;
}

body.SwitchMode .cast-role.role-side {
    color: #7c3aed;
}

body.SwitchMode .cast-role.role-guest {
    color: #64748b;
}

/* Responsive Sub-Pages */
@media (max-width: 820px) {
    .movie-content {
        padding: 24px;
    }

    .movie-ambient-backdrop {
        inset: -20px;
        width: calc(100% + 40px);
        height: calc(100% + 40px);
        filter: blur(50px) saturate(180%);
    }

    .movie-poster {
        float: none;
        display: block;
        width: 220px;
        margin: 0 auto 20px;
    }

    .movie-desc {
        text-align: left;
    }

    .movie-genres {
        justify-content: flex-start;
        margin-top: 16px;
        gap: 6px 8px;
    }

    .genre-tag {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    .gambar-about-me {
        float: none;
        display: block;
        margin: 0 auto 20px;
    }

    .teks-about-me {
        text-align: left;
    }

    .movie-header h1 {
        font-family: var(--font-heading);
        font-size: 1rem;
        color: var(--text-primary);
        line-height: 1.3;
        margin-bottom: 8px;
        margin-top: 5px;
    }

    .video-wrapper {
        position: relative;
        width: 100%;
        padding-bottom: 56.25%;
        /* rasio 16:9 */
        height: 0;
        overflow: hidden;
    }

    .video-wrapper iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .cinema-trailer-box {
        margin: 8px auto 20px;
    }

    .cinema-trailer-box .video-wrapper {
        margin: 10px 12px 12px;
        width: calc(100% - 24px);
        aspect-ratio: 16 / 9;
        height: auto;
        padding-bottom: 0;
        border-radius: var(--radius-sm);
    }

    .cinema-trailer-header {
        padding: 9px 14px;
    }

    .cinema-title {
        font-size: 0.78rem;
    }

    .cast-box {
        margin: 40px auto 30px;
        padding: 20px 16px;
        width: 92%;
    }

    .cast-heading {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }

    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 520px) {
    .cast-box {
        margin: 30px auto 20px;
        padding: 16px 10px;
        width: 95%;
        border-radius: var(--radius-md);
    }

    .cast-heading {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }

    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
        gap: 8px;
    }

    .cast-info {
        padding: 8px 4px 10px;
        gap: 2px;
    }

    .nama-pemeran {
        font-size: 0.78rem;
    }

    .cast-karakter {
        font-size: 0.7rem;
    }

    .cast-role {
        font-size: 0.65rem;
        padding-top: 4px;
    }
}

@media (max-width: 360px) {
    .cast-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}