/* Airbnb Insights SaaS - Modern Design System */

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

/* ============================================
   Design Tokens
   ============================================ */
:root {
    /* Primary palette - rich teal */
    --primary-50: #F0FDFA;
    --primary-100: #CCFBF1;
    --primary-200: #99F6E4;
    --primary-300: #5EEAD4;
    --primary-400: #2DD4BF;
    --primary-500: #14B8A6;
    --primary-600: #0D9488;
    --primary-700: #0F766E;
    --primary-800: #115E59;
    --primary-900: #134E4A;

    /* Shorthand aliases */
    --primary: #0D9488;
    --primary-dark: #0F766E;
    --primary-light: #5EEAD4;
    --primary-hover: #0F766E;

    /* Accent - warm amber */
    --accent: #F59E0B;
    --accent-dark: #D97706;
    --accent-light: #FDE68A;

    /* Neutrals - carefully tuned grays */
    --gray-25: #FCFCFD;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --gray-950: #030712;

    /* Semantic surface colors */
    --bg: var(--gray-50);
    --surface: #FFFFFF;
    --surface-hover: var(--gray-25);
    --surface-secondary: var(--gray-100);
    --border: var(--gray-200);
    --border-light: var(--gray-100);
    --text: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-500);
    --text-light: var(--gray-400);

    /* Semantic status colors */
    --success-50: #ECFDF5;
    --success-100: #D1FAE5;
    --success-500: #10B981;
    --success-600: #059669;
    --success-700: #047857;

    --warning-50: #FFFBEB;
    --warning-100: #FEF3C7;
    --warning-500: #F59E0B;
    --warning-700: #B45309;

    --error-50: #FEF2F2;
    --error-100: #FEE2E2;
    --error-500: #EF4444;
    --error-700: #B91C1C;

    --info-50: #EFF6FF;
    --info-100: #DBEAFE;
    --info-500: #3B82F6;
    --info-700: #1D4ED8;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Shadows - layered for depth */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.15);
    --shadow-ring: 0 0 0 3px rgba(13, 148, 136, 0.15);
    --shadow-ring-error: 0 0 0 3px rgba(239, 68, 68, 0.15);

    /* Border radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Transition */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms var(--ease);
    --transition: 200ms var(--ease);
    --transition-slow: 300ms var(--ease);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    letter-spacing: -0.025em;
}

h1 { font-size: 1.875rem; font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; font-weight: 600; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 640px) {
    .container { padding: 0 2rem; }
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar-brand {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.025em;
}

.navbar-brand::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-300));
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.navbar-menu {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.navbar-link {
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.navbar-link:hover {
    color: var(--text) !important;
    background: var(--gray-100);
}

.navbar-link.active,
.navbar-link[style*="color: var(--primary)"] {
    color: var(--primary) !important;
    background: var(--primary-50);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ============================================
   Auth Pages (Login / Register)
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(13, 148, 136, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
        var(--gray-50);
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-light);
}

@media (min-width: 640px) {
    .auth-card { padding: 3rem; }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-300));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.375rem;
    letter-spacing: -0.035em;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--surface);
    transition: all var(--transition-fast);
    line-height: 1.5;
}

.form-input:hover {
    border-color: var(--gray-400);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-ring);
}

.form-input::placeholder {
    color: var(--text-light);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--text);
    border-color: var(--gray-400);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
    color: white;
}

.btn-full { width: 100%; }

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    line-height: 1.5;
    flex-wrap: wrap;
}

.alert-success {
    background: var(--success-50);
    color: var(--success-700);
    border: 1px solid var(--success-100);
}

.alert-error {
    background: var(--error-50);
    color: var(--error-700);
    border: 1px solid var(--error-100);
}

.alert-warning {
    background: var(--warning-50);
    color: var(--warning-700);
    border: 1px solid var(--warning-100);
}

.alert-info {
    background: var(--info-50);
    color: var(--info-700);
    border: 1px solid var(--info-100);
}

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard {
    padding: 2rem 0 3rem;
}

.dashboard-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-title h1 {
    font-size: 1.5rem;
    margin: 0;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--gray-300);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    font-family: var(--font-sans);
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.stat-change {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.375rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive { color: var(--success-600); }
.stat-change.negative { color: var(--error-500); }

/* ============================================
   Data Tables
   ============================================ */
.data-table-wrapper {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.data-table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.data-table-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1.5rem;
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-25);
}

/* ============================================
   Upload Zone
   ============================================ */
.upload-zone {
    background: var(--surface);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 1.5rem;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-50);
    border-style: solid;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.upload-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-free {
    background: var(--gray-100);
    color: var(--text-muted);
}

.badge-pro {
    background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
    color: var(--primary-700);
}

.badge-enterprise {
    background: linear-gradient(135deg, var(--warning-100), var(--warning-50));
    color: var(--warning-700);
}

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success-500); }
.text-error { color: var(--error-500); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }

    .auth-card {
        padding: 1.75rem;
        border-radius: var(--radius-xl);
    }

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

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-menu {
        gap: 0.125rem;
    }

    .navbar-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }

    .navbar-user {
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }

    .data-table {
        font-size: 0.8125rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem 1rem;
    }
}

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

    .data-table-wrapper {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}

/* ============================================
   Reports
   ============================================ */
.report-section {
    margin-bottom: 2.5rem;
}

.report-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    letter-spacing: -0.02em;
}

.report-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.375rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.375rem;
    vertical-align: middle;
}

.report-badge-warning {
    background: var(--warning-100);
    color: var(--warning-700);
}

.report-badge-error {
    background: var(--error-100);
    color: var(--error-700);
}

/* Chart layout */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
}

.chart-card-wide {
    margin-bottom: 1rem;
}

.chart-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.chart-wrap {
    position: relative;
    height: 260px;
}

.chart-wrap-wide {
    height: 320px;
}

/* Trend badges */
.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.trend-badge-up {
    background: var(--error-50);
    color: var(--error-700);
}

.trend-badge-down {
    background: var(--error-50);
    color: var(--error-700);
}

/* Report link card */
.report-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition-fast);
}

.report-link-card:hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.report-link-icon {
    font-size: 1.5rem;
}

.report-link-desc {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 400;
}

.report-link-arrow {
    margin-left: auto;
    color: var(--primary);
    font-weight: 600;
}

/* Coverage matrix */
.coverage-table {
    font-size: 0.8125rem;
}

.coverage-th {
    text-align: center !important;
    min-width: 5rem;
}

.coverage-cell {
    text-align: center;
    font-size: 0.875rem;
}

.coverage-ok {
    color: var(--success-600);
    background: var(--success-50);
}

.coverage-miss {
    color: var(--error-500);
    background: var(--error-50);
}

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

    .chart-wrap {
        height: 220px;
    }

    .chart-wrap-wide {
        height: 260px;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    width: 1.5rem;
    height: 1.5rem;
    animation: spin 0.6s linear infinite;
}

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

.dashboard,
.auth-card {
    animation: fadeIn 0.3s var(--ease) forwards;
}

/* ============================================
   Scrollbar (Webkit)
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: var(--primary-200);
    color: var(--primary-900);
}
