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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --border: #2a2a3a;
    --border-glow: rgba(139, 92, 246, 0.3);

    --text-primary: #f0f0f5;
    --text-secondary: #9898b0;
    --text-muted: #5a5a72;

    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-pink: #ec4899;
    --accent-orange: #f97316;

    --positive: #10b981;
    --negative: #f43f5e;
    --neutral: #9898b0;

    --gradient-hero: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 50%, #10b981 100%);
    --gradient-card: linear-gradient(145deg, rgba(139, 92, 246, 0.08), rgba(6, 182, 212, 0.04));

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;

    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.5);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== AMBIENT BACKGROUND ===== */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-purple);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-cyan);
    top: 60%;
    right: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent-emerald);
    bottom: -100px;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-30px) translateX(20px); }
    50% { transform: translateY(20px) translateX(-30px); }
    75% { transform: translateY(-20px) translateX(-15px); }
}

/* ===== HERO ===== */
.hero {
    position: relative;
    z-index: 1;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 60px;
    text-align: center;
}

.hero-content {
    max-width: 900px;
    animation: fadeInUp 1s ease-out;
}

.badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-purple);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

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

.hero-stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== NAV BAR ===== */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border);
    padding: 0 8px;
}

.nav-inner {
    display: flex;
    gap: 4px;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 0;
}

.nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-link {
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.nav-link.active {
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.15);
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.6s ease-out;
}

.section:last-child {
    border-bottom: none;
}

.section-header {
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== MARKET GRID ===== */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.market-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
    overflow: hidden;
}

.market-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-hero);
    opacity: 0;
    transition: var(--transition);
}

.market-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.market-card:hover::before {
    opacity: 1;
}

.market-card-flag {
    font-size: 2rem;
    margin-bottom: 8px;
}

.market-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.market-card-revenue {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 8px;
}

.market-card-change {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.market-card-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.market-card-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--gradient-hero);
    border-radius: 100px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.positive { color: var(--positive); }
.negative { color: var(--negative); }
.neutral { color: var(--neutral); }

/* ===== CHARTS ===== */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}

.chart-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.chart-card.full-width {
    margin-bottom: 40px;
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* ===== TABLES ===== */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 40px;
    overflow: hidden;
}

.table-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.table-wrapper {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    background: rgba(139, 92, 246, 0.08);
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
    font-family: 'JetBrains Mono', 'Inter', monospace;
    font-size: 0.85rem;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.row-negative {
    background: rgba(244, 63, 94, 0.03);
}

.trend-up, .trend-down, .trend-flat {
    font-size: 1.2rem;
}

/* ===== VENUE CARDS (SINGAPORE COMPARISON) ===== */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.comparison-grid.single {
    grid-template-columns: 1fr;
    max-width: 700px;
}

.venue-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.venue-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.venue-positive {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.06), var(--bg-card));
}

.venue-negative {
    border-color: rgba(244, 63, 94, 0.2);
    background: linear-gradient(145deg, rgba(244, 63, 94, 0.04), var(--bg-card));
}

.venue-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-emerald);
    margin-bottom: 16px;
}

.venue-badge.negative-badge {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--accent-orange);
}

.venue-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.venue-operator {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.venue-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

.metric-change {
    font-size: 0.82rem;
    font-weight: 700;
}

.venue-note {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ===== THEME CARDS ===== */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.theme-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}

.theme-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.theme-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.theme-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.theme-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== INSIGHT CARDS ===== */
.insight-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}

.insight-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.insight-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-card li {
    position: relative;
    padding-left: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.insight-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
    font-weight: 700;
}

.insight-card li strong {
    color: var(--text-primary);
}

.warning-card {
    border-color: rgba(244, 63, 94, 0.25);
    background: linear-gradient(145deg, rgba(244, 63, 94, 0.05), rgba(22, 22, 31, 0.8));
}

.warning-card li::before {
    color: var(--accent-rose);
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer-disclaimer {
    font-size: 0.75rem !important;
    line-height: 1.6;
}

.footer-date {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    opacity: 0.5;
}

/* ===== SCROLL ANIMATIONS ===== */
.market-card,
.chart-card,
.table-card,
.venue-card,
.theme-card,
.insight-card {
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.5s ease-out forwards;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animations for market cards */
.market-card:nth-child(1) { animation-delay: 0.05s; }
.market-card:nth-child(2) { animation-delay: 0.1s; }
.market-card:nth-child(3) { animation-delay: 0.15s; }
.market-card:nth-child(4) { animation-delay: 0.2s; }
.market-card:nth-child(5) { animation-delay: 0.25s; }
.market-card:nth-child(6) { animation-delay: 0.3s; }
.market-card:nth-child(7) { animation-delay: 0.35s; }

.theme-card:nth-child(1) { animation-delay: 0.1s; }
.theme-card:nth-child(2) { animation-delay: 0.15s; }
.theme-card:nth-child(3) { animation-delay: 0.2s; }
.theme-card:nth-child(4) { animation-delay: 0.25s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 60px 16px 40px;
        min-height: auto;
    }

    .hero h1 {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .hero-stats {
        gap: 20px;
    }

    .hero-stat-value {
        font-size: 1.5rem;
    }

    .dashboard {
        padding: 0 16px 60px;
    }

    .section {
        padding: 40px 0;
    }

    .market-grid {
        grid-template-columns: 1fr 1fr;
    }

    .venue-metrics {
        grid-template-columns: 1fr;
    }

    .nav-link {
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    table {
        font-size: 0.8rem;
    }

    thead th, tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .market-grid {
        grid-template-columns: 1fr;
    }

    .themes-grid {
        grid-template-columns: 1fr;
    }
}
