/*
 * AluScout Theme System - UI Overhaul
 * Light/Dark mode with CSS custom properties
 * Includes hero section, gradient accents, modern typography
 */

/* ===========================
   LIGHT THEME (DEFAULT)
   =========================== */
:root {
    /* Background colors */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;

    /* Background texture & gradient for visual depth */
    --bg-gradient: linear-gradient(180deg, #F8FAFC 0%, #EFF6FF 50%, #F8FAFC 100%);
    --bg-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");

    /* Maritime wave patterns - subtle nautical accents */
    --wave-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,120 L0,120 Z' fill='%230369A1' opacity='0.04'/%3E%3Cpath d='M0,80 C200,120 400,40 600,80 C800,120 1000,40 1200,80 L1200,120 L0,120 Z' fill='%230891B2' opacity='0.03'/%3E%3C/svg%3E");
    --wave-pattern-subtle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C200,50 400,10 600,30 C800,50 1000,10 1200,30 L1200,60 L0,60 Z' fill='%230369A1' opacity='0.025'/%3E%3C/svg%3E");
    --ripple-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%230369A1' stroke-width='0.5' opacity='0.03'/%3E%3Ccircle cx='50' cy='50' r='30' fill='none' stroke='%230369A1' stroke-width='0.3' opacity='0.02'/%3E%3Ccircle cx='50' cy='50' r='20' fill='none' stroke='%230369A1' stroke-width='0.2' opacity='0.015'/%3E%3C/svg%3E");

    /* Text colors - WCAG AA Compliant */
    --text-primary: #0F172A;        /* 14.47:1 on white */
    --text-secondary: #475569;      /* 8.59:1 on white */
    --text-muted: #64748B;          /* 4.95:1 on white */

    /* Card styling */
    --card-bg: #FFFFFF;
    --card-border: rgba(0, 0, 0, 0.10);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);

    /* Interactive Elements (Ocean Blue) - for links, clickable cards */
    --interactive: #0369A1;
    --interactive-hover: #0284C7;
    --interactive-light: rgba(3, 105, 161, 0.10);

    /* Active State (Deep Teal) - for selected tabs, active navigation */
    --active: #0F766E;
    --active-hover: #115E59;
    --active-light: rgba(15, 118, 110, 0.10);

    /* ===========================
       COLOR USAGE GUIDELINES
       =========================== */
    /*
     * Interactive Elements (Ocean Blue):
     *   - Links, buttons, clickable cards: var(--interactive)
     *   - Hover states: var(--interactive-hover)
     *   - Light backgrounds: var(--interactive-light)
     *
     * Active/Selected States (Deep Teal):
     *   - Selected tabs, active navigation: var(--active)
     *   - Hover on active elements: var(--active-hover)
     *   - Light backgrounds: var(--active-light)
     *
     * Data Visualization (Separate Palette):
     *   - Chart primary: var(--chart-primary) - Purple (#8B5CF6)
     *   - Chart secondary: var(--chart-secondary) - Pink (#EC4899)
     *   - Chart tertiary: var(--chart-tertiary) - Green (#10B981)
     *   - Chart quaternary: var(--chart-quaternary) - Amber (#F59E0B)
     *   - Keep charts visually distinct from UI interactive colors
     *
     * Status Colors:
     *   - Success/positive: var(--positive) - Green
     *   - Warning/caution: var(--warning) - Amber
     *   - Error/negative: var(--negative) - Red
     *
     * DEPRECATED (DO NOT USE):
     *   - var(--accent) - Use var(--interactive) instead
     *   - var(--primary) - Removed, use var(--interactive)
     *   - var(--primary-dark) - Removed, use var(--interactive-hover)
     */

    /* Legacy accent (deprecated - use interactive/active instead) */
    --accent: #0369A1;  /* DEPRECATED: Use --interactive */
    --accent-light: rgba(3, 105, 161, 0.10);  /* DEPRECATED: Use --interactive-light */
    --accent-dark: #0284C7;  /* DEPRECATED: Use --interactive-hover */

    /* Gradient accents for stat cards */
    --gradient-blue: linear-gradient(135deg, #0369A1, #0891B2);
    --gradient-green: linear-gradient(135deg, #059669, #34D399);
    --gradient-red: linear-gradient(135deg, #DC2626, #EF4444);
    --gradient-purple: linear-gradient(135deg, #7C3AED, #A78BFA);
    --gradient-amber: linear-gradient(135deg, #D97706, #F59E0B);

    /* Chart & Data Visualization (distinct from interactive colors) */
    --chart-primary: #8B5CF6;        /* Purple */
    --chart-secondary: #EC4899;      /* Pink */
    --chart-tertiary: #10B981;       /* Green */
    --chart-quaternary: #F59E0B;     /* Amber */

    /* Hero section */
    --hero-overlay: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 58, 95, 0.7) 100%);
    --hero-text: #FFFFFF;
    --hero-text-muted: rgba(255, 255, 255, 0.8);
    --nav-overlay-bg: rgba(0, 0, 0, 0.2);

    /* Chart elements */
    --grid: rgba(0, 0, 0, 0.05);

    /* Status colors - WCAG AA Compliant */
    --positive: #059669;
    --positive-light: rgba(5, 150, 105, 0.10);
    --negative: #DC2626;
    --negative-light: rgba(220, 38, 38, 0.10);
    --warning: #D97706;
    --warning-light: rgba(217, 119, 6, 0.10);

    /* Borders & Interactive Borders */
    --border: rgba(0, 0, 0, 0.10);
    --border-interactive: rgba(3, 105, 161, 0.20);

    /* Transition duration for theme switching */
    --transition-speed: 0.25s;

    /* Typography - now defined in design-system.css */

    /* Shadows */
    --modal-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    --overlay-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ===========================
   TEXT UTILITIES
   =========================== */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }

/* ===========================
   DARK THEME
   =========================== */
[data-theme="dark"] {
    /* Background colors */
    --bg-primary: #0B1120;
    --bg-secondary: #111827;
    --bg-tertiary: #1F2937;

    /* Background texture & gradient for visual depth */
    --bg-gradient: linear-gradient(180deg, #0B1120 0%, #0F172A 50%, #0B1120 100%);
    --bg-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");

    /* Maritime wave patterns - dark theme (lighter blue, slightly higher opacity) */
    --wave-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,120 L0,120 Z' fill='%230EA5E9' opacity='0.06'/%3E%3Cpath d='M0,80 C200,120 400,40 600,80 C800,120 1000,40 1200,80 L1200,120 L0,120 Z' fill='%2338BDF8' opacity='0.04'/%3E%3C/svg%3E");
    --wave-pattern-subtle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C200,50 400,10 600,30 C800,50 1000,10 1200,30 L1200,60 L0,60 Z' fill='%230EA5E9' opacity='0.035'/%3E%3C/svg%3E");
    --ripple-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%230EA5E9' stroke-width='0.5' opacity='0.05'/%3E%3Ccircle cx='50' cy='50' r='30' fill='none' stroke='%230EA5E9' stroke-width='0.3' opacity='0.03'/%3E%3Ccircle cx='50' cy='50' r='20' fill='none' stroke='%230EA5E9' stroke-width='0.2' opacity='0.02'/%3E%3C/svg%3E");

    /* Text colors - WCAG AA Compliant */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Card styling */
    --card-bg: #1F2937;
    --card-border: rgba(255, 255, 255, 0.10);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);

    /* Interactive Elements (Lighter Ocean Blue) */
    --interactive: #0EA5E9;
    --interactive-hover: #38BDF8;
    --interactive-light: rgba(14, 165, 233, 0.15);

    /* Active State (Lighter Teal) */
    --active: #14B8A6;
    --active-hover: #2DD4BF;
    --active-light: rgba(20, 184, 166, 0.15);

    /* Legacy accent (deprecated - use interactive/active instead) */
    --accent: #0EA5E9;
    --accent-light: rgba(14, 165, 233, 0.15);
    --accent-dark: #0284C7;

    /* Hero section - same overlay works for dark */
    --hero-overlay: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(15, 23, 42, 0.75) 100%);
    --nav-overlay-bg: rgba(0, 0, 0, 0.3);

    /* Chart elements */
    --grid: rgba(255, 255, 255, 0.06);

    /* Chart & Data Visualization */
    --chart-primary: #A78BFA;
    --chart-secondary: #F472B6;
    --chart-tertiary: #34D399;
    --chart-quaternary: #FBBF24;

    /* Status colors - WCAG AA Compliant */
    --positive: #10B981;
    --positive-light: rgba(16, 185, 129, 0.15);
    --negative: #EF4444;
    --negative-light: rgba(239, 68, 68, 0.15);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.15);

    /* Borders & Interactive Borders */
    --border: rgba(255, 255, 255, 0.10);
    --border-interactive: rgba(14, 165, 233, 0.25);
}

/* ===========================
   HERO SECTION
   =========================== */
.hero-section {
    position: relative;
    background-image: url('/static/images/header_bg.jpeg');
    background-size: cover;
    background-position: center;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.hero-section.mini {
    min-height: 120px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
}

.hero-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hero-nav {
    background: var(--nav-overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-nav .nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hero-text);
    text-decoration: none;
}

.hero-nav .nav-links {
    display: flex;
    gap: 1.5rem;
}

.hero-nav .nav-links a {
    color: var(--hero-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.hero-nav .nav-links a:hover,
.hero-nav .nav-links a.active {
    color: var(--hero-text);
}

.hero-nav .nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-nav .nav-user span {
    color: var(--hero-text-muted);
    font-size: 0.875rem;
}

.hero-nav .nav-user a {
    color: var(--hero-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

.hero-nav .nav-user a:hover {
    color: var(--hero-text);
}

.hero-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero-section.mini .hero-main {
    padding: 1rem 2rem;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--hero-text);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.hero-section.mini .hero-title {
    font-size: 28px;
    margin: 0;
}

.hero-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: var(--hero-text-muted);
    margin: 0 0 1rem 0;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--hero-text);
}

.hero-stats-divider {
    opacity: 0.5;
}

/* Breadcrumb in hero */
.hero-section .breadcrumb {
    margin-bottom: 0.5rem;
}

.hero-section .breadcrumb a {
    color: var(--hero-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

.hero-section .breadcrumb a:hover {
    color: var(--hero-text);
}

.hero-section .breadcrumb span {
    color: var(--hero-text-muted);
    font-size: 0.875rem;
}

/* ===========================
   THEME TOGGLE (in hero nav)
   =========================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Theme icons - show sun in light mode, moon in dark mode */
.theme-icon-light,
.theme-icon-dark {
    color: var(--hero-text);
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

/* Hide old fixed theme toggle */
#theme-toggle {
    display: none;
}

/* ===========================
   NAV PILLS (TAB SWITCHING)
   =========================== */
.nav-pills-container {
    display: flex;
    gap: 8px;
    background-color: var(--bg-tertiary);
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--card-border);
}

.nav-pill {
    flex: 1;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.nav-pill:hover {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.nav-pill.active {
    background-color: var(--active);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.30);
}

[data-theme="dark"] .nav-pill.active {
    background-color: var(--active);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.40);
}

/* ===========================
   STAT CARDS WITH GRADIENT ACCENTS
   =========================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    position: relative;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    overflow: hidden;
}

/* Maritime wave accent at bottom of stat cards */
.stat-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-image: var(--wave-pattern-subtle);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom;
    pointer-events: none;
    z-index: 0;
}

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

/* Clickable stat cards - clear affordances */
a.stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    display: block;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

a.stat-card-link:hover {
    border-color: var(--interactive);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(3, 105, 161, 0.15);
}

a.stat-card-link:focus-visible {
    outline: 3px solid var(--interactive);
    outline-offset: 2px;
}

/* Gradient accent bar at TOP */
.stat-accent {
    height: 4px;
    width: 100%;
}

.stat-card[data-accent="neutral"] .stat-accent {
    background: var(--gradient-blue);
}

.stat-card[data-accent="positive"] .stat-accent {
    background: var(--gradient-green);
}

.stat-card[data-accent="negative"] .stat-accent {
    background: var(--gradient-red);
}

.stat-card[data-accent="accent"] .stat-accent {
    background: var(--gradient-purple);
}

.stat-content {
    padding: 1.25rem;
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;  /* 12px - accessibility minimum */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* ===========================
   CONTENT CARDS
   =========================== */
.dashboard-section {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

/* Maritime wave accent at bottom of cards */
.dashboard-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-image: var(--wave-pattern-subtle);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.dashboard-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

/* ===========================
   CHART CONTAINERS
   =========================== */
.chart-container {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

/* Maritime wave accent at bottom of chart containers */
.chart-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-image: var(--wave-pattern);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom;
    pointer-events: none;
    z-index: 0;
}

.chart-container h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* ===========================
   TABLES
   =========================== */
.listings-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.listings-table th {
    font-size: 0.75rem;  /* 12px - accessibility minimum */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 14px 16px;
    text-align: left;
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--active);
}

.listings-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
}

.listings-table tbody tr:nth-child(odd) {
    background: var(--bg-tertiary);
}

.listing-row {
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    border-left: 3px solid transparent;
}

.listing-row:hover {
    background: var(--interactive-light) !important;
    border-left-color: var(--interactive);
}

.listing-row:focus-within {
    outline: 2px solid var(--interactive);
    outline-offset: -2px;
}

/* ===========================
   FILTERS & CONTROLS
   =========================== */
.filters-section {
    margin-bottom: 1.5rem;
}

.filter-label {
    display: block;
    font-size: 0.75rem;  /* 12px - accessibility minimum */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* ===========================
   SCORE BADGES (WCAG AA COMPLIANT)
   =========================== */
.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
}

/* High score - Green with checkmark */
.score-high {
    background: rgba(16, 185, 129, 0.15);
    color: var(--positive);
    border: 2px solid var(--positive);
}

.score-high::before {
    content: '✓';  /* Checkmark */
    font-weight: bold;
    font-size: 1rem;
}

/* Medium score - Yellow/Amber with warning */
.score-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.score-medium::before {
    content: '⚠';  /* Warning symbol */
    font-size: 0.875rem;
}

/* Low score - Red with X */
.score-low {
    background: rgba(239, 68, 68, 0.15);
    color: var(--negative);
    border: 2px solid var(--negative);
}

.score-low::before {
    content: '✕';  /* X mark */
    font-weight: bold;
    font-size: 0.875rem;
}

/* Dark mode adjustments */
[data-theme="dark"] .score-high {
    background: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .score-medium {
    background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .score-low {
    background: rgba(239, 68, 68, 0.2);
}

/* ===========================
   FILTER BADGES
   =========================== */
.filter-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.filter-badge-new {
    background: rgba(16, 185, 129, 0.15);
    color: var(--positive);
}

.filter-badge-drops {
    background: rgba(239, 68, 68, 0.15);
    color: var(--negative);
}

/* NEW badge on listing rows */
.badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.75rem;  /* 12px - accessibility minimum */
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.badge-new {
    background: var(--positive);
    color: white;
}

/* Price drop display */
.price-drop {
    color: var(--positive);
    font-weight: 600;
    font-size: 0.875rem;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--interactive);
    color: white;
    border: 2px solid var(--interactive);
    min-height: 44px;  /* Touch target size */
}

.btn-primary:hover {
    background: var(--interactive-hover);
    border-color: var(--interactive-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 105, 161, 0.25);
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: var(--card-bg);
    border-color: var(--interactive);
}

/* ===========================
   FORMS
   =========================== */
.form-group input,
.form-group select,
.form-select,
.form-input {
    padding: 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
    width: 100%;
}

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-select:focus-visible,
.form-input:focus-visible {
    outline: 3px solid var(--interactive);
    outline-offset: 2px;
    border-color: var(--interactive);
}

/* ===========================
   RESPONSIVE BREAKPOINTS
   =========================== */
@media (max-width: 1023px) {
    .chart-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-nav {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }

    .hero-nav .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hero-section {
        min-height: 220px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .hero-nav .nav-links {
        gap: 0.75rem;
    }

    .hero-nav .nav-links a {
        font-size: 0.8rem;
    }

    .hero-title {
        font-size: 24px;
    }

    .stat-value {
        font-size: 24px;
    }

    .nav-pill {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Smooth transitions for themed elements */
* {
    transition-property: background-color, color, border-color, box-shadow;
    transition-duration: var(--transition-speed);
    transition-timing-function: ease;
}

/* Prevent transitions on page load */
.no-transition * {
    transition: none !important;
}

/* ===========================
   ONBOARDING - BOTTOM SHEET
   =========================== */
.onboarding-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease-out forwards;
}

.onboarding-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(100%);
    animation: slideUp 0.3s ease-out 0.1s forwards;
    z-index: 1001;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.onboarding-handle {
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.onboarding-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.onboarding-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.onboarding-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.onboarding-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.onboarding-radios {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.onboarding-radio {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.onboarding-radio:hover {
    background: var(--bg-secondary);
}

.onboarding-radio input[type="radio"] {
    margin-top: 0.25rem;
    accent-color: var(--interactive);
}

.onboarding-radio .radio-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.onboarding-radio .radio-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.onboarding-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.onboarding-select {
    padding: 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.onboarding-select:focus-visible {
    outline: 3px solid var(--interactive);
    outline-offset: 2px;
    border-color: var(--interactive);
}

.onboarding-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-full {
    width: 100%;
}

.onboarding-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
}

.onboarding-skip:hover {
    color: var(--text-secondary);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .onboarding-row {
        grid-template-columns: 1fr;
    }

    .onboarding-sheet {
        max-height: 85vh;
    }
}

/* ===========================
   ONBOARDING - TOUR
   =========================== */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    pointer-events: none;
}

.tour-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    pointer-events: auto;
}

.tour-spotlight {
    position: fixed;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    pointer-events: none;
}

.tour-tooltip {
    position: fixed;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1101;
    pointer-events: auto;
}

.tour-tooltip-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tour-tooltip-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tour-progress {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.tour-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}

.tour-skip:hover {
    color: var(--text-secondary);
}

.tour-next {
    padding: 0.5rem 1rem;
}
