:root {
    /* Light Mode (Default) - "District" / "BookMyShow" Aesthetic */
    --bg-page: #F3F4F6;
    --bg-card: #FFFFFF;
    --bg-header: rgba(255, 255, 255, 0.95);
    --bg-overlay: rgba(255, 255, 255, 0.95);

    /* Typography */
    --text-main: #111827; /* Rich Black */
    --text-muted: #4B5563;
    --text-light: #6B7280;
    --text-accent: #7b2cff; /* Purple for key highlights */

    /* UI Elements */
    --border-color: #E5E7EB;
    --input-bg: #FFFFFF;
    --input-border: #D1D5DB;
    --hover-bg: #F9FAFB;

    /* Brand Gradients */
    --primary-gradient: linear-gradient(135deg, #7b2cff 0%, #00f5d4 100%);
    --btn-text: #FFFFFF; /* Text on gradient buttons */

    /* Status Colors */
    --status-success-bg: #D1FAE5;
    --status-success-text: #065F46;
    --status-weekend-bg: #7b2cff;
    --status-weekend-text: #ffffff;

    /* Shadows - Soft & Premium */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.12);

    /* Background Utilities */
    --bg-body-image: none;
    --bg-body-overlay: none;
    --bg-body-noise: none;
}

[data-theme="dark"] {
    /* Dark Mode - Deep Space Aesthetic */
    --bg-page: #0a0a0a;

    /* Complex Dark Backgrounds */
    --bg-body-image: radial-gradient(circle at 0% 0%, #120022 0, #05040a 45%, #020308 100%);
    --bg-body-overlay: radial-gradient(circle at 10% 20%, rgba(123, 44, 255, 0.25), transparent 55%),
                       radial-gradient(circle at 85% 70%, rgba(0, 245, 212, 0.25), transparent 55%);
    --bg-body-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cdefs%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='noStitch'/%3E%3C/filter%3E%3C/defs%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");

    --bg-card: rgba(26, 26, 26, 0.85);
    --bg-header: rgba(10, 10, 10, 0.95);
    --bg-overlay: rgba(8, 8, 16, 0.95);

    /* Typography */
    --text-main: #FFFFFF;
    --text-muted: #9CA3AF;
    --text-light: #6B7280;
    --text-accent: #00f5d4; /* Teal pop in dark mode */

    /* UI Elements */
    --border-color: rgba(255, 255, 255, 0.12);
    --input-bg: rgba(12, 12, 22, 0.8);
    --input-border: rgba(255, 255, 255, 0.18);
    --hover-bg: rgba(255, 255, 255, 0.05);

    /* Status Colors */
    --status-success-bg: rgba(16, 185, 129, 0.2);
    --status-success-text: #34D399;

    /* Shadows */
    --shadow-card: 0 14px 40px rgba(0, 0, 0, 0.7);
    --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.9);
}

/* Global Reset & Base */
* { box-sizing: border-box; }
body {
    background: var(--bg-page);
    color: var(--text-main);
    font-family: 'Space Grotesk', sans-serif;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
}

/* Dark Mode Background Layers */
[data-theme="dark"] body {
    background: var(--bg-body-image);
    background-attachment: fixed;
}
[data-theme="dark"] body::before {
    content: ""; position: fixed; inset: 0;
    background: var(--bg-body-overlay); mix-blend-mode: screen; z-index: -2; pointer-events: none;
}
[data-theme="dark"] body::after {
    content: ""; position: fixed; inset: 0;
    background: var(--bg-body-noise); z-index: -1; pointer-events: none;
}

/* Typography & Icons */
h1, h2, h3, h4, h5, h6 { font-family: 'Chillax', sans-serif; color: var(--text-main); }
a { text-decoration: none; color: inherit; }
i, svg { color: var(--text-main); transition: color 0.3s ease; }

/* Utilities */
.text-accent { color: var(--text-accent) !important; }
.text-muted { color: var(--text-muted) !important; }

/* -------------------
   COMPONENT: Header
------------------- */
.app-header {
    padding: 20px 30px;
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.logo { font-family: 'Chillax', sans-serif; font-weight: 600; font-size: 1.5rem; letter-spacing: -1px; color: var(--text-main); }
.logo span { color: var(--text-accent); }

/* Theme Toggle Button */
#themeToggle {
    background: transparent; border: 1px solid var(--border-color);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-main);
}
#themeToggle:hover { background: var(--hover-bg); }

/* -------------------
   COMPONENT: Filter Bar
------------------- */
.filter-bar {
    padding: 20px 30px;
    display: flex; gap: 15px; overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    padding: 10px 20px;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: 0.3s;
    white-space: nowrap;
    box-shadow: var(--shadow-card);
}
.filter-chip:hover { background: var(--hover-bg); transform: translateY(-2px); }
.filter-chip.active {
    background: var(--text-accent);
    color: #000; /* Contrast text for accent color */
    border-color: var(--text-accent);
}
[data-theme="dark"] .filter-chip.active { color: #000; }
[data-theme="light"] .filter-chip.active { color: #fff; }


/* -------------------
   COMPONENT: Hero Carousel (Trending)
------------------- */
.hero-section {
    padding: 20px 30px;
    margin-bottom: 20px;
}
.section-heading {
    font-size: 1.5rem; font-weight: 700; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.hero-carousel {
    display: flex; gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    scrollbar-width: none;
}
.hero-carousel::-webkit-scrollbar { display: none; }

.hero-card {
    flex: 0 0 85%; /* Mobile: Show partial next card */
    max-width: 600px;
    height: 300px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.3s ease;
}
@media(min-width: 768px) {
    .hero-card { flex: 0 0 45%; height: 350px; }
}
.hero-card:hover { transform: scale(1.02); }

.hero-bg {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.hero-card:hover .hero-bg { transform: scale(1.1); }

.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent 60%);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 25px;
}
.hero-badge {
    position: absolute; top: 20px; left: 20px;
    background: rgba(255,255,255,0.2); backdrop-filter: blur(8px);
    padding: 6px 12px; border-radius: 20px;
    color: #fff; font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.3);
}
.hero-title { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 8px; }
.hero-meta { color: rgba(255,255,255,0.8); font-size: 0.95rem; display: flex; gap: 15px; }


/* -------------------
   COMPONENT: Bento Grid
------------------- */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 30px 60px 30px;
}

.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-card);
    height: 100%; /* Uniform height */
}
.event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-image-wrapper {
    height: 180px; width: 100%; position: relative; overflow: hidden;
}
.card-image {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.event-card:hover .card-image { transform: scale(1.05); }

.date-badge {
    position: absolute; top: 15px; left: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 5px 12px; border-radius: 8px;
    font-weight: 700; font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex; flex-direction: column;
}

.card-title {
    font-size: 1.2rem; font-weight: 700;
    margin-bottom: 8px; line-height: 1.3;
    color: var(--text-main);
}
.card-venue {
    font-size: 0.9rem; color: var(--text-muted);
    margin-bottom: 15px; display: flex; align-items: center; gap: 6px;
}
.card-venue i { color: var(--text-light); }

.card-footer {
    margin-top: auto;
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.price-display {
    display: flex; flex-direction: column;
}
.price-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.price-value { font-size: 1.1rem; font-weight: 800; color: var(--text-main); }
.price-value.free { color: var(--status-success-text); }

.btn-arrow {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--hover-bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-main);
    transition: 0.3s;
}
.btn-arrow:hover {
    background: var(--text-main);
    color: var(--bg-page);
}
