/* ===================================
   Minnesota Green Guides - Custom Styles
   Enhanced with Material Design 3 principles
   ==================================== */

/* CSS Variables - Brand Colors & Design System */
:root {
    /* Brand Colors */
    --mg-primary: #4DB897;
    --mg-primary-dark: #2A7A5E;
    --mg-primary-light: #7DCFB2;
    --mg-gold: #D4A574;
    --mg-earth-brown: #8B7355;
    --mg-earth-tan: #D4C4A8;
    --mg-dark: #1a1a1a;
    --mg-gray: #6c757d;
    --mg-light-gray: #f8f9fa;

    /* Material Design 3 - Border Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* Material Design 3 - Elevation Shadows */
    --shadow-1: 0 1px 2px 0 rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
    --shadow-2: 0 1px 2px 0 rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
    --shadow-3: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3);
    --shadow-4: 0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3);
    --shadow-5: 0 8px 12px 6px rgba(0,0,0,0.15), 0 4px 4px rgba(0,0,0,0.3);

    /* Material Design 3 - Easing */
    --easing-standard: cubic-bezier(0.2, 0.0, 0, 1.0);
    --easing-emphasized: cubic-bezier(0.4, 0.0, 0.2, 1);
    --easing-decelerated: cubic-bezier(0.0, 0.0, 0.2, 1);
    --easing-accelerated: cubic-bezier(0.4, 0.0, 1, 1);

    /* Spacing System (8px grid) */
    --space-1: 0.5rem;  /* 8px */
    --space-2: 1rem;    /* 16px */
    --space-3: 1.5rem;  /* 24px */
    --space-4: 2rem;    /* 32px */
    --space-5: 2.5rem;  /* 40px */
    --space-6: 3rem;    /* 48px */
}

/* Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--mg-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* ==================
   NAVIGATION
   ================== */
.navbar {
    transition: all 0.3s var(--easing-standard);
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
}

.navbar-brand img {
    transition: all 0.3s var(--easing-standard);
    max-height: 90px;
    object-fit: cover;
    object-position: center;
    margin-top: -15px;
    margin-bottom: -15px;
}

.navbar .nav-link {
    font-weight: 500;
    color: var(--mg-dark);
    margin: 0 var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--easing-standard);
    position: relative;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--mg-primary);
    background-color: rgba(77, 184, 151, 0.08);
}

.navbar .nav-link.active {
    color: var(--mg-primary);
    background-color: rgba(77, 184, 151, 0.12);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: var(--shadow-2);
}

/* ==================
   HERO SECTION
   ================== */
.hero-section {
    position: relative;
    overflow: hidden;
    padding-top: 70px;
    color: white;
    /* Background image with dark overlay for text readability */
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.6) 100%),
        url('../images/optimized/hero-bg-girl-field-1920x1280.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

/* Fallback for browsers that don't support WebP */
.no-webp .hero-section {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.6) 100%),
        url('../images/optimized/hero-bg-girl-field-1920x1280.jpg');
}

/* Mobile optimization - use smaller image and adjusted overlay */
@media (max-width: 768px) {
    .hero-section {
        background-image:
            linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%),
            url('../images/optimized/hero-bg-girl-field-768x512.webp');
        background-position: 60% center; /* Focus on subject on mobile */
    }

    .no-webp .hero-section {
        background-image:
            linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%),
            url('../images/optimized/hero-bg-girl-field-768x512.jpg');
    }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1440px) {
    .hero-section {
        background-image:
            linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.6) 100%),
            url('../images/optimized/hero-bg-girl-field-1440x960.webp');
    }

    .no-webp .hero-section {
        background-image:
            linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.6) 100%),
            url('../images/optimized/hero-bg-girl-field-1440x960.jpg');
    }
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    text-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 4px 24px rgba(0,0,0,0.3);
}

.hero-section .lead {
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-section .text-primary {
    color: var(--mg-gold) !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

/* Center hero content */
.hero-content-center {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-content-center .btn {
    min-width: 240px;
}

/* ==================
   BUTTONS
   ================== */
.btn {
    font-weight: 600;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    transition: all 0.2s var(--easing-emphasized);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s var(--easing-emphasized), height 0.4s var(--easing-emphasized);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-lg {
    padding: var(--space-3) var(--space-4);
    font-size: 1.1rem;
    border-radius: var(--radius-xl);
}

/* Hero CTA - 15% larger */
.hero-cta {
    font-size: 1.265rem !important;
}

/* Navigation CTAs */
.navbar .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Mobile nav buttons - stack vertically */
@media (max-width: 991px) {
    .navbar .d-flex.gap-2 {
        flex-direction: column;
        margin-top: 1rem;
        margin-left: 0 !important;
        gap: 0.5rem !important;
    }

    .navbar .btn-sm {
        width: 100%;
    }
}

.btn i {
    transition: transform 0.3s var(--easing-emphasized);
}

.btn:hover i {
    transform: translateX(4px);
}

/* Button Variants */
.btn-primary {
    background-color: var(--mg-primary) !important;
    border-color: var(--mg-primary) !important;
    box-shadow: var(--shadow-2);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--mg-primary-dark) !important;
    border-color: var(--mg-primary-dark) !important;
    box-shadow: var(--shadow-3);
    transform: translateY(-2px);
}

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

.btn-outline-primary {
    color: var(--mg-primary) !important;
    border-color: var(--mg-primary) !important;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--mg-primary) !important;
    border-color: var(--mg-primary) !important;
    color: white !important;
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.bg-primary {
    background-color: var(--mg-primary) !important;
}

.text-primary {
    color: var(--mg-primary) !important;
}

/* Light Button Variant (High Contrast) */
.btn-light {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
    color: var(--mg-primary-dark) !important;
    box-shadow: var(--shadow-2);
    font-weight: 700;
}

.btn-light:hover,
.btn-light:focus {
    background-color: #f8f9fa !important;
    border-color: #f8f9fa !important;
    color: var(--mg-primary-dark) !important;
    box-shadow: var(--shadow-3);
    transform: translateY(-2px);
}

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

/* Success/Warning Button Variants */
.btn-success {
    background-color: #198754;
    border-color: #198754;
    box-shadow: var(--shadow-2);
}

.btn-outline-success {
    color: #198754;
    border-color: #198754;
    background-color: white;
}

.btn-outline-success:hover {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: white !important;
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.btn-warning {
    background-color: var(--mg-gold);
    border-color: var(--mg-gold);
    color: #1a1a1a !important;
    box-shadow: var(--shadow-2);
    font-weight: 700;
}

.btn-outline-warning {
    color: var(--mg-gold);
    border-color: var(--mg-gold);
    background-color: white;
}

.btn-outline-warning:hover {
    background-color: var(--mg-gold) !important;
    border-color: var(--mg-gold) !important;
    color: #1a1a1a !important;
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.btn-outline-info {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-color: white;
}

.btn-outline-info:hover {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

/* ==================
   CARDS
   ================== */
.card {
    transition: all 0.3s var(--easing-emphasized);
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-2);
}

.hover-lift {
    transition: all 0.3s var(--easing-emphasized);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-4) !important;
}

.card .btn {
    transition: all 0.3s var(--easing-standard);
}

/* Icon Circles */
.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--easing-emphasized);
}

.hover-lift:hover .icon-circle {
    transform: scale(1.1);
}

/* ==================
   STATS SECTION
   ================== */
#stats {
    background: linear-gradient(135deg, var(--mg-primary) 0%, var(--mg-primary-dark) 100%);
    position: relative;
}

#stats::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.stat-item {
    position: relative;
    padding: var(--space-2);
    transition: all 0.3s var(--easing-emphasized);
}

.stat-item:hover {
    transform: scale(1.05);
}

.stat-item::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background-color: var(--mg-gold);
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.4);
}

/* ==================
   ACCORDION
   ================== */
.accordion-item {
    border: none;
    border-radius: var(--radius-md) !important;
    margin-bottom: var(--space-2);
    box-shadow: var(--shadow-1);
    overflow: hidden;
    transition: all 0.3s var(--easing-standard);
}

.accordion-item:hover {
    box-shadow: var(--shadow-2);
}

.accordion-button {
    border-radius: var(--radius-md) !important;
    font-weight: 600;
    padding: var(--space-3);
    transition: all 0.2s var(--easing-standard);
}

.accordion-button:not(.collapsed) {
    background-color: rgba(77, 184, 151, 0.08);
    color: var(--mg-primary-dark);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(77, 184, 151, 0.15);
    border-color: var(--mg-primary);
}

.accordion-button:not(.collapsed)::after {
    filter: hue-rotate(150deg);
}

.accordion-body {
    padding: var(--space-3);
}

.accordion-button i {
    flex-shrink: 0;
}

/* ==================
   FORMS
   ================== */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 2px solid #e0e0e0;
    padding: var(--space-2) var(--space-3);
    transition: all 0.2s var(--easing-standard);
    font-size: 1rem;
}

.form-control:hover,
.form-select:hover {
    border-color: #c0c0c0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mg-primary);
    box-shadow: 0 0 0 4px rgba(77, 184, 151, 0.12);
    outline: none;
}

.form-label {
    font-weight: 600;
    margin-bottom: var(--space-1);
    color: var(--mg-dark);
    font-size: 0.95rem;
}

/* ==================
   BADGES
   ================== */
.badge {
    font-weight: 600;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    letter-spacing: 0.02em;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-warning {
    background-color: var(--mg-gold) !important;
}

.bg-success-subtle {
    background-color: rgba(77, 184, 151, 0.12) !important;
    border-radius: var(--radius-md);
}

/* ==================
   DROPDOWN
   ================== */
.dropdown-menu {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-3);
    padding: var(--space-1);
    margin-top: var(--space-1);
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: var(--space-1) var(--space-2);
    margin: 2px 0;
    transition: all 0.15s var(--easing-standard);
}

.dropdown-item:hover {
    background-color: rgba(77, 184, 151, 0.08);
    color: var(--mg-primary);
    transform: translateX(4px);
}

/* ==================
   FOOTER
   ================== */
footer {
    position: relative;
}

footer .footer-logo {
    margin-top: -10px;
    margin-bottom: 0.5rem !important;
    transition: all 0.3s var(--easing-standard);
    max-height: 30px;
}

/* Responsive footer logo sizing */
@media (max-width: 768px) {
    footer .footer-logo {
        max-height: 24px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    footer .footer-logo {
        max-height: 26px;
    }
}

footer .footer-logo:hover {
    transform: scale(1.05);
}

footer a {
    transition: all 0.2s var(--easing-standard);
}

footer a:hover {
    color: var(--mg-primary) !important;
    transform: translateX(2px);
}

footer .btn-outline-light {
    border-radius: var(--radius-full);
    transition: all 0.2s var(--easing-emphasized);
}

footer .btn-outline-light:hover {
    background-color: var(--mg-primary);
    border-color: var(--mg-primary);
    transform: scale(1.1);
}

/* Social Links */
.social-links .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

/* ==================
   UTILITIES
   ================== */
.text-muted {
    color: var(--mg-gray) !important;
}

.text-success {
    color: #198754 !important;
}

.text-warning {
    color: var(--mg-gold) !important;
}

.text-success-emphasis {
    color: var(--mg-primary-dark) !important;
}

/* Background Opacity Utilities */
.bg-success.bg-opacity-10 {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.bg-warning.bg-opacity-10 {
    background-color: rgba(212, 165, 116, 0.1) !important;
}

/* Section Spacing */
section {
    position: relative;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 60px;
}

/* Loading Animation for Images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive image sizing for cards */
.card-img-top {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Mobile - smaller images */
@media (max-width: 768px) {
    .card-img-top {
        max-height: 200px;
    }

    section img.img-fluid {
        max-width: 100%;
    }
}

/* Tablet - medium images */
@media (min-width: 769px) and (max-width: 1024px) {
    .card-img-top {
        max-height: 250px;
    }

    section img.img-fluid {
        max-width: 90%;
        margin: 0 auto;
        display: block;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s var(--easing-decelerated);
}

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

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

/* Who We Help Cards - Color Variations */
#who-we-help .card {
    border-radius: var(--radius-lg);
}

#who-we-help .card:nth-child(1) .icon-circle {
    background-color: rgba(77, 184, 151, 0.12);
}

#who-we-help .card:nth-child(2) .icon-circle {
    background-color: rgba(25, 135, 84, 0.12);
}

#who-we-help .card:nth-child(3) .icon-circle {
    background-color: rgba(212, 165, 116, 0.12);
}

/* Lead Magnet Form Card */
#resources .card {
    max-width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2);
}

#resources form {
    text-align: left;
}

/* Consultation Form */
#consultation .card {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-3);
}

/* Additional spacing utilities */
.gap-3 {
    gap: var(--space-2) !important;
}

/* ==================
   RESPONSIVE
   ================== */
@media (max-width: 768px) {
    .display-3 {
        font-size: 2.25rem;
    }

    .display-5 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1rem;
    }

    .btn-lg {
        padding: var(--space-2) var(--space-3);
        font-size: 1rem;
    }

    .icon-circle {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 991px) {
    .hero-section {
        padding-top: 100px;
        padding-bottom: 50px;
    }

    .hero-section .min-vh-100 {
        min-height: auto !important;
    }
}

/* ==================
   ACCESSIBILITY
   ================== */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--mg-primary);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================
   PRINT STYLES
   ================== */
@media print {
    .navbar,
    footer,
    .btn,
    #consultation,
    #resources {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* ==================
   PERFORMANCE
   ================== */
/* GPU Acceleration for animations */
.hover-lift,
.btn,
.card,
.navbar {
    will-change: transform;
}

/* Contain paint for sections */
section {
    contain: layout style paint;
}
