/* ===== STYLES MOBILE-FIRST ULTRA RESPONSIVE ===== */
/* Optimisé pour PWA et installation sur mobile */

:root {
    --primary-color: #27ae60;
    --primary-dark: #14532d;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.25);
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);
    --safe-area-inset-right: env(safe-area-inset-right);
}

/* Reset pour PWA */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
}

html {
    height: 100%;
    /* Empêche le zoom sur iOS */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Styles de base pour mobile */
body {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Pour Safari mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.4;
    color: var(--white);
    padding: 20px;
    padding-top: calc(20px + var(--safe-area-inset-top));
    padding-bottom: calc(20px + var(--safe-area-inset-bottom));
    padding-left: calc(20px + var(--safe-area-inset-left));
    padding-right: calc(20px + var(--safe-area-inset-right));
    overflow-x: hidden;
}

/* Container principal - Optimisé mobile */
.landing-container {
    text-align: center;
    color: var(--white);
    z-index: 1;
    width: 100%;
    max-width: 100%;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px - var(--safe-area-inset-top) - var(--safe-area-inset-bottom));
}

/* Icone - Adaptative */
.landing-container .icon {
    font-size: clamp(3rem, 10vw, 5rem); /* Taille fluide */
    margin-bottom: clamp(15px, 4vw, 20px);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(80px, 20vw, 100px);
    height: clamp(80px, 20vw, 100px);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    margin: 0 auto clamp(15px, 4vw, 20px);
}

/* Titre principal - Typographie responsive */
.landing-container h1 {
    font-size: clamp(2rem, 8vw, 3.5rem); /* Taille fluide du titre */
    margin: 0 0 clamp(8px, 2vw, 10px) 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Tagline - Taille responsive */
.landing-container .tagline {
    font-size: clamp(1rem, 4vw, 1.3rem);
    margin-bottom: clamp(25px, 7vw, 40px);
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.5;
    padding: 0 clamp(10px, 4vw, 20px);
}

/* Boutons de navigation - Optimisés pour mobile */
.navigation-buttons {
    display: flex;
    flex-direction: column; /* Colonne sur mobile */
    gap: clamp(12px, 3vw, 20px);
    width: 100%;
    max-width: 400px;
    margin-top: clamp(25px, 7vw, 40px);
}

/* Boutons - Taille optimale pour le touch */
.nav-button {
    background: var(--white);
    color: var(--primary-color);
    padding: clamp(16px, 4vw, 20px) clamp(20px, 5vw, 30px);
    border-radius: 16px; /* Plus arrondi pour mobile */
    text-decoration: none;
    font-size: clamp(1rem, 4vw, 1.1rem);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 10px);
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
    min-height: 56px; /* Taille minimale pour le touch (accessibilité) */
    width: 100%; /* Pleine largeur sur mobile */
    position: relative;
    overflow: hidden;
}

/* Effet de touch feedback */
.nav-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.nav-button:active::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Effets hover/sur mobile */
.nav-button:hover,
.nav-button:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Variante secondaire */
.nav-button.secondary {
    background: var(--glass-bg);
    color: var(--white);
    border: 2px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.nav-button.secondary:hover,
.nav-button.secondary:active {
    background: rgba(255, 255, 255, 0.15);
}

/* Features grid - Responsive avancé */
.features {
    margin-top: clamp(40px, 10vw, 60px);
    display: grid;
    grid-template-columns: 1fr; /* 1 colonne sur mobile */
    gap: clamp(20px, 5vw, 30px);
    width: 100%;
    max-width: 1200px;
}

/* Cartes de fonctionnalités */
.feature-card {
    background: var(--glass-bg);
    padding: clamp(20px, 5vw, 30px);
    border-radius: 20px; /* Coins plus arrondis */
    backdrop-filter: blur(20px); /* Effet glassmorphisme */
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* Effet de hover/active */
.feature-card:hover,
.feature-card:active {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Icônes dans les cartes */
.feature-card i {
    font-size: clamp(2rem, 6vw, 2.5rem);
    margin-bottom: clamp(12px, 3vw, 15px);
    display: block;
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    width: clamp(60px, 15vw, 70px);
    height: clamp(60px, 15vw, 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

/* Titres des cartes */
.feature-card h3 {
    margin: clamp(8px, 2vw, 10px) 0;
    color: var(--white);
    font-size: clamp(1.2rem, 4vw, 1.4rem);
    font-weight: 600;
}

/* Texte des cartes */
.feature-card p {
    margin: clamp(8px, 2vw, 10px) 0 0 0;
    font-size: clamp(0.9rem, 3vw, 0.95rem);
    opacity: 0.9;
    line-height: 1.5;
}

/* Footer */
.footer-info {
    margin-top: clamp(40px, 10vw, 60px);
    opacity: 0.8;
    font-size: clamp(0.8rem, 3vw, 0.9rem);
    text-align: center;
    padding: 0 15px;
}

/* ===== MEDIA QUERIES POUR TABLETTES ===== */
@media (min-width: 768px) {
    body {
        padding: 30px;
        padding-top: calc(30px + var(--safe-area-inset-top));
        padding-bottom: calc(30px + var(--safe-area-inset-bottom));
    }
    
    .landing-container {
        padding: 0 30px;
    }
    
    .navigation-buttons {
        flex-direction: row; /* Boutons en ligne sur tablette+ */
        justify-content: center;
        flex-wrap: wrap;
        max-width: 800px;
    }
    
    .nav-button {
        width: auto;
        min-width: 200px; /* Largeur minimale sur tablette */
        flex: 1;
        max-width: 300px;
    }
    
    .features {
        grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur tablette */
    }
    
    /* Amélioration du glassmorphisme pour tablette+ */
    .feature-card {
        backdrop-filter: blur(25px);
    }
}

/* ===== MEDIA QUERIES POUR DESKTOP ===== */
@media (min-width: 1024px) {
    .landing-container {
        padding: 0 40px;
    }
    
    .features {
        grid-template-columns: repeat(4, 1fr); /* 4 colonnes sur desktop */
    }
    
    .navigation-buttons {
        flex-direction: row;
        gap: 25px;
    }
    
    .nav-button {
        flex: none;
        min-width: 220px;
    }
}

/* ===== MEDIA QUERIES POUR TRÈS GRANDS ÉCRANS ===== */
@media (min-width: 1440px) {
    .landing-container {
        max-width: 1400px;
    }
}

/* ===== SUPPORT PWA - FENÊTRES CUSTOM ===== */
/* Styles pour l'application installée */
@media (display-mode: standalone) {
    body {
        padding-top: calc(40px + var(--safe-area-inset-top)); /* Plus d'espace pour la status bar */
    }
    
    .nav-button {
        min-height: 60px; /* Plus grand pour les PWA */
    }
    
    /* Cache éventuelle barre d'URL */
    @supports (padding: max(0px)) {
        body {
            padding-top: max(20px, var(--safe-area-inset-top));
            padding-bottom: max(20px, var(--safe-area-inset-bottom));
        }
    }
}

/* ===== SUPPORT DESKTOP PWA (Chrome, Edge) ===== */
@media (display-mode: standalone) and (min-width: 768px) {
    .landing-container {
        max-width: 600px;
    }
    
    .features {
        max-width: 1000px;
    }
}

/* ===== ORIENTATION PAYSAGE ===== */
@media (orientation: landscape) and (max-height: 600px) {
    .landing-container {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .landing-container h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }
    
    .landing-container .tagline {
        margin-bottom: 20px;
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }
    
    .navigation-buttons {
        margin-top: 25px;
        flex-direction: row;
        gap: 15px;
    }
    
    .nav-button {
        padding: 12px 20px;
        min-height: 48px;
    }
    
    .features {
        margin-top: 30px;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .feature-card {
        padding: 15px;
    }
}

/* ===== SUPPORT DARK MODE ===== */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #5A4DCC 0%, #4A3DB8 100%);
    }
    
    .feature-card {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-button.secondary {
        background: rgba(0, 0, 0, 0.2);
    }
}

/* ===== ANIMATIONS SMOOTH ===== */
@media (prefers-reduced-motion: no-preference) {
    .landing-container {
        animation: fadeIn 0.8s ease-out;
    }
    
    .feature-card {
        animation: slideUp 0.6s ease-out backwards;
    }
    
    .feature-card:nth-child(1) { animation-delay: 0.1s; }
    .feature-card:nth-child(2) { animation-delay: 0.2s; }
    .feature-card:nth-child(3) { animation-delay: 0.3s; }
    .feature-card:nth-child(4) { animation-delay: 0.4s; }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SCROLL SMOOTH ===== */
html {
    scroll-behavior: smooth;
}

/* ===== SUPPORT DES ÉCRANS TRÈS PETITS (iPhone SE, petits Android) ===== */
@media (max-width: 360px) {
    .landing-container {
        padding: 0 10px;
    }
    
    .landing-container h1 {
        font-size: 1.8rem;
    }
    
    .landing-container .tagline {
        font-size: 0.95rem;
    }
    
    .nav-button {
        min-height: 52px;
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .feature-card {
        padding: 15px;
    }
}

/* ===== SUPPORT DES ÉCRANS PLIABLES ===== */
@media (screen-spanning: single-fold-vertical) {
    .landing-container {
        max-width: 50vw;
        margin-left: 50vw;
    }
}

/* ===== IMPRESSION ===== */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .nav-button,
    .feature-card {
        border: 1px solid #ddd !important;
        color: black !important;
        background: white !important;
        box-shadow: none !important;
    }
}

/* ===== ACCESSIBILITÉ ===== */
/* Focus visible pour navigation clavier */
.nav-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Réduction de mouvement pour les personnes sensibles */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ===== SUPPORT IOS 15+ ===== */
@supports (backdrop-filter: blur(1px)) {
    .feature-card,
    .nav-button.secondary,
    .landing-container .icon {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

/* Fallback pour les navigateurs sans support backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
    .feature-card,
    .nav-button.secondary {
        background: rgba(255, 255, 255, 0.15);
    }
}