:root {
    --primary-green: #8dbd2b;
    --secondary-blue: #1a5e9b;
}

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

body { 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden;
    line-height: 1.6;
}

/* ==================== UTILITY CLASSES ==================== */
.bg-gh-blue { background-color: var(--secondary-blue) !important; }
.text-gh-blue { color: var(--secondary-blue) !important; }
.bg-gh-green { background-color: var(--primary-green) !important; }
.text-gh-green { color: var(--primary-green) !important; }
.border-gh-green { border-color: var(--primary-green) !important; }

/* Pattern */
.pattern-diagonal {
    background-image: radial-gradient(var(--primary-green) 0.5px, transparent 0.5px);
    background-size: 10px 10px;
    opacity: 0.1;
}

/* ==================== RESPONSIVE STATS ==================== */
.stat-number {
    position: relative;
    color: #f0f0f0;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 900;
    line-height: 1;
}

.stat-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-blue);
    font-size: clamp(2.5rem, 8vw, 6rem);
}

/* ==================== MOBILE MENU ==================== */
#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu-overlay {
    transition: opacity 0.4s ease;
}

.menu-open { 
    overflow: hidden; 
}

.menu-open #mobile-menu {
    transform: translateX(0);
}

.menu-open #mobile-menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { 
    width: 8px; 
}

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

::-webkit-scrollbar-thumb { 
    background: var(--secondary-blue); 
}

::-webkit-scrollbar-thumb:hover { 
    background: var(--primary-green); 
}

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

/* ==================== CAROUSEL ==================== */
.carousel-slide {
    transition: opacity 1000ms ease-in-out;
}

.carousel-indicator {
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator:hover {
    transform: scale(1.2);
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== EFFECTS ==================== */
.grayscale {
    filter: grayscale(100%);
}

.grayscale:hover {
    filter: grayscale(0%);
}

.drop-shadow-2xl {
    filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.15));
}

.drop-shadow-md {
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07));
}

/* ==================== SHADOWS ==================== */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); }

/* ==================== BACKDROP BLUR ==================== */
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px); }
.backdrop-blur { backdrop-filter: blur(8px); }

/* ==================== BORDER RADIUS ==================== */
.rounded-sm { border-radius: 0.125rem; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* ==================== OPACITY ==================== */
.opacity-0 { opacity: 0; }
.opacity-20 { opacity: 0.2; }
.opacity-40 { opacity: 0.4; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }
.opacity-100 { opacity: 1; }

/* ==================== FILTERS ==================== */
.brightness-0 { filter: brightness(0); }
.invert { filter: invert(1); }

/* ==================== ASPECT RATIO ==================== */
.aspect-\[16\/10\] { aspect-ratio: 16 / 10; }

/* ==================== OBJECT FIT ==================== */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

/* ==================== POINTER EVENTS ==================== */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ==================== OVERFLOW ==================== */
.overflow-hidden { overflow: hidden; }

/* ==================== Z-INDEX ==================== */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }
.-z-10 { z-index: -10; }

/* ==================== FLEX ==================== */
.flex-shrink-0 { flex-shrink: 0; }

/* ==================== LETTER SPACING ==================== */
.tracking-tighter { letter-spacing: -0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* ==================== LINE HEIGHT ==================== */
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.leading-loose { line-height: 2; }

/* ==================== CURSOR ==================== */
.cursor-pointer { cursor: pointer; }

/* ==================== FOCUS ==================== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-green) !important;
}

*:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* ==================== TRANSITIONS ==================== */
button, a, img {
    transition: all 0.3s ease;
}

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

/* Mobile Small (< 375px) */
@media (max-width: 374px) {
    body {
        font-size: 14px;
    }
    
    /* Hero adjustments */
    #hero-carousel h1 {
        font-size: 2rem !important;
    }
    
    #hero-carousel p {
        font-size: 0.875rem !important;
    }
    
    /* Reduce padding for very small screens */
    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Mobile (375px - 639px) */
@media (max-width: 639px) {
    /* Stats responsive */
    .stat-number {
        font-size: clamp(3rem, 15vw, 5rem);
    }
    
    .stat-overlay {
        font-size: clamp(2rem, 10vw, 4rem);
    }
    
    /* Hero section */
    #hero-carousel {
        height: 550px !important;
    }
    
    #hero-carousel h1 {
        font-size: clamp(2.5rem, 10vw, 3.5rem) !important;
    }
    
    #hero-carousel h1 span {
        font-size: clamp(1.5rem, 8vw, 2.5rem) !important;
    }
    
    /* Navigation mobile adjustments */
    nav img {
        height: 3rem !important;
    }
    
    /* Top bar responsive */
    .bg-gh-green {
        font-size: 0.625rem;
    }
    
    /* Buttons responsive */
    a[class*="px-"] {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        padding-top: 0.875rem !important;
        padding-bottom: 0.875rem !important;
    }
    
    /* Cards and grids */
    .grid {
        gap: 1rem !important;
    }
    
    /* Sections padding */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Titles responsive */
    h2 {
        font-size: clamp(2rem, 8vw, 3rem) !important;
    }
    
    h3 {
        font-size: clamp(1.25rem, 6vw, 1.75rem) !important;
    }
    
    /* Formation cards */
    .bg-white.p-10 {
        padding: 1.5rem !important;
    }
    
    /* Contact form */
    form .grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Modal responsive */
    #etapeModal .max-w-2xl {
        max-width: 95vw !important;
        margin: 0.5rem;
    }
    
    #etapeModal .p-8 {
        padding: 1.5rem !important;
    }
    
    /* Footer adjustments */
    footer .grid {
        gap: 2rem !important;
    }
    
    footer h3 {
        font-size: 1.25rem !important;
    }
    
    /* Mobile menu width */
    #mobile-menu {
        width: 85vw !important;
        max-width: 320px;
    }
    
    /* Services damier */
    .grid.grid-cols-1.md\:grid-cols-3 > div {
        padding: 2rem !important;
    }
    
    /* Images responsive */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Tablet (640px - 767px) */
@media (min-width: 640px) and (max-width: 767px) {
    #hero-carousel {
        height: 600px !important;
    }
    
    section {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
    
    .grid.md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Tablet Large (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Hero adjustments */
    #hero-carousel h1 {
        font-size: clamp(3rem, 8vw, 5rem) !important;
    }
    
    /* Navigation spacing */
    nav {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    /* Sections padding */
    section {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    /* Grid adjustments */
    .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop Small (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .max-w-7xl {
        max-width: 90vw;
    }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    #hero-carousel {
        height: 100vh !important;
        min-height: 450px;
    }
    
    #hero-carousel h1 {
        font-size: clamp(2rem, 6vw, 3rem) !important;
        margin-bottom: 1rem !important;
    }
    
    #hero-carousel p {
        font-size: 0.875rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .hover\:scale-110:hover {
        transform: none;
    }
    
    .hover\:text-gh-green:hover {
        color: inherit;
    }
    
    /* Active states for touch */
    button:active,
    a:active {
        opacity: 0.7;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

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

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Print styles */
@media print {
    nav, footer, button, #mobile-menu-wrapper {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        text-decoration: underline !important;
    }
}

/* ==================== UTILITY RESPONSIVE HELPERS ==================== */

/* Hide on mobile */
@media (max-width: 639px) {
    .sm\:hidden {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 1024px) {
    .lg\:hidden {
        display: none !important;
    }
}

/* Responsive text sizes */
@media (max-width: 639px) {
    .text-\[10px\] {
        font-size: 0.625rem !important;
    }
    
    .text-xs {
        font-size: 0.75rem !important;
    }
    
    .text-sm {
        font-size: 0.875rem !important;
    }
}

/* Responsive spacing */
@media (max-width: 639px) {
    .gap-24 {
        gap: 2rem !important;
    }
    
    .gap-20 {
        gap: 1.5rem !important;
    }
    
    .gap-12 {
        gap: 1rem !important;
    }
    
    .gap-10 {
        gap: 0.75rem !important;
    }
    
    .gap-8 {
        gap: 0.5rem !important;
    }
}

/* Responsive margins and paddings */
@media (max-width: 639px) {
    .p-32 { padding: 2rem !important; }
    .p-24 { padding: 1.5rem !important; }
    .p-20 { padding: 1.25rem !important; }
    .p-16 { padding: 1rem !important; }
    .p-12 { padding: 0.75rem !important; }
    
    .py-32 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .py-24 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    
    .mb-32 { margin-bottom: 2rem !important; }
    .mb-24 { margin-bottom: 1.5rem !important; }
    .mb-20 { margin-bottom: 1.25rem !important; }
    .mb-16 { margin-bottom: 1rem !important; }
    .mb-12 { margin-bottom: 0.75rem !important; }
}

/* Responsive width constraints */
@media (max-width: 639px) {
    .max-w-7xl,
    .max-w-4xl,
    .max-w-3xl,
    .max-w-2xl {
        max-width: 100% !important;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Performance optimizations */
@media (max-width: 639px) {
    /* Reduce animation complexity on mobile */
    .hover\:scale-110,
    .group-hover\:scale-110,
    .transition-all {
        transition: opacity 0.2s ease !important;
    }
    
    /* Optimize backgrounds */
    .backdrop-blur-\[1px\],
    .backdrop-blur-\[2px\] {
        backdrop-filter: none !important;
        background-color: rgba(26, 94, 155, 0.8) !important;
    }
}