/* =====================================================
   WHAT SHOULD I WATCH — PREMIUM DARK THEME
   ===================================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a26;
    --bg-chip: rgba(255, 255, 255, 0.06);
    --bg-chip-active: rgba(139, 92, 246, 0.2);
    
    --text-primary: #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --accent-secondary: #c084fc;
    --accent-warm: #f472b6;
    --accent-teal: #2dd4bf;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.04);
    --shadow-glow: 0 0 60px rgba(139, 92, 246, 0.15);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── Grain Overlay ──────────────────────────────────── */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Ambient Background ─────────────────────────────── */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    top: -15%;
    right: -10%;
    animation: float-1 18s ease-in-out infinite;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-warm) 0%, transparent 70%);
    bottom: -10%;
    left: -8%;
    animation: float-2 22s ease-in-out infinite;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-teal) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float-3 15s ease-in-out infinite;
}

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 30px) scale(1.1); }
    66% { transform: translate(30px, -20px) scale(0.9); }
}

@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -40px) scale(1.15); }
}

@keyframes float-3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.15; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.25; }
}

/* ── Main App ───────────────────────────────────────── */
#app {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* ── Hero Header ────────────────────────────────────── */
.hero-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    border-radius: var(--radius-md);
    color: white;
    margin-bottom: 8px;
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.3);
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 4px 40px rgba(139, 92, 246, 0.5); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title .accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 400px;
}

.hero-subtitle span {
    font-weight: 600;
    color: var(--accent-secondary);
}

/* ── Filter Bar ─────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-chip);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    user-select: none;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-chip.active {
    background: var(--bg-chip-active);
    color: var(--accent-secondary);
    border-color: var(--border-accent);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

.filter-chip svg {
    flex-shrink: 0;
}

/* ── Category Bar ───────────────────────────────────── */
.category-bar {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.category-chip {
    padding: 6px 14px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    white-space: nowrap;
    user-select: none;
}

.category-chip:hover {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.category-chip.active {
    color: var(--accent-teal);
    border-color: rgba(45, 212, 191, 0.3);
    background: rgba(45, 212, 191, 0.1);
}

/* ── Card Container ─────────────────────────────────── */
.card-container {
    width: 100%;
    perspective: 1200px;
}

.pick-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.5s var(--ease-out-expo);
    transform-style: preserve-3d;
}

.pick-card:hover {
    box-shadow: var(--shadow-card), var(--shadow-glow);
    border-color: rgba(139, 92, 246, 0.15);
}

.pick-card.animate-in {
    animation: card-reveal 0.6s var(--ease-spring) forwards;
}

@keyframes card-reveal {
    0% {
        opacity: 0;
        transform: translateY(20px) rotateX(8deg) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

.card-inner {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 12px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    color: white;
}

.card-badge.series-badge {
    background: linear-gradient(135deg, var(--accent-teal), #34d399);
}

.card-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-primary);
}

.card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.meta-value {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}

.card-reason {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-style: italic;
}

.card-actors {
    display: block;
    min-height: 0;
}

.actors-tag {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--accent-teal);
    line-height: 1.5;
    opacity: 0.85;
}

.card-source {
    display: inline-flex;
    align-self: flex-start;
}

.card-source .source-tag {
    padding: 3px 10px;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 100px;
    letter-spacing: 0.04em;
}

.source-tag.recommended {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-secondary);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.source-tag.user_seed {
    background: rgba(244, 114, 182, 0.12);
    color: var(--accent-warm);
    border: 1px solid rgba(244, 114, 182, 0.2);
}

/* ── Action Row ─────────────────────────────────────── */
.action-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.35);
    position: relative;
    overflow: hidden;
}

.pick-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s var(--ease-out-expo);
}

.pick-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.5);
}

.pick-btn:hover::before {
    transform: translateX(100%);
}

.pick-btn:active {
    transform: translateY(0) scale(0.98);
}

.pick-btn .btn-icon {
    display: flex;
    transition: transform 0.4s var(--ease-spring);
}

.pick-btn:hover .btn-icon {
    transform: rotate(180deg);
}

.pick-btn.spinning .btn-icon {
    animation: spin 0.5s linear infinite;
}

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

.search-btn {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-chip);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.search-btn.active {
    background: var(--bg-chip-active);
    color: var(--accent-secondary);
    border-color: var(--border-accent);
}

/* ── Search Panel ───────────────────────────────────── */
.search-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slide-down 0.4s var(--ease-out-expo);
}

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

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.3s var(--ease-out-expo);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 2px;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
}

.search-result-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.search-result-item .result-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-item .result-type {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 100px;
}

.result-type.movie-type {
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.12);
}

.result-type.series-type {
    color: var(--accent-teal);
    background: rgba(45, 212, 191, 0.12);
}

/* ── History ─────────────────────────────────────────── */
.history-section {
    width: 100%;
    display: none;
}

.history-section.visible {
    display: block;
    animation: slide-down 0.4s var(--ease-out-expo);
}

.history-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.history-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.history-list::-webkit-scrollbar {
    display: none;
}

.history-item {
    flex-shrink: 0;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    max-width: 200px;
}

.history-item:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.history-item .history-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item .history-item-type {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

/* ── Stats Footer ───────────────────────────────────── */
.stats-footer {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    justify-content: center;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 520px) {
    #app {
        padding: 32px 16px 64px;
        gap: 24px;
    }

    .card-inner {
        padding: 24px;
    }

    .card-meta {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pick-btn {
        padding: 14px 32px;
        font-size: 0.9rem;
    }

    .stats-footer {
        padding: 20px 24px;
        gap: 16px;
    }

    .stat-num {
        font-size: 1.2rem;
    }

    .category-bar {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .category-bar::-webkit-scrollbar {
        display: none;
    }
}

/* ── Counter Animation ──────────────────────────────── */
.count-up {
    animation: count-pop 0.3s var(--ease-spring);
}

@keyframes count-pop {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}
