/* --------------------------------------------------
   BBFC Stylesheet (clean, theme-ready)
   -------------------------------------------------- */

/* Theme variables (light default) */
:root {
    --bg-card: #fff;
    --bg-card-header: #f8f9fa;
    --bg-modal: #fff;
    --bg-modal-overlay: rgba(0,0,0,0.6);
    --bg-search-status: #111;
    --text-default: #000;
    --text-muted: #6c757d;
    --text-inverse: #eee;
    --border-default: #ccc;
    --accent: #3b82f6;
}

.dark {
    --bg-card: #1e1e1e;
    --bg-card-header: #2f2f2f; /* darker header contrast */
    --bg-modal: #2a2a2a;
    --bg-modal-overlay: rgba(0,0,0,0.8);
    --bg-search-status: #000;
    --text-default: #f5f5f5;
    --text-muted: #bbb; /* brighter muted text */
    --text-inverse: #ddd;
    --border-default: #555; /* visible but subtle */
    --accent: #90caf9;
}


/* Lift the drawer above MudPopover/Tooltip layer */
.mylist-drawer {
    z-index: 1500 !important; /* MudPopover default ~1200 */
}


.mud-card {
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

    .mud-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }

.mud-drawer-header {
    background-color: var(--mud-palette-background);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}



/* Film search header */
.film-search-container {
    text-align: center;
    margin-top: 40px;
    font-family: Arial, sans-serif;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

    .header i {
        color: var(--accent);
        margin-right: 10px;
    }

.title {
    font-size: 1.5rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Search box */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    margin-top: 24px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-default, #ccc);
    border-radius: 9999px;
    padding: 6px 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-icon {
    color: var(--text-muted, #777);
    font-size: 1rem;
    margin-left: 4px;
    margin-right: 8px;
}

.search-field {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-default, #222);
    padding: 8px 8px;
}

.clear-btn,
.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted, #777);
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    transition: color 0.2s ease;
}

    .clear-btn:hover,
    .icon-btn:hover {
        color: var(--text-strong, #000);
    }

.clear-btn {
    margin-right: 4px;
}

.search-bar:focus-within {
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.search-capsule {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-bottom: none; /* remove bottom line to blend */
    border-radius: 16px 16px 0 0; /* rounded top only */
    padding: 12px 36px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
    overflow: visible;
    margin-bottom: 0;
}

    .search-capsule.open {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

.advanced-filters {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease;
}

    .advanced-filters.open {
        max-height: 400px; /* large enough for content */
        opacity: 1;
        transform: translateY(0);
        margin-top: 10px;
    }

/* Result summary (directly below capsule) */
.result-summary {
    max-width: 900px;
    margin: 0 auto 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-top: none; /* joins capsule cleanly */
    border-radius: 0 0 16px 16px; /* rounded bottom only */
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    margin-top: 0;
}

    /* Optional: subtle divider line between summary header and pills */
    .result-summary h4 {
        border-bottom: 1px solid var(--border-default);
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }


/* Filters */
.filters-container {
    max-width: 900px;
    margin-left: auto;   
    margin-right: auto;   
    margin-top: 0;   
    border-radius: 8px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top:16px;
    margin-left:16px;
    margin-right:16px;
}

.filter-item label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: var(--text-default);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-item input,
.filter-item select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    color: var(--text-default);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-modal);
    color: var(--text-default);
    padding: 20px;
    border-radius: 10px;
    width: 500px;
    max-width: 92%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Results + Cards */
.results-list {
    max-width: 1000px;
    margin: 24px auto;
    display: grid;
    gap: 16px;
}

.results-empty {
    max-width: 800px;
    margin: 24px auto;
    text-align: center;
    color: var(--text-muted);
}

.feature-card {
    border: 1px solid var(--border-default);
    border-radius: 6px;
    margin: 20px 0;
    padding: 15px;
    background: var(--bg-card);
}

.feature-header {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 1rem;
}

    .feature-header .poster {
        width: 120px;
        border-radius: 4px;
        object-fit: cover;
        margin-bottom: 1rem;
    }

    .feature-header .meta {
        flex: 1;
        min-width: 250px;
    }

.meta h3 {
    margin: 0 0 10px;
    font-size: 1.15rem; 
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-default);
}

.meta p {
    margin: 6px 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Releases */
.release {
    border-top: 1px solid var(--border-default);
    padding: 10px 0;
}

.release-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: var(--bg-card-header);
    padding: 8px;
    border-radius: 4px;
}

.rating-icon {
    height: 30px;
    margin-right: 8px;
}

.release-details {
    margin-top: 10px;
    background: var(--bg-card-header);
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Chips in dark mode get some lift */
.dark .mud-chip {
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
}

/* Runtime + Advice */
.runtime,
.advice {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    font-size: 0.85rem;
    color: var(--text-default);
}

    .runtime .mud-icon-root {
        font-size: 1rem;
        margin-right: 4px;
    }

/* Details grid */
.details-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
}

    .details-grid dt {
        font-weight: 600;
        white-space: nowrap;
    }

    .details-grid dd {
        margin: 0;
    }

/* Codes footer */
.codes {
    font-size: 0.9rem;
    display: flex;
    gap: 2rem;
    color: var(--text-muted);
}

    .codes a {
        color: var(--text-muted);
        text-decoration: none;
    }

        .codes a:hover {
            text-decoration: underline;
            color: var(--text-default);
        }



/* --------------------------------------------------
   Searching modal (loading box)
   -------------------------------------------------- */
.modal-content.search-status {
    background: var(--bg-search-status);
    color: var(--text-inverse);
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.icon-wrapper {
    background: #222;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: var(--accent);
}

.search-term-box {
    background: #222;
    border-radius: 6px;
    padding: 10px;
    margin: 16px 0;
    font-size: 14px;
    color: #ccc;
}

    .search-term-box strong {
        color: var(--accent);
    }

.progress-bar {
    background: #333;
    border-radius: 6px;
    height: 6px;
    margin-top: 10px;
}

.progress {
    background: var(--accent);
    height: 100%;
    border-radius: 6px;
}

.progress-text {
    margin-top: 6px;
    font-size: 12px;
    color: #aaa;
}


.poster-box {
    position: relative;
    width: 190px;
    height: 266px;
    overflow: hidden;
    flex: 0 0 auto;
    background: transparent;
}

/* spinner sits on top of generic */
/* HTML: <div class="loader"></div> */

.loader-container {
    width: 120px;
    height: 190px; /* whatever your poster height is */
    display: flex;
    align-items: center;
    justify-content: center;
}

.FeatureLoader {
    --R: 30px;
    --g1: #514b82 96%, #0000;
    --g2: #eeeeee 96%, #0000;
    width: calc(2*var(--R));
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    -webkit-mask: linear-gradient(#000 0 0);
    animation: l30 2s infinite linear;
}

    .FeatureLoader::before,
    .FeatureLoader::after {
        content: "";
        grid-area: 1/1;
        width: 50%;
        background: radial-gradient(farthest-side,var(--g1)) calc(var(--R) + 0.866*var(--R) - var(--R)) calc(var(--R) - 0.5*var(--R) - var(--R)), radial-gradient(farthest-side,var(--g1)) calc(var(--R) + 0.866*var(--R) - var(--R)) calc(var(--R) - 0.5*var(--R) - var(--R)), radial-gradient(farthest-side,var(--g2)) calc(var(--R) + 0.5*var(--R) - var(--R)) calc(var(--R) - 0.866*var(--R) - var(--R)), radial-gradient(farthest-side,var(--g1)) 0 calc(-1*var(--R)), radial-gradient(farthest-side,var(--g2)) calc(var(--R) - 0.5*var(--R) - var(--R)) calc(var(--R) - 0.866*var(--R) - var(--R)), radial-gradient(farthest-side,var(--g1)) calc(var(--R) - 0.866*var(--R) - var(--R)) calc(var(--R) - 0.5*var(--R) - var(--R)), radial-gradient(farthest-side,var(--g2)) calc(-1*var(--R)) 0, radial-gradient(farthest-side,var(--g1)) calc(var(--R) - 0.866*var(--R) - var(--R)) calc(var(--R) + 0.5*var(--R) - var(--R));
        background-size: calc(2*var(--R)) calc(2*var(--R));
        background-repeat: no-repeat;
    }

    .FeatureLoader::after {
        transform: rotate(180deg);
        transform-origin: right;
    }

@keyframes l30 {
    100% {
        transform: rotate(-1turn)
    }
}



/*CSS for Series*/

/* Container */
.series-result {
    border-radius: 0.5rem;
    background-color: #fff;
}

    /* Poster box – same as features */
    .series-result .poster-container {
        width: 100px;
        height: 150px;
        flex: 0 0 auto;
        background-color: #808080;
        border-radius: .25rem;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .series-result .poster {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Header row (title + badge) */
    .series-result h5 {
        margin: 0;
        font-weight: 600;
    }

    .series-result .rating-badge {
        height: 28px;
    }

    .series-result .rating-badge-sm {
        height: 20px;
    }

    /* Seasons list */
    .series-result .seasons {
        margin-top: .5rem;
    } 

    .series-result .season {
        border: 1px solid #e5e5e5;
        border-radius: .25rem;
    }

        .series-result .season .card-header {
            background: #f9f9f9;
            padding: .25rem .5rem;
            font-size: .9rem;
        }

    .series-result .list-group-item {
        padding: .5rem .75rem;
        font-size: .875rem;
    }

    /* Episode list tweaks */
    .series-result .episode-order {
        width: 2rem;
        text-align: right;
    }

    .series-result .episode-main {
        flex: 1;
    }


/*END CSS for Series*/

/*CSS for Pills*/
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* --- Base pill --- */
.pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 9999px;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    background-color: #fff;
    color: #333;
}

    /* Hide the checkbox cleanly */
    .pill input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    /* Count text */
    .pill .count {
        font-size: 0.8rem;
        opacity: 0.75;
    }

/* --- Active states --- */
.kind-group .pill.active {
    background-color: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.usage-group .pill.active {
    background-color: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.format-group .pill.active {
    background-color: #0d9488;
    color: #fff;
    border-color: #0d9488;
}

/* Optional: icon alignment fix */
.pill i {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
}



/*END CSS for Pills*/

