/* ===================================
   CSS Variables & Reset
   =================================== */
:root {
    /* Colors from migration doc */
    --primary: #1A365D;
    --secondary: #DC2626;
    --accent: #10B981;
    --background: #FFFFFF;
    --light-gray: #F7FAFC;
    --dark: #0F172A;
    --text: #334155;
    --text-light: #64748B;

    /* Additional colors */
    --primary-light: #2563EB;
    --gradient-1: linear-gradient(135deg, #1A365D 0%, #2563EB 100%);
    --gradient-2: linear-gradient(135deg, #DC2626 0%, #F97316 100%);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* 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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    overflow-x: hidden;
}

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

/* ===================================
   Navigation
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

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

.nav-links {
    display: flex;
    gap: var(--spacing-md);
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

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

/* ===================================
   Traffic Light Components
   =================================== */
.traffic-light-mini {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    background: var(--dark);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.traffic-light-mini .light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.traffic-light-mini .light.red.active {
    background: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
}

.traffic-light-mini .light.yellow.active {
    background: #F59E0B;
    box-shadow: 0 0 10px #F59E0B;
}

.traffic-light-mini .light.green.active {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Large Traffic Light (Hero) */
.traffic-light-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: float 3s ease-in-out infinite;
}

.light-housing {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 30px;
    background: var(--dark);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

.light-housing .light {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    position: relative;
}

.light-housing .light::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent);
}

.light-housing .light.active {
    animation: pulse 2s ease-in-out infinite;
}

.light-housing .light.red.active {
    background: var(--secondary);
    box-shadow: 0 0 30px var(--secondary), 0 0 60px rgba(220, 38, 38, 0.5);
}

.light-housing .light.yellow.active {
    background: #F59E0B;
    box-shadow: 0 0 30px #F59E0B, 0 0 60px rgba(245, 158, 11, 0.5);
}

.light-housing .light.green.active {
    background: var(--accent);
    box-shadow: 0 0 30px var(--accent), 0 0 60px rgba(16, 185, 129, 0.5);
}

.light-pole {
    width: 20px;
    height: 100px;
    background: linear-gradient(to bottom, var(--dark), #334155);
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow-md);
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px;
}

.hero-background {
    position: absolute;
    inset: 0;
    background-image: url('../images/hero-highway.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(26, 54, 93, 0.95) 0%,
        rgba(37, 99, 235, 0.85) 50%,
        rgba(26, 54, 93, 0.95) 100%
    );
    z-index: -1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    padding: var(--spacing-lg) 0;
}

.hero-text {
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.title-line {
    display: block;
}

.title-highlight {
    display: block;
    background: linear-gradient(135deg, #F59E0B 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.8;
    max-width: 600px;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.hero-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===================================
   Scroll Indicator
   =================================== */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    animation: bounce 2s ease-in-out infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 15px;
    margin: 0 auto 10px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 10px;
    background: white;
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s ease-in-out infinite;
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-2);
    color: white;
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid white;
    backdrop-filter: blur(10px);
}

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

/* ===================================
   Sections
   =================================== */
.section {
    padding: var(--spacing-xl) 0;
}

.section-gray {
    background: var(--light-gray);
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    color: inherit;
}

.section-subtitle {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: inherit;
    opacity: 0.8;
}

/* ===================================
   Problem Section
   =================================== */
.problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.problem-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
}

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

.problem-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.problem-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--primary);
}

/* ===================================
   Features Section
   =================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.feature-card {
    background: var(--light-gray);
    padding: var(--spacing-md);
    border-radius: 12px;
    transition: var(--transition);
    text-align: center;
    border: 2px solid transparent;
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: white;
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--primary);
}

/* ===================================
   Coverage Section
   =================================== */
.coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.coverage-card {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--spacing-md);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    text-align: center;
}

.coverage-card.active {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
}

.coverage-card.coming-soon {
    opacity: 0.6;
}

.coverage-card:hover {
    transform: translateY(-5px);
    border-color: white;
}

.coverage-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.coverage-card.active .coverage-status {
    background: var(--accent);
    color: white;
}

.coverage-card.coming-soon .coverage-status {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.coverage-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

/* ===================================
   About Section
   =================================== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.about-description {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.stat {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--light-gray);
    border-radius: 12px;
}

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

.stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
}

.map-placeholder {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--light-gray);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.map-pin {
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    box-shadow: var(--shadow-xl);
    animation: ping 2s ease-in-out infinite;
}

.map-pin::before {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    animation: ripple 2s ease-out infinite;
}

/* ===================================
   Contact Section
   =================================== */
.section-contact {
    background: var(--light-gray);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    padding: var(--spacing-md);
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin-bottom: var(--spacing-lg);
}

.contact-email:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.email-icon {
    font-size: 2rem;
}

.contact-form {
    margin-top: var(--spacing-lg);
}

.contact-form form {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.contact-form input {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    transition: var(--transition);
}

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

.form-message {
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
}

.form-message.success {
    color: var(--accent);
}

.form-message.error {
    color: var(--secondary);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--dark);
    color: white;
    padding: var(--spacing-lg) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
}

.footer-info {
    text-align: center;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent);
}

/* ===================================
   Animations
   =================================== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

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

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

@keyframes scroll {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(20px); opacity: 0; }
}

@keyframes ping {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-graphic {
        margin-top: var(--spacing-md);
    }

    .light-housing .light {
        width: 60px;
        height: 60px;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

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

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-md);
    }

    .footer-links {
        justify-content: center;
    }

    .contact-form form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

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