@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --bg: #090d16;
    --bg-soft: #101827;
    --card: rgba(13, 20, 36, 0.86);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-soft: rgba(255, 255, 255, 0.04);
    --text: #edf3ff;
    --muted: rgba(237, 243, 255, 0.7);
    --gold: #d4af37;
    --blue: #3f83f8;
    --danger: #ef4444;
    --radius: 28px;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(34, 77, 190, 0.25), transparent 35%),
        radial-gradient(circle at top right, rgba(212, 175, 55, 0.1), transparent 32%),
        linear-gradient(180deg, #070b12 0%, #0b1120 100%);
    font-family: 'Inter', system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.auth-screen {
    background:
        radial-gradient(circle at top left, rgba(63, 131, 248, 0.24), transparent 34%),
        radial-gradient(circle at right, rgba(212, 175, 55, 0.12), transparent 20%),
        linear-gradient(180deg, #060913, #0c1528);
}
.auth-card {
    max-width: 1040px;
    overflow: hidden;
    border-radius: 32px;
    background: rgba(9, 15, 28, 0.86);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
}
.auth-left, .auth-right { min-height: 520px; }
.auth-left {
    background:
        radial-gradient(circle at 20% 20%, rgba(63, 131, 248, 0.28), transparent 30%),
        linear-gradient(180deg, rgba(7, 12, 22, 0.95), rgba(11, 17, 31, 0.96));
}
.auth-right { background: linear-gradient(180deg, rgba(15, 21, 36, 0.92), rgba(8, 11, 20, 0.92)); }
.eyebrow, .page-kicker {
    display: inline-flex;
    letter-spacing: .15em;
    font-size: .74rem;
    text-transform: uppercase;
    color: #9bbcff;
    margin-bottom: 1rem;
}
.text-soft { color: var(--muted); }
.feature-grid { display: grid; gap: .85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-chip {
    padding: .9rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: rgba(255,255,255,.04);
    font-size: .95rem;
}
.form-control, .form-select, .form-control-color {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    border-radius: 18px;
    min-height: 48px;
}
.form-control::placeholder { color: rgba(255,255,255,.4); }
.form-control:focus, .form-select:focus, .form-control-color:focus {
    background: rgba(255,255,255,.06);
    color: #fff;
    border-color: rgba(63,131,248,.55);
    box-shadow: 0 0 0 .25rem rgba(63,131,248,.15);
}
.form-range { accent-color: var(--blue); }
.btn { border-radius: 18px; font-weight: 600; }
.btn-primary {
    background: linear-gradient(135deg, #3f83f8, #5b8dff);
    border: none;
    box-shadow: 0 16px 30px rgba(63, 131, 248, .25);
}
.btn-primary:hover { background: linear-gradient(135deg, #4a8afb, #6a97ff); }
.btn-outline-light, .btn-outline-warning, .btn-outline-danger { border-color: rgba(255,255,255,.18); }

.dashboard-body {
    background:
        radial-gradient(circle at top, rgba(37, 76, 173, 0.22), transparent 38%),
        linear-gradient(180deg, #060a13 0%, #0a1220 100%);
}
.app-shell { display: flex; min-height: 100vh; gap: 24px; padding: 24px; }
.sidebar {
    width: 290px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 22px;
    border-radius: 32px;
    background: rgba(8, 14, 26, .88);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
}
.brand-link {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 22px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}
.brand-link small { display: block; color: var(--muted); }
.brand-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(63,131,248,.18), rgba(212,175,55,.14));
    font-size: 1.45rem;
}
.nav-stack { display: grid; gap: .75rem; }
.nav-item {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 54px;
    padding: 0 1rem;
    border-radius: 18px;
    color: rgba(237,243,255,.86);
    background: transparent;
    border: 1px solid transparent;
    transition: .22s ease;
}
.nav-item:hover, .nav-item.active {
    background: rgba(63,131,248,.12);
    border-color: rgba(63,131,248,.22);
    color: #fff;
}
.sidebar-user {
    display: flex;
    gap: .85rem;
    align-items: center;
    padding: .9rem;
    border-radius: 20px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}
.avatar-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(63,131,248,.25), rgba(212,175,55,.18));
    display: grid;
    place-items: center;
    font-weight: 800;
}
.content-area { flex: 1; min-width: 0; }
.mobile-topbar {
    display: none;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: space-between;
}
.page-header {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
}
.page-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 0 0 .35rem;
    font-weight: 800;
}
.page-description { margin: 0; color: var(--muted); }
.panel-card, .stat-card {
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}
.stat-card { padding: 1.4rem; display: grid; gap: .5rem; }
.stat-card small, .info-list span { color: var(--muted); }
.stat-card strong { font-size: 2rem; line-height: 1; }
.stat-card span { font-size: .95rem; }
.info-list { display: grid; gap: 1rem; }
.info-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 1rem;
}
.history-card {
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    transition: transform .22s ease, border-color .22s ease;
}
.history-card:hover { transform: translateY(-4px); border-color: rgba(63,131,248,.26); }
.history-card img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: #111827;
}
.history-card-body { padding: .95rem; display: grid; gap: .35rem; }
.history-card-large .history-card-body { padding: 1rem 1rem 1.15rem; }
.history-card-body strong { font-size: 1rem; }
.history-card-body span, .history-card-body small { color: var(--muted); }
.empty-state {
    grid-column: 1 / -1;
    padding: 3rem 1.5rem;
    text-align: center;
    border-radius: 28px;
    border: 1px dashed rgba(255,255,255,.14);
    background: rgba(255,255,255,.02);
}
.empty-icon { font-size: 2rem; margin-bottom: .75rem; }
.timeline-mini { display: grid; gap: .85rem; }
.timeline-mini > div { display: flex; gap: .9rem; color: var(--muted); }
.timeline-mini span {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(63,131,248,.15);
    color: #fff;
    font-weight: 700;
}
.sticky-builder { position: sticky; top: 24px; }
.control-section + .control-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
.search-results {
    display: grid;
    gap: .75rem;
    max-height: 320px;
    overflow: auto;
    padding-right: .25rem;
}
.search-result {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: .85rem;
    align-items: center;
    padding: .75rem;
    border-radius: 20px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
}
.search-result img {
    width: 70px;
    height: 98px;
    object-fit: cover;
    border-radius: 14px;
    background: #161f33;
}
.search-result h3 { font-size: 1rem; margin: 0 0 .2rem; }
.search-result p { margin: 0; color: var(--muted); font-size: .9rem; }
.template-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.template-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.03);
    color: var(--text);
    min-height: 52px;
    border-radius: 18px;
    font-weight: 600;
}
.template-btn.active {
    background: rgba(63,131,248,.14);
    border-color: rgba(63,131,248,.35);
}
.preview-shell {
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 620px;
}
.preview-frame { width: min(100%, 560px); display: grid; place-items: center; }
.banner-preview {
    --overlayOpacity: .62;
    --backdropBlur: 22px;
    --titleSize: 56px;
    --overviewSize: 17px;
    --posterScale: 1;
    --posterTranslateY: 0px;
    --badgeColor: #d4af37;
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 34px;
    overflow: hidden;
    background: linear-gradient(180deg, #0d1322, #060911);
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
    isolation: isolate;
}
.banner-preview.format-portrait { aspect-ratio: 4 / 5; }
.banner-preview.format-story { aspect-ratio: 9 / 16; }
.banner-preview.format-square { aspect-ratio: 1 / 1; }
.banner-preview.format-landscape { aspect-ratio: 16 / 9; max-width: 100%; }

.banner-backdrop, .banner-overlay, .banner-noise { position: absolute; inset: 0; }
.banner-backdrop { background-position: center; background-size: cover; filter: blur(var(--backdropBlur)); transform: scale(1.08); }
.banner-overlay {
    background:
        linear-gradient(180deg, rgba(4,7,13,.18) 0%, rgba(4,7,13,.68) 55%, rgba(4,7,13,.96) 100%),
        linear-gradient(90deg, rgba(4,7,13,.76) 0%, rgba(4,7,13,.2) 45%, rgba(4,7,13,.7) 100%);
    opacity: var(--overlayOpacity);
}
.banner-noise {
    background:
        radial-gradient(circle at top right, rgba(212,175,55,.12), transparent 24%),
        radial-gradient(circle at top left, rgba(63,131,248,.18), transparent 34%);
    mix-blend-mode: screen;
    opacity: .7;
}
.banner-grid {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(150px, 38%) 1fr;
    align-items: end;
    padding: clamp(18px, 3vw, 34px);
    gap: clamp(18px, 3vw, 28px);
}
.poster-area {
    align-self: stretch;
    display: flex;
    align-items: end;
    justify-content: center;
}
.poster-image {
    width: min(100%, 280px);
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,.45);
    transform: translateY(var(--posterTranslateY)) scale(var(--posterScale));
    transform-origin: center bottom;
    background: rgba(255,255,255,.08);
}
.content-area-banner { display: grid; align-content: end; gap: .85rem; }
.top-meta { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.badge-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: .55rem .95rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--badgeColor) 20%, rgba(255,255,255,.06));
    border: 1px solid color-mix(in srgb, var(--badgeColor) 70%, rgba(255,255,255,.15));
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .08em;
}
.meta-row {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    border-radius: 999px;
    padding: .45rem .8rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
}
.logo-holder img {
    max-height: 92px;
    max-width: min(86%, 330px);
    object-fit: contain;
    margin-bottom: .4rem;
}
.logo-holder h2 {
    font-size: var(--titleSize);
    line-height: .92;
    margin: 0;
    font-weight: 800;
    letter-spacing: -.04em;
}
.info-pills, .genres-row { display: flex; gap: .55rem; flex-wrap: wrap; }
.info-pill, .genre-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .7rem;
    border-radius: 999px;
    font-size: .82rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
}
.overview-text {
    margin: 0;
    font-size: var(--overviewSize);
    line-height: 1.55;
    color: rgba(255,255,255,.82);
    max-width: 48ch;
}
.cast-section { display: grid; gap: .7rem; }
.cast-title { color: rgba(255,255,255,.9); font-size: .95rem; font-weight: 700; }
.cast-row { display: flex; flex-wrap: wrap; gap: .65rem; }
.cast-card {
    width: min(112px, calc(25% - .55rem));
    min-width: 88px;
    display: grid;
    gap: .35rem;
}
.cast-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
}
.cast-card strong, .cast-card span { display: block; text-align: center; }
.cast-card strong { font-size: .73rem; line-height: 1.25; }
.cast-card span { color: var(--muted); font-size: .68rem; line-height: 1.2; }
.watermark, .tmdb-credit {
    position: absolute;
    z-index: 3;
    left: clamp(18px, 3vw, 34px);
    right: clamp(18px, 3vw, 34px);
    color: rgba(255,255,255,.55);
    font-size: .72rem;
}
.watermark { bottom: 16px; text-align: left; font-weight: 700; letter-spacing: .08em; }
.tmdb-credit { bottom: 16px; text-align: right; max-width: 52%; justify-self: end; }
.banner-preview.template-2 .banner-grid,
.banner-preview.template-6 .banner-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    align-content: end;
}
.banner-preview.template-2 .poster-area,
.banner-preview.template-6 .poster-area { align-self: auto; }
.banner-preview.template-2 .logo-holder img,
.banner-preview.template-6 .logo-holder img { margin-inline: auto; }
.banner-preview.template-2 .top-meta,
.banner-preview.template-6 .top-meta,
.banner-preview.template-2 .info-pills,
.banner-preview.template-2 .genres-row,
.banner-preview.template-6 .info-pills,
.banner-preview.template-6 .genres-row { justify-content: center; }
.banner-preview.template-2 .overview-text,
.banner-preview.template-6 .overview-text { margin-inline: auto; }
.banner-preview.template-3 .poster-area { justify-content: flex-start; }
.banner-preview.template-3 .poster-image { width: min(100%, 220px); }
.banner-preview.template-3 .banner-grid { align-items: center; }
.banner-preview.template-4 .banner-grid { grid-template-columns: minmax(120px, 28%) 1fr; }
.banner-preview.template-4 .cast-row { flex-wrap: nowrap; overflow: hidden; }
.banner-preview.template-5 .poster-area { display: none; }
.banner-preview.template-5 .banner-grid { grid-template-columns: 1fr; align-items: end; }
.banner-preview.template-5 .logo-holder img { max-height: 84px; }
.banner-preview.template-6 .poster-image { width: min(100%, 250px); }
.banner-preview.format-story .overview-text { max-width: 28ch; }
.banner-preview.format-story .cast-card { width: min(92px, calc(25% - .5rem)); }
.banner-preview.format-story .logo-holder h2 { font-size: calc(var(--titleSize) * 0.95); }
.banner-preview.format-landscape .banner-grid { grid-template-columns: minmax(120px, 28%) 1fr; align-items: end; }
.banner-preview.format-landscape .poster-image { width: min(100%, 180px); }
.banner-preview.format-landscape .logo-holder h2 { font-size: calc(var(--titleSize) * 0.72); }
.banner-preview.format-landscape .overview-text { font-size: calc(var(--overviewSize) * 0.9); max-width: 56ch; }
.banner-preview.format-landscape .cast-card { width: 86px; }
.banner-preview.format-square .poster-image { width: min(100%, 220px); }
.banner-preview.format-square .logo-holder h2 { font-size: calc(var(--titleSize) * 0.82); }

@media (max-width: 1199px) {
    .app-shell { padding: 16px; gap: 16px; }
    .sidebar { display: none; }
    .mobile-topbar { display: flex; }
    .sticky-builder { position: static; }
}
@media (max-width: 991px) {
    .feature-grid { grid-template-columns: 1fr; }
    .preview-shell { min-height: 0; }
}
@media (max-width: 767px) {
    .app-shell { padding: 12px; }
    .page-title { font-size: 1.8rem; }
    .panel-card, .stat-card { border-radius: 24px; }
    .banner-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        align-content: end;
        text-align: center;
    }
    .banner-grid .top-meta,
    .banner-grid .info-pills,
    .banner-grid .genres-row { justify-content: center; }
    .banner-grid .overview-text { margin-inline: auto; }
    .banner-grid .logo-holder img { margin-inline: auto; max-height: 72px; }
    .poster-image { width: min(64vw, 240px); }
    .cast-row { justify-content: center; }
    .cast-card { width: 86px; }
    .template-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search-result { grid-template-columns: 64px 1fr; }
    .search-result .btn { grid-column: 1 / -1; }
    .tmdb-credit, .watermark {
        position: static;
        margin-inline: auto;
        padding: 0 18px 12px;
        max-width: 100%;
        text-align: center;
    }
}
