/* --- 1. VARIABLES & RESET --- */
:root {
    --apple-bg: #f5f5f7;
    --apple-card: #ffffff;
    --text-main: #1d1d1f;
    --text-sub: #86868b;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background: var(--apple-bg); 
    color: var(--text-main);
    margin: 0;
    padding-bottom: 80px;
}

header, nav {
    position: static; 
    backdrop-filter: none;
    background: transparent;
    box-shadow: none;
    border: none;
}

header h1 {
    margin: 0;          /* Supprime les marges par défaut qui gonflent le header */
    padding: 10px;  /* Ajuste selon tes besoins */
    font-size: 1.5rem;  /* Optionnel : réduire un peu la taille si c'est trop gros */
    line-height: 1.2;   /* Réduit l'espace vertical entre les lignes */
}

/* On crée une "barre fixe" qui contient tout */
.sticky-top-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85); /* Ton effet Apple */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

footer {
    color: #86868b;
    padding: 0;
    text-align: center;
    font-size: 0.8rem;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Pour passer devant tout le reste */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    background: rgba(29, 29, 31, 0.85) /* Ton effet Apple */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

footer a {
    text-decoration: none;
    color: #86868b;
    font-size: 0.9rem;
}

nav ul {
    list-style: none;
    margin: 0;
    display: flex;
    gap: 5px;
    background: transparent; /* On enlève le gris #eee */
    padding: 0 0px;
}

nav a {
    text-decoration: none;
    color: #1d1d1f;
    padding: 6px 12px;
    border-radius: 20px; /* Arrondi style pilule */
    transition: background 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

nav a:hover {
    background: rgba(0, 0, 0, 0.05); /* Gris très léger au survol */
}

/* --- 2. LAYOUT REUTILISABLE --- */
.container {
    max-width: 1100px;
    margin: 15px auto;
    padding: 20px;
}

.flex-grid {
    display: flex;
    flex-wrap: wrap; /* Autorise le côte à côte */
    gap: 20px;
    align-items: stretch; /* Aligne la hauteur des cartes */
}

/* --- 3. COMPOSANTS (CARDS) --- */
.card {
    background: var(--apple-card);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
    /* ICI LE FIX POUR MAC : flex 1 permet de partager la ligne */
    flex: 1; 
    min-width: 280px; /* En dessous de cette taille, ça passe à la ligne */
}

.home-card {
    text-align: center;
    flex: 1;
    padding: 20px;
    min-width: 200px;
}

.home-card2 {
    text-align: center;
    flex: 1;
    padding: 10px;
    min-width: 120px;
}

.home-card1 {
    text-align: center;
    flex: 0 1 calc(50% - 15px); /* 50% moins la moitié du gap */
    transition: transform 0.2s;
    }


/* --- 4. SPECIFIQUE ACTIVITÉS --- */
.narrative-box {
    line-height: 1.6;
}

#map {
    flex: 2; 
    min-width: 350px;
    height: 450px;
}

.stats-aside {
    flex: 1;
    min-width: 280px;
}

/* Badges */
.activity-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid #ddd;
}
.activity-badge.virtualride { background: #e3f2fd; color: #1976d2; }
.activity-badge.ebikeride { background: #fff3e0; color: #e64a19; }
.activity-badge.ride { background: #f1f8e9; color: #689f38; }

.activity-card {
    flex: 1 1 100%; 
    background: var(--apple-card);
    border-radius: 18px;
    display: flex;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid transparent;
    max-height: 130px; /* On fixe une hauteur pour l'alignement */
}

@media (min-width: 768px) {
    .activity-card {
        flex: 0 1 calc(50% - 15px); /* 50% moins la moitié du gap */
    }
}

.activity-card:hover { transform: scale(1.01); }

.mini-map-container {
    width: 130px;
    height: 130px;
    background: #eee;
    flex-shrink: 0;
}

.activity-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.activity-metrics {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    color: var(--text-sub);
    font-size: 0.9rem;
}

#res-conseil div {
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 204, 0, 0.1); /* Un fond jaune très léger */
    border: 1px dashed #ffcc00;
    animation: fadeIn 0.5s;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.form-group input,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafafa;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #666;
    background: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

form button[type="submit"] {
    padding: 10px 28px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

form button[type="submit"]:hover {
    background: #555;
}

.form-success { color: green; margin-bottom: 16px; }
.form-error   { color: red;   margin-bottom: 16px; }



@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 5. RESPONSIVE --- */
@media (max-width: 768px) {
    .container {
        padding: 10px 15px; /* On réduit le padding de 20px à 5px sur les côtés */
    }
    
    .card {
        padding: 15px 10px; /* Des cartes moins "grasses" pour laisser plus de place au texte */
        border-radius: 12px; /* Des angles un peu moins prononcés sur mobile */
    }

    .flex-grid {
        gap: 10px; /* On resserre l'écart entre les blocs */
    }
}