/* AnimePahe 1:1 Pixel-Perfect Theme Styles */
:root {
    --bg-main: #050505;
    --bg-header: #0b0c0d;
    --bg-card: #151515;
    --text-primary: #ffffff;
    --text-muted: #8c9094;
    --accent-pink: #d7385e;
    --accent-pink-hover: #b8284b;
    --badge-green: #28a745;
    --badge-green-bg: rgba(40, 167, 69, 0.25);
    --border-color: #242526;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
    background-color: var(--bg-header);
    border-bottom: 1px solid #141414;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand-logo {
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.brand-logo .logo-anime {
    color: #ffffff;
}

.brand-logo .logo-pahe {
    color: var(--accent-pink);
}

.nav-menu {
    display: flex;
    gap: 18px;
    align-items: center;
}

.nav-link {
    color: #a0a5aa;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
}

/* Search Box */
.nav-right {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #717579;
    font-size: 13px;
}

.search-box input {
    width: 100%;
    background-color: #f1f3f5;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 12px 6px 34px;
    font-size: 14px;
    color: #212529;
    outline: none;
    transition: all 0.2s ease;
}

.search-box input:focus {
    background-color: #ffffff;
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 2px rgba(215, 56, 94, 0.25);
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #121315;
    border: 1px solid #292b2e;
    border-radius: 4px;
    margin-top: 5px;
    max-height: 380px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.search-dropdown.hidden {
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #1c1e22;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background-color: #202226;
}

.search-result-item img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 2px;
}

.search-result-info h4 {
    font-size: 13px;
    color: #ffffff;
    margin-bottom: 2px;
}

.search-result-info span {
    font-size: 11px;
    color: var(--accent-pink);
}

/* ==========================================================================
   Pink Alert / Announcement Banner
   ========================================================================== */
.alert-banner {
    background-color: var(--accent-pink);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(215, 56, 94, 0.35);
    position: relative;
}

.alert-banner.hidden {
    display: none;
}

.alert-content {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.alert-content p {
    margin: 0;
    letter-spacing: 0.2px;
}

.alert-content a {
    color: #ffffff;
    font-weight: 700;
    text-decoration: underline;
}

.alert-close {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
    transition: color 0.15s;
}

.alert-close:hover {
    color: #ffffff;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 60px;
    flex: 1;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 26px;
    font-weight: 500;
    color: #f1f3f5;
    letter-spacing: -0.3px;
}

.release-count {
    color: var(--text-muted);
    font-size: 13px;
}

/* ==========================================================================
   Latest Releases Grid (Exact 3-Column Layout from Screenshot)
   ========================================================================== */
.releases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.anime-card {
    position: relative;
    background-color: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.anime-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.card-media {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Widescreen Aspect Ratio */
    background-color: #1a1a1a;
    overflow: hidden;
}

.card-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.anime-card:hover .card-media img {
    transform: scale(1.03);
}

/* Bottom Dark Gradient Overlay */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 12px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    flex: 1;
}

/* Right side episode badge / checkmark */
.card-ep-badge {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
}

.card-completed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--badge-green);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination-wrapper {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: #0d0e10;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #1c1d20;
}

.page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    padding: 0 8px;
    background-color: #121417;
    color: #8c9094;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.page-item:not(.disabled):not(.active) .page-link:hover {
    background-color: #22252a;
    color: #ffffff;
}

.page-item.active .page-link {
    background-color: var(--accent-pink);
    color: #ffffff;
}

.page-item.disabled .page-link {
    background-color: transparent;
    color: #404347;
    cursor: not-allowed;
}

/* ==========================================================================
   Video Player Modal
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-container {
    background-color: #0e0f12;
    border: 1px solid #23252a;
    border-radius: 6px;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #1c1e22;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-box h3 {
    font-size: 18px;
    color: #ffffff;
}

.modal-ep-badge {
    background-color: var(--accent-pink);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #8c9094;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close-btn:hover {
    color: #ffffff;
}

.modal-body {
    padding: 20px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background-color: #000000;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

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

.player-controls-bar {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background-color: #14161a;
    padding: 12px 16px;
    border-radius: 4px;
}

.server-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a0a5aa;
    font-size: 14px;
}

.server-selector select {
    background-color: #1e2126;
    color: #ffffff;
    border: 1px solid #31353e;
    padding: 6px 12px;
    border-radius: 3px;
    outline: none;
    font-size: 13px;
    cursor: pointer;
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action {
    background-color: #1e2126;
    color: #e1e4e8;
    border: 1px solid #31353e;
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-action:hover {
    background-color: #292d34;
    color: #ffffff;
}

.btn-download {
    background-color: var(--accent-pink);
    border-color: var(--accent-pink);
    color: #ffffff;
}

.btn-download:hover {
    background-color: var(--accent-pink-hover);
}

.anime-info-panel {
    margin-top: 18px;
    border-top: 1px solid #1c1e22;
    padding-top: 16px;
}

.info-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.info-tag {
    background-color: #1c1e22;
    color: #8c9094;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
}

.anime-synopsis {
    color: #a0a5aa;
    font-size: 13px;
    line-height: 1.6;
}

/* Floating Importer Dock notification */
.importer-floating-dock {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #101216;
    border: 1px solid #292c34;
    border-left: 4px solid var(--accent-pink);
    padding: 12px 18px;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 90;
    max-width: 320px;
}

.importer-dock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.importer-dock-header i {
    color: var(--accent-pink);
    margin-right: 4px;
}

.dock-badge {
    background-color: rgba(215, 56, 94, 0.2);
    color: var(--accent-pink);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.importer-dock-text {
    font-size: 12px;
    color: #8c9094;
    margin: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--bg-header);
    border-top: 1px solid #141414;
    padding: 24px 0;
    text-align: center;
    margin-top: auto;
}

.footer-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 6px;
}

.footer .disclaimer {
    font-size: 11px;
    color: #555a60;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
    .releases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .releases-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        flex-direction: column;
        gap: 14px;
    }

    .search-box {
        width: 100%;
    }

    .alert-content p {
        font-size: 12px;
        padding-right: 20px;
    }

    .importer-floating-dock {
        display: none;
    }
}

/* ==========================================================================
   Anime Index Page Styles (/anime)
   ========================================================================== */
.index-page-wrapper {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 60px;
    flex: 1;
}

.index-header-title {
    font-size: 32px;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 22px;
    letter-spacing: -0.5px;
}

/* Alphabet Filter Bar */
.alphabet-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 36px;
}

.alphabet-btn {
    color: var(--accent-pink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.15s ease;
    user-select: none;
}

.alphabet-btn:hover {
    color: #ffffff;
    background-color: rgba(215, 56, 94, 0.25);
}

.alphabet-btn.active {
    background-color: var(--accent-pink);
    color: #ffffff !important;
}

/* 2-Column Anime Directory Grid */
.anime-index-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 40px;
}

.anime-index-item {
    display: flex;
    align-items: baseline;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}

.anime-index-item a {
    color: #e53966;
    text-decoration: none;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.anime-index-item a:hover {
    color: #ff6b8b;
    text-decoration: underline;
}

/* BD (Blu-ray Disc) Badge */
.badge-bd {
    display: inline-block;
    background-color: #007bff;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 2px;
    margin-left: 6px;
    line-height: 1.2;
    vertical-align: middle;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* DVD Badge */
.badge-dvd {
    display: inline-block;
    background-color: #e0a800;
    color: #000000;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 2px;
    margin-left: 6px;
    line-height: 1.2;
    vertical-align: middle;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .anime-index-columns {
        grid-template-columns: 1fr;
        gap: 6px 0;
    }

    .alphabet-filter-bar {
        gap: 6px 10px;
    }
}

/* ==========================================================================
   Single Series Page Styles (/anime/:id)
   ========================================================================== */
.series-backdrop-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    background-size: cover;
    background-position: center 25%;
    background-repeat: no-repeat;
    overflow: hidden;
}

.series-backdrop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0%, rgba(11, 12, 13, 0.2) 40%, rgba(11, 12, 13, 0.8) 75%, #050505 100%);
}

.series-content-wrapper {
    max-width: 1240px;
    margin: -190px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.series-meta-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.series-poster-box {
    flex: 0 0 240px;
    max-width: 240px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    overflow: hidden;
    background-color: #121212;
}

.series-poster-box img {
    width: 100%;
    display: block;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.series-details-box {
    flex: 1;
    min-width: 0;
}

.series-main-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    line-height: 1.25;
}

.series-romaji-title {
    font-size: 15px;
    color: #a0a5aa;
    margin-bottom: 18px;
    font-weight: 400;
}

/* Tabs: Summary & Relations */
.series-nav-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #1f2228;
    margin-bottom: 18px;
}

.series-tab-btn {
    background: none;
    border: none;
    color: #8c9094;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 0;
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease;
}

.series-tab-btn:hover {
    color: #ffffff;
}

.series-tab-btn.active {
    color: #ffffff;
}

.series-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent-pink);
}

/* 2-column info layout below tabs */
.series-tab-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 36px;
}

.series-synopsis-text {
    font-size: 14px;
    line-height: 1.7;
    color: #b0b4b8;
}

.series-synopsis-text p {
    margin-bottom: 14px;
}

.series-meta-specs {
    font-size: 13px;
    color: #ffffff;
    line-height: 1.85;
}

.meta-spec-row {
    margin-bottom: 2px;
}

.meta-spec-label {
    color: #ffffff;
    font-weight: 600;
    margin-right: 4px;
}

.meta-spec-value {
    color: #c0c4c8;
}

.meta-spec-value a {
    color: var(--accent-pink);
    text-decoration: none;
}

.meta-spec-value a:hover {
    text-decoration: underline;
}

.series-genre-pills {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.genre-pill {
    background-color: #14161a;
    color: var(--accent-pink);
    border: 1px solid #282a30;
    padding: 3px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.genre-pill:hover {
    background-color: var(--accent-pink);
    color: #ffffff;
}

/* ==========================================================================
   Episodes Section on Series Page
   ========================================================================== */
.series-episodes-section {
    margin-top: 48px;
}

.episodes-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #111317;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.episodes-count-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.episodes-sort-group {
    display: flex;
    gap: 2px;
}

.sort-toggle-btn {
    background-color: transparent;
    color: #8c9094;
    border: none;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.sort-toggle-btn.active {
    background-color: #242830;
    color: #ffffff;
}

.series-episodes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ep-card {
    position: relative;
    background-color: #14161a;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ep-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}

.ep-media {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background-color: #1a1a1a;
    overflow: hidden;
}

.ep-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ep-card:hover .ep-media img {
    transform: scale(1.03);
}

.ep-badge-bd {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #007bff;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-bottom-right-radius: 3px;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.ep-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 12px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    z-index: 2;
}

.ep-duration {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.ep-num {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

@media (max-width: 992px) {
    .series-episodes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .series-tab-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .series-meta-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .series-poster-box {
        max-width: 180px;
    }
    .series-nav-tabs {
        justify-content: center;
    }
    .series-episodes-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Single Episode Player Page Styles (/play/:series/:episode)
   ========================================================================== */
.play-page-wrapper {
    position: relative;
/* Alert Notification Banner (Signature AnimePahe Pink) */
.alert-banner {
    position: relative;
    background-color: #d7385e;
    color: #ffffff;
    font-size: 13px;
    padding: 8px 32px 8px 16px;
    text-align: center;
    z-index: 50;
    line-height: 1.4;
}

.alert-banner.hidden {
    display: none;
}

.alert-content p {
    margin: 0;
    color: #ffffff;
}

.alert-content a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 500;
}

.alert-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.85;
}

.alert-close:hover {
    opacity: 1;
}

/* Single Episode Play Page */
.play-page-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Dynamic Previous and Next Episode Backdrops */
.play-backdrop-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background-color: #0c0d10;
}

.play-backdrop-prev {
    position: absolute;
    top: 0;
    left: 0;
    width: 48vw;
    height: 100vh;
    background-size: cover;
    background-position: left center;
    background-repeat: no-repeat;
    filter: blur(14px);
    opacity: 0.92;
    transform: scale(1.08);
    transition: opacity 0.3s ease, background-image 0.3s ease;
}

.play-backdrop-next {
    position: absolute;
    top: 0;
    right: 0;
    width: 48vw;
    height: 100vh;
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
    filter: blur(14px);
    opacity: 0.92;
    transform: scale(1.08);
    transition: opacity 0.3s ease, background-image 0.3s ease;
}

.play-backdrop-prev.empty,
.play-backdrop-next.empty {
    opacity: 0 !important;
    background-image: none !important;
}

.theater-wrapper {
    position: relative;
    z-index: 10;
    max-width: 980px;
    width: 100%;
    margin: 18px auto 28px;
    padding: 0 16px;
}

/* 16:9 Theater Screen */
.theater-screen {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #22252a;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.click-to-load-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #22252a;
    cursor: pointer;
    z-index: 5;
    transition: background 0.15s ease;
}

.click-to-load-overlay:hover {
    background-color: #272a30;
}

.click-to-load-icon {
    font-size: 46px;
    color: #ffffff;
    margin-bottom: 8px;
}

.click-to-load-label {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 0.2px;
}

.player-active-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 4;
}

/* Control Bar directly below player */
.theater-control-strip {
    position: relative;
    display: flex;
    background-color: #16181c;
    border-top: 1px solid #23252a;
    border-radius: 0 0 4px 4px;
    z-index: 20;
    height: 40px;
}

.theater-ctrl-col {
    position: relative;
    flex: 1;
    border-right: 1px solid #23252a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theater-ctrl-col:last-child {
    border-right: none;
}

.theater-ctrl-trigger {
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 400;
    color: #c7cbcf;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.theater-ctrl-trigger:hover {
    color: #ffffff;
    background-color: #1e2025;
}

.theater-ctrl-caret {
    font-size: 9px;
    color: #8a8e94;
    margin-left: 2px;
}

/* Dropdown Menus */
.theater-dropdown-popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    min-width: 100%;
    background-color: #ffffff;
    border-radius: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
    margin-bottom: 0px;
    overflow: hidden;
    z-index: 100;
}

#popover-episodes {
    min-width: 140px;
    left: 50%;
    transform: translateX(-50%);
}

#popover-quality {
    min-width: 100%;
    left: 0;
}

#popover-download {
    min-width: 180px;
    right: 0;
    left: auto;
}

.theater-dropdown-popover.hidden {
    display: none;
}

.theater-popover-item {
    display: block;
    padding: 8px 14px;
    font-size: 12px;
    color: #212529;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.theater-popover-item:hover {
    background-color: #f1f3f5;
    color: #000000;
}

.theater-popover-item.active {
    background-color: var(--accent-pink) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Server Selection Popover (Top-side tabs) */
.server-tab-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    margin-bottom: 0px;
    z-index: 100;
}

.server-tab-popup.hidden {
    display: none;
}

.server-pill-btn {
    width: 100%;
    background-color: var(--accent-pink);
    color: #ffffff;
    border: none;
    padding: 7px 0;
    font-size: 13px;
    font-weight: 600;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 0 -2px 8px rgba(215, 56, 94, 0.4);
    text-transform: lowercase;
    display: block;
    text-align: center;
}

/* Side navigation arrows (< and >) - Only visible on screen hover */
.theater-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 34px;
    text-decoration: none;
    cursor: pointer;
    padding: 18px 14px;
    z-index: 15;
    user-select: none;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.theater-screen:hover .theater-nav-arrow {
    opacity: 1;
}

.theater-nav-arrow:hover {
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
}

.theater-nav-arrow.prev {
    left: 0px;
}

.theater-nav-arrow.next {
    right: 0px;
}

/* Anime Info Box directly under control bar */
.anime-player-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.anime-player-thumb {
    width: 44px;
    height: 44px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.anime-player-meta h3 {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    line-height: 1.2;
}

.anime-series-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.15s ease;
}

.anime-series-link:hover {
    color: var(--accent-pink);
    text-decoration: underline;
}

.anime-title-sep {
    color: #8c9094;
    font-weight: 400;
    margin: 0 4px;
}

.anime-player-meta p {
    font-size: 12px;
    color: #8c9094;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .theater-nav-arrow {
        display: none;
    }
    .theater-ctrl-trigger {
        font-size: 11px;
        padding: 8px 6px;
    }
}

/* ==========================================================================
   All Episodes Selector Box - Modern Sleek Toolbar
   ========================================================================== */
.episodes-box {
    margin-top: 24px;
    padding-bottom: 30px;
    width: 100%;
}

.episodes-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #141519;
    border: 1px solid #21232a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.ep-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ep-badge-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: 0.3px;
}

.ep-badge-title i {
    color: var(--accent-pink);
}

.ep-badge-count {
    font-size: 11px;
    font-weight: 600;
    background-color: #202228;
    color: #8c9094;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #2b2e36;
}

.episodes-ranges-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
    padding: 2px 0;
}

.episodes-ranges-tabs::-webkit-scrollbar {
    display: none;
}

.range-tab {
    background-color: #1e2026;
    border: 1px solid #2a2d35;
    font-size: 12px;
    font-weight: 600;
    color: #8c9094;
    cursor: pointer;
    padding: 5px 14px;
    border-radius: 20px;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.range-tab:hover {
    background-color: #292d36;
    color: #ffffff;
    border-color: #3e434f;
}

.range-tab.active {
    background-color: var(--accent-pink) !important;
    color: #ffffff !important;
    border-color: var(--accent-pink) !important;
    box-shadow: 0 2px 10px rgba(215, 56, 94, 0.45);
    font-weight: 700;
}

.ep-quick-search-box {
    display: flex;
    align-items: center;
    background-color: #1c1e24;
    border: 1px solid #2b2e36;
    border-radius: 20px;
    padding: 4px 10px;
    gap: 8px;
    flex-shrink: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ep-quick-search-box:focus-within {
    border-color: var(--accent-pink);
    box-shadow: 0 0 8px rgba(215, 56, 94, 0.3);
}

.ep-search-icon {
    font-size: 12px;
    color: #6c727a;
}

.episodes-search-input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    width: 90px;
    outline: none;
    padding: 0;
    transition: width 0.2s ease;
}

.episodes-search-input:focus {
    width: 110px;
}

.episodes-search-input::placeholder {
    color: #5a5f66;
}

/* 16-Column Episode Grid (Exact 1:1 match to screenshot) */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 6px;
}

.ep-grid-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    background-color: #25272c;
    color: #8c9094;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #2e3037;
    transition: all 0.15s ease;
    user-select: none;
}

.ep-grid-btn:hover {
    background-color: #363941;
    color: #ffffff;
    border-color: #484b55;
    transform: translateY(-1px);
}

.ep-grid-btn.active {
    background-color: var(--accent-pink) !important;
    border-color: var(--accent-pink) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(215, 56, 94, 0.45);
}

@media (max-width: 1024px) {
    .episodes-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .episodes-box-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .ep-nav-left {
        justify-content: space-between;
    }
    .episodes-ranges-tabs {
        width: 100%;
    }
    .ep-quick-search-box {
        width: 100%;
    }
    .episodes-search-input {
        width: 100% !important;
    }
    .episodes-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
    .ep-grid-btn {
        height: 34px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .episodes-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Header Settings & Customization Modal
   ========================================================================== */
.btn-theme-settings {
    background: #16181c;
    border: 1px solid #282a2e;
    color: #8c9094;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    margin-left: 10px;
}

.btn-theme-settings:hover {
    background: #23252a;
    color: #ffffff;
    border-color: var(--accent-pink);
}

.brand-logo-img {
    max-height: 28px;
    width: auto;
    object-fit: contain;
    display: block;
}

.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.settings-modal-overlay.hidden {
    display: none;
}

.settings-modal-card {
    background-color: #121417;
    border: 1px solid #23252a;
    border-radius: 6px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: settingsFadeIn 0.2s ease-out;
}

@keyframes settingsFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: #0e0f12;
    border-bottom: 1px solid #23252a;
}

.settings-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-modal-close {
    background: none;
    border: none;
    color: #8c9094;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

.settings-modal-close:hover {
    color: #ffffff;
}

.settings-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-label {
    font-size: 13px;
    font-weight: 600;
    color: #c7cbcf;
}

.setting-desc {
    font-size: 11px;
    color: #6c727a;
    margin-bottom: 4px;
}

.setting-input,
.setting-textarea {
    background-color: #1a1c21;
    border: 1px solid #2c2f35;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
    font-family: inherit;
}

.setting-input:focus,
.setting-textarea:focus {
    border-color: var(--accent-pink);
}

.setting-textarea {
    min-height: 70px;
    resize: vertical;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-modal-footer {
    padding: 14px 20px;
    background-color: #0e0f12;
    border-top: 1px solid #23252a;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-setting-cancel {
    background: none;
    border: 1px solid #2c2f35;
    color: #c7cbcf;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-setting-cancel:hover {
    background: #1e2025;
    color: #ffffff;
}

.btn-setting-save {
    background: var(--accent-pink);
    border: none;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-setting-save:hover {
    background: var(--accent-pink-hover);
}

.footer {
    display: none !important;
}
