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

:root {
    --bg: #0a0a0f;
    --bg-card: #14141f;
    --bg-card-hover: #1a1a2e;
    --bg-input: #1a1a2e;
    --border: #2a2a3e;
    --text: #e8e8f0;
    --text-muted: #8888aa;
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-glow: rgba(124, 58, 237, 0.3);
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --success: #10b981;
    --error: #ef4444;
    --gradient: linear-gradient(135deg, #7c3aed, #ec4899, #f59e0b);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --max-width: 1200px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border-radius: var(--radius-sm); font-weight: 600;
    font-size: 0.95rem; border: none; cursor: pointer; transition: all 0.2s;
    text-decoration: none; font-family: var(--font);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 0 20px var(--primary-glow); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-full { width: 100%; }
.btn-sso { background: var(--bg-card); border: 2px solid var(--border); color: var(--text); }
.btn-sso:hover { border-color: var(--primary); color: var(--primary); }
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0; color: var(--text-muted); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* === Navbar === */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 10, 15, 0.9); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); padding: 0.75rem 0;
}
.nav-container {
    max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}
.nav-logo {
    font-weight: 800; font-size: 1.2rem; color: var(--text);
    display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
}
.nav-logo:hover { color: var(--text); }
.logo-icon { font-size: 1.4rem; }
.nav-links {
    display: flex; gap: 0.25rem; flex: 1; justify-content: center;
}
.nav-links a {
    padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
    color: var(--text-muted); font-weight: 500; font-size: 0.9rem;
    transition: all 0.2s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg-card); }
.nav-pick {
    background: var(--primary) !important; color: #fff !important;
    border-radius: var(--radius-sm) !important;
}
.nav-pick:hover { background: var(--primary-hover) !important; }
.nav-right { display: flex; gap: 0.5rem; align-items: center; }
.nav-icon {
    font-size: 1.2rem; padding: 0.4rem; border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.nav-icon:hover { background: var(--bg-card); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* === Flash Messages === */
.flash-messages { padding: 0 1.5rem; max-width: var(--max-width); margin: 0.5rem auto; }
.flash {
    padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.flash-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--success); color: var(--success); }
.flash-error { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--error); color: var(--error); }

/* === Landing Page === */
.landing { padding: 0; max-width: none; }
.hero {
    min-height: 80vh; display: flex; align-items: center; justify-content: center;
    padding: 4rem 2rem; max-width: var(--max-width); margin: 0 auto;
    gap: 4rem; flex-wrap: wrap;
}
.hero-content { flex: 1; min-width: 320px; }
.hero-title { font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; }
.gradient-text {
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-subtitle { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 500px; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual { flex: 1; min-width: 300px; display: flex; justify-content: center; }
.hero-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 350px; }
.hero-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 2rem 1.5rem; text-align: center; transition: all 0.3s;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.hero-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.card-emoji { font-size: 2.5rem; }
.hero-card span { font-weight: 600; font-size: 0.9rem; }

.features { padding: 5rem 0; }
.features h2 { text-align: center; font-size: 2rem; margin-bottom: 3rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.feature-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 2rem; transition: all 0.3s;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

.cta-section {
    text-align: center; padding: 5rem 0;
    background: linear-gradient(180deg, transparent, rgba(124, 58, 237, 0.05));
}
.cta-section h2 { font-size: 2rem; margin-bottom: 0.75rem; }
.cta-section p { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.1rem; }

/* === Auth Pages === */
.auth-page { display: flex; justify-content: center; padding: 2rem 1rem; min-height: 80vh; }
.auth-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 2.5rem; width: 100%; max-width: 640px;
}
.auth-card-narrow { max-width: 420px; }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-switch { text-align: center; margin-top: 1.5rem; color: var(--text-muted); }

.form-section { margin-bottom: 1.5rem; }
.form-section h2 { font-size: 1.2rem; margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.section-hint { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.95rem; }
.form-group .optional { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; }
.form-group small { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 0.25rem; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%; padding: 0.75rem 1rem; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 1rem; font-family: var(--font);
    transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
.checkbox-card {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.8rem; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s; font-size: 0.9rem;
}
.checkbox-card:hover { border-color: var(--primary); }
.checkbox-card input:checked + .checkbox-label { color: var(--primary); }
.checkbox-card:has(input:checked) { border-color: var(--primary); background: rgba(124, 58, 237, 0.1); }

/* === Dashboard === */
.dashboard { padding: 2rem 0; }
.dash-header { margin-bottom: 2rem; }
.dash-header h1 { font-size: 2rem; }
.dash-header p { color: var(--text-muted); }

.dash-section { margin-bottom: 2.5rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.3rem; }
.section-link { color: var(--primary); font-size: 0.9rem; font-weight: 500; }

/* Mood Quick Select */
.mood-quick { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mood-chip {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 999px; font-size: 0.9rem; color: var(--text); transition: all 0.2s;
}
.mood-chip:hover { border-color: var(--primary); background: var(--bg-card-hover); color: var(--text); }
.mood-emoji { font-size: 1.1rem; }

/* Content Row (horizontal scroll) */
.content-row {
    display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.content-row::-webkit-scrollbar { height: 6px; }
.content-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Media Cards */
.media-card {
    min-width: 180px; max-width: 180px; flex-shrink: 0;
    cursor: pointer; transition: transform 0.2s;
}
.media-card:hover { transform: translateY(-4px); }
.media-poster {
    position: relative; width: 100%; aspect-ratio: 2/3;
    border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-card);
}
.media-poster img { width: 100%; height: 100%; object-fit: cover; }
.media-poster-empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; background: var(--bg-card);
}
.media-overlay {
    position: absolute; top: 0.5rem; right: 0.5rem;
}
.media-rating {
    background: rgba(0,0,0,0.7); padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm); font-size: 0.8rem; color: var(--accent);
}
.media-info { padding: 0.5rem 0; }
.media-title { font-size: 0.9rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.15rem; }
.media-year { font-size: 0.8rem; color: var(--text-muted); }

/* Content Grid */
.content-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}
.content-grid .media-card { min-width: unset; max-width: unset; }

/* Event Cards */
.event-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; transition: all 0.2s;
    min-width: 280px; flex-shrink: 0;
}
.event-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.event-image { position: relative; height: 150px; overflow: hidden; }
.event-image img { width: 100%; height: 100%; object-fit: cover; }
.event-badge {
    position: absolute; top: 0.5rem; left: 0.5rem;
    background: var(--primary); color: #fff; padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600;
}
.event-info { padding: 1rem; }
.event-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.event-details { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
.event-details span { font-size: 0.85rem; color: var(--text-muted); }
.events-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.events-grid .event-card { min-width: unset; }

/* Pick CTA */
.pick-cta { margin-top: 1rem; }
.pick-cta-inner {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--primary); border-radius: var(--radius);
    padding: 2rem; display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap;
}
.pick-cta-inner h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.pick-cta-inner p { color: var(--text-muted); }

/* === Mood Page === */
.mood-page { padding: 2rem 0; }
.mood-page h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.mood-page > p { color: var(--text-muted); margin-bottom: 2rem; }

.mood-presets {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem; margin-bottom: 2rem;
}
.mood-preset-btn {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.25rem; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer; color: var(--text);
    font-family: var(--font); font-size: 0.95rem; font-weight: 500;
    transition: all 0.2s;
}
.mood-preset-btn:hover { border-color: var(--primary); background: var(--bg-card-hover); }
.mood-emoji-lg { font-size: 1.5rem; }

.mood-form { margin-bottom: 2rem; }
.mood-input-group {
    display: flex; gap: 0.75rem;
}
.mood-input-group input {
    flex: 1; padding: 0.75rem 1rem; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 1rem; font-family: var(--font);
}
.mood-input-group input:focus { outline: none; border-color: var(--primary); }

.mood-results h2 { margin-bottom: 1.5rem; }
.rec-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.rec-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; position: relative;
    transition: all 0.2s;
}
.rec-card:hover { border-color: var(--primary); }
.rec-type-badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: var(--radius-sm);
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    background: rgba(124, 58, 237, 0.2); color: var(--primary); margin-bottom: 0.5rem;
}
.rec-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.rec-year { font-size: 0.85rem; color: var(--text-muted); }
.rec-reason { margin: 0.75rem 0; color: var(--text-muted); font-size: 0.9rem; }
.rec-mood-bar {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted);
}
.mood-bar {
    flex: 1; height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden;
}
.mood-bar-fill {
    height: 100%; background: var(--gradient); border-radius: 3px;
    transition: width 0.5s ease;
}

/* === Category Pages === */
.category-page { padding: 2rem 0; }
.category-page h1 { font-size: 2rem; margin-bottom: 1.5rem; }

.search-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-bar input {
    flex: 1; min-width: 200px; padding: 0.75rem 1rem; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 1rem; font-family: var(--font);
}
.search-bar input:focus { outline: none; border-color: var(--primary); }

.genre-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.genre-pill {
    padding: 0.4rem 1rem; border-radius: 999px; font-size: 0.85rem;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-muted); transition: all 0.2s;
}
.genre-pill:hover, .genre-pill.active {
    border-color: var(--primary); background: rgba(124, 58, 237, 0.15);
    color: var(--primary);
}

.empty-state { color: var(--text-muted); font-size: 0.9rem; }
.empty-state a { color: var(--primary); }
.empty-state-lg { text-align: center; padding: 4rem 2rem; }
.empty-state-lg p { color: var(--text-muted); margin-bottom: 0.5rem; }

/* === Pick For Me Chat === */
.pick-page { padding: 2rem 0; max-width: 720px; margin: 0 auto; }
.pick-header { margin-bottom: 1.5rem; }
.pick-header h1 { font-size: 2rem; }
.pick-header p { color: var(--text-muted); }

.chat-container {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.chat-messages {
    height: 400px; overflow-y: auto; padding: 1.5rem;
    display: flex; flex-direction: column; gap: 1rem;
}
.chat-message { display: flex; }
.chat-message.user { justify-content: flex-end; }
.chat-bubble {
    max-width: 80%; padding: 0.75rem 1rem; border-radius: var(--radius);
    font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap;
}
.chat-message.assistant .chat-bubble {
    background: var(--bg-input); color: var(--text);
}
.chat-message.user .chat-bubble {
    background: var(--primary); color: #fff;
}
.chat-message.typing .chat-bubble { opacity: 0.6; }
.chat-input {
    display: flex; gap: 0.5rem; padding: 1rem; border-top: 1px solid var(--border);
}
.chat-input input {
    flex: 1; padding: 0.75rem 1rem; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 0.95rem; font-family: var(--font);
}
.chat-input input:focus { outline: none; border-color: var(--primary); }

/* === Calendar === */
.calendar-page { padding: 2rem 0; }
.calendar-page h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.calendar-page > p { color: var(--text-muted); margin-bottom: 2rem; }

.calendar-list { display: flex; flex-direction: column; gap: 1rem; }
.calendar-item {
    display: flex; gap: 1rem; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem; transition: border-color 0.2s;
}
.calendar-item:hover { border-color: var(--primary); }
.calendar-thumb {
    width: 80px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0;
}
.calendar-info h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.calendar-date {
    display: inline-block; background: rgba(124, 58, 237, 0.15); color: var(--primary);
    padding: 0.15rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.8rem;
    font-weight: 600; margin-bottom: 0.35rem;
}
.calendar-info p { font-size: 0.85rem; color: var(--text-muted); }

/* === Coming Soon === */
.coming-soon {
    text-align: center; padding: 5rem 2rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.coming-soon-icon { font-size: 4rem; margin-bottom: 1rem; }
.coming-soon h2 { margin-bottom: 0.75rem; }
.coming-soon p { color: var(--text-muted); max-width: 500px; margin: 0 auto 1.5rem; }

/* === Footer === */
.footer {
    border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 3rem;
    text-align: center;
}
.footer p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.footer-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--primary); }

/* === Responsive === */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero { padding: 2rem 1.5rem; gap: 2rem; }
    .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg); border-bottom: 1px solid var(--border);
        flex-direction: column; padding: 1rem;
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
    .media-card { min-width: 140px; max-width: 140px; }
    .mood-input-group { flex-direction: column; }
    .pick-cta-inner { flex-direction: column; text-align: center; }
    .feature-grid { grid-template-columns: 1fr; }
}
