/* ============================================
   CrimeSpotter UK - Complete Stylesheet
   Version: 2.0
   Last Updated: January 2025
   ============================================ */

/* ============================================
   TABLE OF CONTENTS
   ============================================
   1. CSS Variables & Root Settings
   2. Reset & Base Styles
   3. Typography
   4. Layout Components
   5. Header & Navigation
   6. Hero Section
   7. Search Components
   8. Map Section
   9. Statistics Section
   10. About Section
   11. Footer
   12. Page-Specific Styles
       - Privacy Page
       - Terms Page
       - Contact Page
   13. Cookie Consent
   14. Utility Classes
   15. Animations
   16. Media Queries
   ============================================ */

/* ============================================
   1. CSS VARIABLES & ROOT SETTINGS
   ============================================ */
:root {
    /* Colors */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --danger-color: #dc2626;
    --success-color: #059669;
    --warning-color: #d97706;
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --hero-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    /* Z-index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;
    --z-loading: 9999;
}

/* ============================================
   2. RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ============================================
   4. LAYOUT COMPONENTS
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-3xl) 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

/* ============================================
   5. HEADER & NAVIGATION
   ============================================ */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: var(--spacing-xl);
    list-style: none;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    transition: all 0.3s ease;
}

/* ============================================
   6. HERO SECTION
   ============================================ */
.hero {
    background: var(--hero-gradient);
    color: white;
    padding: var(--spacing-3xl) 0;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
}

.gradient-text {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-2xl);
    line-height: 1.6;
}

/* ============================================
   7. SEARCH COMPONENTS
   ============================================ */
.search-section {
    max-width: 600px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: white;
    font-size: 1rem;
    padding: var(--spacing-md) 0;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-xl);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.search-btn:hover {
    background: #e08c0e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Quick Locations */
.quick-locations {
    margin-top: var(--spacing-xl);
    text-align: center;
}

.quick-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.quick-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ============================================
   8. MAP SECTION
   ============================================ */
.map-section {
    margin-bottom: var(--spacing-3xl);
}

.map-wrapper {
    display: flex;
    height: 80vh;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.map-controls {
    width: 320px;
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.map-controls.collapsed {
    width: 0;
    border-right: none;
}

.map-container {
    flex: 1;
    position: relative;
}

.crime-map {
    width: 100%;
    height: 100%;
}

/* Map Controls */
.controls-header {
    padding: var(--spacing-lg);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.control-section {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.control-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-md);
}

/* Crime Filters */
.filter-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.filter-item:hover {
    background: var(--gray-100);
}

.filter-count {
    margin-left: auto;
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Map Overlays */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.map-notification {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    z-index: var(--z-popover);
    animation: slideDown 0.3s ease;
}

.update-location-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.update-location-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   9. STATISTICS SECTION
   ============================================ */
.stats-section {
    padding: var(--spacing-3xl) 0;
    background: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.stat-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ============================================
   10. ABOUT SECTION
   ============================================ */
.about-section {
    padding: var(--spacing-3xl) 0;
    background: var(--gray-50);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    align-items: center;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.feature-item {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

/* What is CrimeSpotter Section */
.what-is-section {
    padding: 4rem 0;
    background: white;
    border-top: 1px solid var(--gray-200);
}

.what-is-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 3rem;
}

.icon-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.icon-item {
    width: 80px;
    height: 80px;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.icon-item:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--gray-50);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* ============================================
   11. FOOTER
   ============================================ */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--spacing-3xl) 0 var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-md);
}

.footer-section h4 {
    color: white;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-section a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--gray-700);
    text-align: center;
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* ============================================
   12. PAGE-SPECIFIC STYLES
   ============================================ */

/* Privacy Page */
.privacy-hero,
.terms-hero,
.contact-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
}

.privacy-container,
.terms-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem;
    background: white;
}

.privacy-nav,
.terms-nav {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    position: sticky;
    top: 80px;
    z-index: 10;
}

.privacy-section,
.terms-section {
    margin-bottom: 3rem;
    scroll-margin-top: 100px;
}

.privacy-section h2,
.terms-section h2 {
    color: var(--gray-900);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
}

/* Contact Page */
.contact-form-section {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-submit {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============================================
   13. COOKIE CONSENT
   ============================================ */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1.5rem 0;
    z-index: var(--z-loading);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* ============================================
   14. UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ============================================
   15. ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

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

/* Loading Animation */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    transition: opacity 0.5s ease;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   16. MEDIA QUERIES
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-lg);
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Hero */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Search */
    .search-bar {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Quick Buttons */
    .quick-buttons {
        padding: 0 0.5rem;
    }
    
    .quick-btn {
        flex: 1 1 calc(50% - 0.5rem);
        font-size: 0.85rem;
    }
    
    /* Map */
    .map-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    .map-controls {
        width: 100%;
        max-height: 40vh;
        order: 2;
    }
    
    .map-container {
        height: 60vh;
        order: 1;
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Privacy/Terms Navigation */
    .privacy-nav,
    .terms-nav {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    
    .privacy-section,
    .terms-section {
        scroll-margin-top: 20px;
    }
    
    /* What is Section */
    .what-is-content h2 {
        font-size: 1.75rem;
    }
    
    .icon-display {
        flex-direction: column;
    }
    
    .plus-sign {
        transform: rotate(90deg);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact */
    .contact-form-section {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Cookie Consent */
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-buttons {
        width: 100%;
        justify-content: center;
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .quick-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: var(--spacing-lg) 0;
    }
    
    .map-wrapper {
        height: 90vh;
    }
}

/* ============================================
   PRIVACY PAGE NAVIGATION FIX
   Add this to your existing CSS or as a separate fix
   ============================================ */

/* Fix for Privacy Page Navigation Overlap */
.privacy-nav {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    /* Remove sticky positioning on privacy page */
    position: relative !important;
    top: auto !important;
    z-index: 1;
}

/* Alternative: If you want to keep it sticky but fix the overlap */
.privacy-nav.sticky-nav {
    position: sticky !important;
    top: auto !important; /* Increase top spacing to avoid header overlap */
    z-index: 10;
}

/* Ensure content sections have proper spacing */
.privacy-section {
    margin-bottom: 3rem;
    padding-top: 2rem; /* Add padding to prevent content hiding */
    scroll-margin-top: 120px; /* Increase scroll margin */
}

/* Fix the first section after navigation */
.privacy-container > .privacy-section:first-of-type {
    margin-top: 2rem;
}

/* For Terms page - same fix */
.terms-nav {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    position: relative !important;
    top: auto !important;
    z-index: 1;
}

.terms-section {
    margin-bottom: 3rem;
    padding-top: 2rem;
    scroll-margin-top: 120px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .privacy-nav,
    .terms-nav {
        position: relative !important;
        top: auto !important;
        margin-bottom: 2rem;
    }
    
    .privacy-section,
    .terms-section {
        padding-top: 1rem;
        scroll-margin-top: 20px;
    }
}

/* If the header is causing issues, add this */
.header {
    z-index: 1000 !important; /* Ensure header stays on top */
}

/* Quick Navigation specific styles */
.privacy-nav h3,
.terms-nav h3 {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.privacy-nav ul,
.terms-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.privacy-nav li,
.terms-nav li {
    margin-bottom: 0.5rem;
}

.privacy-nav a,
.terms-nav a {
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    display: block;
    padding: 0.25rem 0;
}

.privacy-nav a:hover,
.terms-nav a:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding-left: 0.5rem;
    border-radius: 4px;
}

/* Layout basics */
.header .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Desktop nav */
.nav-links { display: flex; gap: 16px; align-items: center; }

/* Hamburger button (hidden on desktop) */
.mobile-menu-btn {
  display: none;                /* show only on mobile via media query */
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background: #0f172a;          /* adjust to your theme */
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* Mobile menu styles */
@media (max-width: 900px) {
  .mobile-menu-btn { display: flex; }

  .nav-links {
    display: none;              /* hidden by default on mobile */
    position: absolute;
    top: 64px;                  /* below header */
    right: 16px;
    z-index: 50;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    border-radius: 12px;
    padding: 12px;
    width: min(92vw, 320px);
    flex-direction: column;
    gap: 10px;
  }
  .nav-links.open { display: flex; }
}

/* Optional: animate hamburger into an “X” when active */
.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}
/* Fixed-height wrappers for charts */
.chart-container.fixed-360 { height: 360px; }
.chart-container.fixed-320 { height: 320px; }

/* Make the canvas fill the wrapper exactly */
.chart-container .chart-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
/* Trends tab: fixed-height chart wrappers */
#trends .chart-container { height: 360px; }          /* pick your height */
@media (max-width: 768px) { #trends .chart-container { height: 320px; } }

/* Make each canvas fill its wrapper exactly */
#trends .chart-container .chart-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#analytics { max-width: 1000px; margin: 0 auto; }

.sr-only {
  position:absolute !important;
  width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}