:root {
    --bg: #070b12;
    --bg-soft: #0f1621;
    --panel: #0f1621;
    --panel-hover: #121b27;
    --border: rgba(255,255,255,.09);
    --text: #f4f7fb;
    --muted: #92a0b3;
    --accent: #68e4a2;
    --accent-strong: #45d993;
    --accent-dark: #0f1621;
    --danger: #ff8787;
    --radius: 16px;
    --shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    background: transparent;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.brand {
    border: 0;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: #07110c;
    background: var(--accent);
    font-size: 13px;
}

.hero {
    min-height: 410px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    padding: 68px 0 48px;
}

.hero-copy { max-width: 760px; }

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(38px, 7vw, 68px);
    line-height: .98;
    letter-spacing: -.055em;
}

.hero-subtitle {
    max-width: 650px;
    margin: 20px auto 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.search-form {
    width: min(760px, 100%);
    margin-top: 34px;
}

.search-box {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    background: #121b27;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 9px;
    box-shadow: var(--shadow);
}

.search-box:focus-within { border-color: rgba(104,228,162,.55); }

.search-icon {
    padding-left: 10px;
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
}

.search-box input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 17px;
}

.search-box input::placeholder { color: #92a0b3; }

.search-submit {
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #07110c;
    padding: 13px 20px;
    cursor: pointer;
    font-weight: 800;
}

.search-submit:hover { background: var(--accent-strong); }

.status-area {
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #121b27;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.search-results-section, .details-section { padding: 28px 0 70px; }

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -.025em;
}

.result-count { color: var(--muted); font-size: 14px; }

.title-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
}

.title-card {
    padding: 0;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.poster-frame {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 13px;
    background: #121b27;
    border: 1px solid var(--border);
    transition: transform .16s ease, border-color .16s ease;
}

.title-card:hover .poster-frame {
    transform: translateY(-3px);
    border-color: #121b27;
}

.poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #92a0b3;
    font-size: 36px;
}

.media-badge {
    position: absolute;
    left: 9px;
    bottom: 9px;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(9, 13, 18, .84);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 800;
}

.title-card h3 {
    margin: 10px 0 2px;
    font-size: 15px;
    line-height: 1.35;
}

.title-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.back-button {
    margin-bottom: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.back-button:hover { color: var(--text); }

.title-hero {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.title-hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 25%;
    opacity: .24;
}

.title-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0f1621 0%, rgba(15,22,33,.94) 36%, rgba(15,22,33,.76) 100%);
}

.title-hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 28px;
    align-items: center;
    min-height: 320px;
    padding: 34px;
}

.detail-poster-wrap {
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #121b27;
    border: 1px solid rgba(255,255,255,.1);
}

.detail-poster-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-copy h1 {
    margin: 6px 0 12px;
    font-size: clamp(32px, 5vw, 52px);
    letter-spacing: -.045em;
    line-height: 1.04;
}

.detail-copy > p {
    max-width: 760px;
    margin: 0;
    color: #92a0b3;
    line-height: 1.6;
}

.detail-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.availability-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.summary-pill {
    padding: 8px 10px;
    border-radius: 9px;
    background: rgba(104,228,162,.1);
    border: 1px solid rgba(104,228,162,.18);
    color: #68e4a2;
    font-size: 13px;
    font-weight: 700;
}

.controls-panel {
    margin: 24px 0 18px;
    border: 1px solid var(--border);
    background: rgba(18,27,39,.78);
    border-radius: 15px;
    padding: 13px;
}

.control-row, .filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.top-controls {
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.filter-row { padding-top: 12px; }

.segmented {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--border);
    background: #0f1621;
    border-radius: 11px;
}

.segment, .filter-chip {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 750;
}

.segment {
    padding: 8px 13px;
    border-radius: 8px;
}

.segment.active {
    color: var(--text);
    background: #121b27;
}

.filter-chip {
    padding: 7px 10px;
    border-radius: 9px;
}

.filter-chip:hover, .filter-chip.active {
    color: var(--text);
    background: #121b27;
}


.availability-content {
    display: grid;
    gap: 12px;
}

.availability-card {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius);
    overflow: hidden;
}

.availability-card-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 15px 17px;
    border-bottom: 1px solid var(--border);
}

.location-title, .provider-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.location-title h3, .provider-title h3 {
    margin: 0;
    font-size: 16px;
}

.country-flag {
    width: 28px;
    height: 19px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.12);
    flex: 0 0 auto;
}

.country-chip .country-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
}

.flag-fallback {
    font-size: 20px;
    line-height: 1;
}

.provider-title-logo, .provider-logo {
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    background: #f4f4f4;
    border-radius: 9px;
}

.provider-title-logo { width: 36px; height: 36px; }
.provider-logo { width: 42px; height: 42px; }

.provider-title-logo img, .provider-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.availability-count, .external-link {
    color: var(--muted);
    font-size: 12px;
}

.external-link { text-decoration: none; }
.external-link:hover { color: var(--accent); }

.provider-list { padding: 5px 17px; }

.provider-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,.055);
}

.provider-row:last-child { border-bottom: 0; }

.provider-info {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.provider-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 750;
}

.type-badges {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.type-badge {
    padding: 5px 7px;
    border-radius: 7px;
    background: #121b27;
    color: #92a0b3;
    font-size: 11px;
    font-weight: 800;
}

.country-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 15px 17px;
}

.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-radius: 9px;
    background: #121b27;
    color: #f4f7fb;
    font-size: 12px;
    font-weight: 700;
}

.more-countries-wrap {
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
}

.more-countries-button {
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #121b27;
    color: #f4f7fb;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.more-countries-button:hover {
    border-color: #121b27;
    background: #121b27;
    color: var(--text);
}

.empty-state {
    padding: 50px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
}

.empty-state strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 18px;
}


.provider-scope-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.manage-favorites-button,
.inline-action-button,
.secondary-button,
.primary-button {
    border-radius: 9px;
    cursor: pointer;
    font-weight: 800;
}

.manage-favorites-button {
    border: 1px solid var(--border);
    background: #0f1621;
    color: #f4f7fb;
    padding: 9px 12px;
}

.manage-favorites-button:hover,
.inline-action-button:hover,
.secondary-button:hover {
    border-color: #121b27;
    background: #121b27;
    color: var(--text);
}

.inline-action-button {
    display: block;
    margin: 16px auto 0;
    border: 1px solid var(--border);
    background: #121b27;
    color: #f4f7fb;
    padding: 9px 13px;
}

body.modal-open { overflow: hidden; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 7, 11, .78);
    backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] { display: none; }

.favorites-modal {
    width: min(760px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #121b27;
    box-shadow: 0 30px 100px rgba(0,0,0,.55);
}

.favorites-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 22px 16px;
}

.favorites-modal-header h2 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -.025em;
}

.favorites-modal-header p:not(.eyebrow) {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.modal-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #121b27;
    color: var(--muted);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

.favorites-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px 16px;
    border-bottom: 1px solid var(--border);
}

.favorites-toolbar input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    outline: 0;
    border-radius: 10px;
    background: #0f1621;
    color: var(--text);
    padding: 11px 12px;
}

.favorites-toolbar input:focus { border-color: rgba(104,228,162,.55); }
.favorites-toolbar input::placeholder { color: #92a0b3; }

.favorites-selection-count {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.favorites-provider-list {
    overflow: auto;
    padding: 10px 14px;
}

.favorite-provider-item {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    padding: 8px;
    text-align: left;
    cursor: pointer;
}

.favorite-provider-item:hover { background: #121b27; }
.favorite-provider-item.selected {
    border-color: rgba(104,228,162,.25);
    background: rgba(104,228,162,.08);
}

.favorite-provider-logo {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 9px;
    background: #f4f4f4;
}

.favorite-provider-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-provider-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 750;
}

.favorite-provider-check {
    color: var(--accent);
    font-size: 20px;
}

.favorites-loading {
    padding: 32px 16px;
    text-align: center;
    color: var(--muted);
}

.favorites-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
}

.secondary-button {
    border: 1px solid var(--border);
    background: #121b27;
    color: #f4f7fb;
    padding: 10px 14px;
}

.primary-button {
    border: 0;
    background: var(--accent);
    color: #07110c;
    padding: 10px 18px;
}

.primary-button:hover { background: var(--accent-strong); }


footer {
    padding: 28px 0 42px;
    border-top: 1px solid rgba(255,255,255,.06);
    color: #92a0b3;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

footer p { margin: 3px 0; }

@media (max-width: 720px) {
    .app-shell { width: min(100% - 22px, 1180px); }
    .topbar { height: 58px; }
    .hero { min-height: 340px; padding-top: 52px; }
    .hero-subtitle { font-size: 15px; }
    .search-box { grid-template-columns: auto 1fr; }
    .search-submit { grid-column: 1 / -1; width: 100%; }
    .title-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .title-hero-content { grid-template-columns: 92px 1fr; gap: 17px; padding: 22px; min-height: 250px; }
    .title-hero { min-height: 250px; }
    .detail-copy > p { display: none; }
    .detail-copy h1 { font-size: 30px; }
    .top-controls { align-items: flex-start; gap: 13px; }
    .provider-scope-controls { width: 100%; justify-content: flex-start; }
    .favorites-modal { max-height: calc(100vh - 20px); }
    .modal-backdrop { padding: 10px; }
    .favorites-toolbar { align-items: stretch; flex-direction: column; }
    .favorites-selection-count { padding-left: 2px; }
    .provider-row { align-items: flex-start; }
    .type-badges { max-width: 42%; }
}

/* Seizoensdekking voor series */
.summary-pill-warning {
    background: rgba(255, 196, 92, .10);
    border-color: rgba(255, 196, 92, .22);
    color: #ffd898;
}

.type-badge-detailed {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.15;
}

.type-badge-seasons {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.country-chip-detailed {
    align-items: flex-start;
}

.country-chip-copy {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.15;
}

.country-chip-seasons {
    color: #92a0b3;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .type-badges { max-width: 58%; }
    .type-badge-seasons,
    .country-chip-seasons { white-space: normal; }
}
