/**
 * Bell'Green Ecopaturage - Custom Styles
 */

/* ========================================
   Critical CSS - Prevent FOUC
   ======================================== */
html {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   Fonts
   ======================================== */
.font-heading {
    font-family: 'Playfair Display', Georgia, serif;
}

.font-body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========================================
   CLS Prevention - Reserve space for images
   ======================================== */
img {
    max-width: 100%;
    height: auto;
}

/* Aspect ratio for hero images */
.hero-image {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* ========================================
   Base
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* ========================================
   Map Markers
   ======================================== */
.map-marker {
    background-color: #16a34a;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.custom-marker {
    background: transparent;
    border: none;
}

/* ========================================
   Map Popups
   ======================================== */
.map-popup {
    text-align: center;
}

.map-popup strong {
    display: block;
    color: #166534;
    font-size: 14px;
    margin-bottom: 2px;
}

.map-popup span {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 4px;
}

.map-popup a {
    color: #16a34a;
    font-size: 12px;
    text-decoration: none;
}

.map-popup a:hover {
    text-decoration: underline;
}

/* ========================================
   Animations
   ======================================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ========================================
   Form Focus States
   ======================================== */
input:focus,
textarea:focus {
    outline: none;
}

/* ========================================
   Transitions
   ======================================== */
.transition {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* ========================================
   Custom Scrollbar (optional)
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f0fdf4;
}

::-webkit-scrollbar-thumb {
    background: #86efac;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #22c55e;
}

/* ========================================
   Grass Effect - Animated grass blades
   ======================================== */
.grass-container {
    position: relative;
    width: 100%;
    height: 60px;
    overflow: hidden;
    pointer-events: none;
}

.grass-container.grass-top {
    transform: scaleY(-1);
}

.grass-blade {
    position: absolute;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to top,
        hsl(var(--hue, 142) 76% 36%),
        hsl(var(--hue, 142) 71% 45%),
        hsl(var(--hue, 142) 69% 58%));
    border-radius: 50% 50% 0 0;
    transform-origin: bottom center;
    animation: sway 3s ease-in-out infinite;
}

.grass-blade::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -2px;
    width: 3px;
    height: 70%;
    background: linear-gradient(to top, #15803d, #16a34a, #22c55e);
    border-radius: 50% 50% 0 0;
    transform-origin: bottom center;
    transform: rotate(-15deg);
}

.grass-blade::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -2px;
    width: 3px;
    height: 60%;
    background: linear-gradient(to top, #14532d, #15803d, #16a34a);
    border-radius: 50% 50% 0 0;
    transform-origin: bottom center;
    transform: rotate(12deg);
}

/* Different blade variations */
.grass-blade.blade-short { height: 25px; }
.grass-blade.blade-medium { height: 35px; }
.grass-blade.blade-tall { height: 45px; }
.grass-blade.blade-xtall { height: 55px; }

/* Animation delays for natural movement */
.grass-blade:nth-child(5n+1) { animation-delay: 0s; }
.grass-blade:nth-child(5n+2) { animation-delay: 0.2s; }
.grass-blade:nth-child(5n+3) { animation-delay: 0.5s; }
.grass-blade:nth-child(5n+4) { animation-delay: 0.3s; }
.grass-blade:nth-child(5n+5) { animation-delay: 0.7s; }

/* Different animation speeds */
.grass-blade:nth-child(3n+1) { animation-duration: 2.5s; }
.grass-blade:nth-child(3n+2) { animation-duration: 3s; }
.grass-blade:nth-child(3n+3) { animation-duration: 3.5s; }

@keyframes sway {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* Grass row - for inline generation */
.grass-row {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

.grass-row.grass-row-top {
    top: 0;
    bottom: auto;
    transform: scaleY(-1);
}

/* Decorative grass patch */
.grass-patch {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
    height: 40px;
    gap: 3px;
}

.grass-patch .blade {
    width: 3px;
    background: linear-gradient(to top, #16a34a, #4ade80);
    border-radius: 50% 50% 0 0;
    transform-origin: bottom center;
    animation: sway 3s ease-in-out infinite;
}

.grass-patch .blade:nth-child(1) { height: 20px; animation-delay: 0s; }
.grass-patch .blade:nth-child(2) { height: 30px; animation-delay: 0.2s; }
.grass-patch .blade:nth-child(3) { height: 35px; animation-delay: 0.4s; }
.grass-patch .blade:nth-child(4) { height: 28px; animation-delay: 0.1s; }
.grass-patch .blade:nth-child(5) { height: 22px; animation-delay: 0.3s; }

/* Grass divider between sections */
.grass-divider {
    position: relative;
    height: 50px;
    background: linear-gradient(to bottom, transparent 0%, #dcfce7 100%);
    overflow: hidden;
}

.grass-divider::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: #dcfce7;
}

/* SVG Grass for more detail */
.grass-svg-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    overflow: hidden;
    pointer-events: none;
}

.grass-svg-container svg {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .grass-blade,
    .grass-patch .blade {
        animation: none;
    }
}
