/* 
 * MitigationHub Shared Styles v1.0
 * Optimized CSS for consistent design across all pages
 * © 2025 Clearview Geographic LLC
 */

/* ========================================
   CSS VARIABLES (Design Tokens)
   ======================================== */

:root {
    /* Brand Colors - MitigationHub Theme */
    --mh-primary: #003D5B;
    --mh-secondary: #2D5016;
    --mh-accent: #4A90A4;
    --mh-nature: #87A878;
    --mh-earth: #8B6F47;
    --mh-light: #f8fafc;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Grayscale Palette */
    --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-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'Courier New', 'Monaco', 'Consolas', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Spacing Scale (4px base) */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    
    /* Border Radius */
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;   /* Pills/Circles */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========================================
   GLOBAL RESETS & BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--gray-900);
    background: white;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ========================================
   LAYOUT SYSTEM
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* Grid System */
.grid {
    display: grid;
}

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

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-extrabold);
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-5xl); }
h3 { font-size: var(--text-4xl); }
h4 { font-size: var(--text-3xl); }
h5 { font-size: var(--text-2xl); }
h6 { font-size: var(--text-xl); }

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

.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.text-muted { color: var(--gray-600); opacity: 0.8; }
.text-primary { color: var(--mh-primary); }
.text-secondary { color: var(--mh-secondary); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }
.font-extrabold { font-weight: var(--font-extrabold); }

/* ========================================
   BUTTON SYSTEM
   ======================================== */

.btn {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    text-decoration: none;
    text-align: center;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    font-size: var(--text-base);
}

.btn-primary {
    background: linear-gradient(135deg, var(--mh-primary), var(--mh-secondary));
    color: white;
}

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

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

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

.btn-outline {
    background: transparent;
    color: var(--mh-primary);
    border: 2px solid var(--mh-primary);
}

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

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-xl);
    border-radius: var(--radius-full);
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   CARD SYSTEM
   ======================================== */

.card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

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

.card-bordered {
    border: 2px solid var(--gray-200);
}

.card-accent-top {
    border-top: 4px solid var(--mh-secondary);
}

.card-accent-left {
    border-left: 5px solid var(--mh-secondary);
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
    background: white;
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--mh-primary);
}

.nav-list {
    list-style: none;
    display: flex;
    gap: var(--space-6);
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    color: var(--mh-primary);
    text-decoration: none;
    font-weight: var(--font-medium);
    padding: var(--space-2) var(--space-4);
    transition: color var(--transition-fast);
}

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

.sticky {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

/* ========================================
   SECTIONS
   ======================================== */

.section {
    padding: var(--space-20) var(--space-4);
}

.section-dark {
    background: var(--mh-primary);
    color: white;
}

.section-light {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.section-title {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-6);
    color: var(--mh-primary);
    text-align: center;
}

/* ========================================
   PRICING CARDS
   ======================================== */

.pricing-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: all var(--transition-base);
    border-top: 5px solid var(--mh-secondary);
}

.pricing-card:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-2xl);
}

.pricing-card.featured {
    transform: scale(1.05);
    border-top-color: var(--mh-primary);
    box-shadow: var(--shadow-2xl);
}

.pricing-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    color: var(--mh-primary);
    margin-bottom: var(--space-4);
}

.pricing-price {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    color: var(--mh-secondary);
    margin: var(--space-8) 0;
}

.pricing-period {
    font-size: var(--text-lg);
    color: var(--gray-600);
    font-weight: var(--font-normal);
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin: var(--space-8) 0;
    padding: 0;
}

.pricing-features li {
    padding: var(--space-3) 0;
    padding-left: var(--space-10);
    position: relative;
    color: var(--gray-700);
}

.pricing-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--mh-secondary);
    font-weight: var(--font-extrabold);
    font-size: var(--text-lg);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: var(--mh-primary);
    color: white;
    padding: var(--space-20) var(--space-4) var(--space-8);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.footer-logo {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-4);
}

.footer-tagline {
    font-size: var(--text-lg);
    opacity: 0.9;
    margin-bottom: var(--space-6);
}

.footer-heading {
    color: var(--mh-secondary);
    margin-bottom: var(--space-8);
    font-weight: var(--font-extrabold);
}

.footer-link {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-fast);
    margin-bottom: var(--space-4);
}

.footer-link:hover {
    color: var(--mh-secondary);
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-8);
    text-align: center;
    opacity: 0.8;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

.animate-slide-in {
    animation: slideInRight 0.5s ease-out;
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   FLOATING CTA
   ======================================== */

.floating-cta {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-2xl);
    border-radius: var(--radius-full);
    animation: float 3s ease-in-out infinite;
}

.floating-cta a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    background: linear-gradient(135deg, var(--mh-secondary), var(--mh-primary));
    color: white;
    padding: var(--space-6) var(--space-8);
    text-decoration: none;
    font-weight: var(--font-extrabold);
    font-size: var(--text-lg);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.floating-cta:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 60px rgba(45, 80, 22, 0.4);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

@media (max-width: 768px) {
    :root {
        --text-6xl: 2.5rem;
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .nav-list {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .floating-cta {
        bottom: var(--space-4);
        right: var(--space-4);
    }
    
    .floating-cta a {
        padding: var(--space-4) var(--space-6);
        font-size: var(--text-base);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

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

/* Focus States */
*:focus {
    outline: 2px solid var(--mh-primary);
    outline-offset: 2px;
}

/* ========================================
   UTILITIES
   ======================================== */

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

/* Badge */
.badge {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-extrabold);
    background: rgba(45, 80, 22, 0.12);
    color: var(--mh-secondary);
}

/* Stats */
.stat-number {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    color: var(--mh-secondary);
    margin-bottom: var(--space-2);
}

.stat-label {
    color: var(--gray-600);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Feature Icons */
.feature-icon {
    font-size: 4rem;
    margin-bottom: var(--space-6);
    display: block;
}

/* ========================================
   MITIGATIONHUB SPECIFIC STYLES
   ======================================== */

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--mh-primary) 0%, var(--mh-secondary) 100%);
    color: white;
    padding: var(--space-24) var(--space-4);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,197.3C1248,203,1344,149,1392,122.7L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') bottom center no-repeat;
    background-size: cover;
    opacity: 0.3;
}

.hero-logo {
    font-size: 4rem;
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-6);
    letter-spacing: -2px;
}

.hero-tagline {
    font-size: 2rem;
    font-weight: var(--font-light);
    margin-bottom: var(--space-8);
    opacity: 0.95;
}

/* Stats Section */
.stats {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    padding: var(--space-16) var(--space-4);
}

/* Origin Story */
.origin {
    background: linear-gradient(135deg, var(--mh-primary) 0%, var(--mh-secondary) 100%);
    color: white;
    padding: var(--space-16) var(--space-4);
    text-align: center;
}

.origin-quote {
    font-style: italic;
    font-size: var(--text-xl);
    padding: var(--space-8);
    border-left: 4px solid var(--mh-nature);
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    margin: var(--space-8) 0;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Critical CSS for above-the-fold content */
.hero,
.nav,
.section-title {
    will-change: transform;
}

/* Optimize animations */
.animate-fade-in,
.animate-slide-in {
    will-change: opacity, transform;
}

/* Reduce repaints */
.card,
.pricing-card {
    will-change: transform;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .floating-cta,
    .nav {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}