/* --- STYLE CSS --- */
body { font-family: 'Segoe UI', sans-serif; margin: 0; padding: 0; background-color: #ecfdf5; color: #064e3b; }
.container { padding: 20px; max-width: 600px; margin: 0 auto; position: relative; }

input { display: block; width: 100%; padding: 12px; margin: 10px 0; box-sizing: border-box; border: 1px solid #ccc; border-radius: 8px; }
.btn-group { display: flex; gap: 10px; margin-bottom: 10px;}
button { flex: 1; padding: 12px; border: none; cursor: pointer; border-radius: 8px; font-weight: bold; font-size: 16px; transition: 0.2s; }

#btn-signup { background: #059669; color: white; }
#btn-login { background: #fff; border: 1px solid #059669; color: #059669; }
#btn-logout { background: #fee2e2; color: #991b1b; margin-top: 20px; width: 100%; font-size: 14px;}

/* Stats */
.stats-card { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); margin-bottom: 15px; display: flex; justify-content: space-around; text-align: center; }
.stat-item h3 { margin: 0; font-size: 24px; color: #059669; }

/* Map & Controls */
#map { height: 400px; width: 100%; border-radius: 12px; margin-top: 10px; border: 2px solid white; }
#controls { margin-top: 15px; display: flex; gap: 10px; }
#btn-start { background: #10b981; color: white; }
#btn-stop { background: #94a3b8; color: white; }
#btn-stop.active { background: #ef4444; }

/* --- LE POPUP (MODAL) --- */
#modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
}
.modal { background: white; padding: 25px; border-radius: 15px; width: 90%; max-width: 400px; text-align: center; }
.modal h3 { margin-top: 0; color: #065f46; }
.modal label { display: block; text-align: left; margin-top: 15px; font-weight: bold; font-size: 0.9em;}
#btn-save-run { background: #059669; color: white; margin-top: 20px; width: 100%; }
#btn-cancel-run { background: transparent; color: #666; margin-top: 10px; width: 100%; font-weight: normal;}

.hidden { display: none !important; }
h1 { text-align: center; color: #065f46; }

/* --- STYLE DE LA LISTE DES COURSES --- */
#runs-list {
    margin-top: 20px;
    margin-bottom: 20px;
}

.run-card {
    background: white;
    border-radius: 12px; /* Un peu plus arrondi */
    padding: 12px 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    
    display: flex;
    align-items: center;
    justify-content: space-between; /* Pousse les infos à gauche et les actions à droite */
    
    border-left: 5px solid #059669;
    transition: transform 0.2s;
}

.run-info {
    flex-grow: 1; /* Prend toute la place disponible au milieu */
}

/* Groupe Image + Poubelle à droite */
.card-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* Espace entre l'image et la poubelle */
}

.run-date {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.run-stats {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 2px 0 0 0;
}

.run-img-preview {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

/* --- STYLE COMMUNAUTÉ (Mis à jour) --- */
.community-card {
    background: #fff; /* Fond blanc pour mieux voir l'image */
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center; /* Centre verticalement image et texte */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* La nouvelle classe pour l'image */
.community-img {
    width: 60px;       /* Largeur fixe */
    height: 60px;      /* Hauteur fixe */
    border-radius: 8px; /* Coins arrondis */
    object-fit: cover; /* Coupe l'image proprement sans l'écraser */
    margin-right: 15px; /* Espace entre l'image et le texte */
    border: 1px solid #f1f5f9;
    background-color: #f8fafc;
}

.community-info {
    flex-grow: 1;
}

/* --- LANDING PAGE (NOUVEAU DESIGN) --- */

/* On centre tout verticalement si possible */
#auth-container {
    text-align: center;
    padding: 20px 0;
    animation: fadeIn 0.8s ease-out;
}

.landing-header { margin-bottom: 30px; }

.logo-circle {
    font-size: 50px;
    background: white;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.2);
}

.landing-header h1 {
    margin: 0;
    font-size: 2.5rem;
    color: #064e3b;
    letter-spacing: -1px;
}

.hero-text {
    font-size: 1.1rem;
    color: #059669;
    margin-top: 5px;
}

/* Les 3 icônes alignées */
.features-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #065f46;
    font-weight: bold;
    font-size: 0.9rem;
}

.f-icon {
    font-size: 24px;
    background: #d1fae5;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 12px;
    margin-bottom: 5px;
}

/* Retouche du formulaire pour qu'il soit plus "pro" */
#login-form {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    
    /* --- LES MODIFICATIONS --- */
    padding: 25px;       /* Crée de l'espace à l'intérieur du cadre */
    background: white;   /* Assure un fond bien blanc */
    border-radius: 16px; /* Arrondit les coins du cadre */
    /* ------------------------ */
}

.form-title {
    color: #64748b;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* Animation d'apparition */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.footer-note {
    margin-top: 40px;
    font-size: 0.8rem;
    color: #94a3b8;
    opacity: 0.7;
}

.btn-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem; /* Taille raisonnable */
    padding: 8px;      /* Zone de clic confortable mais invisible */
    color: #ef4444;    /* Rouge direct */
    opacity: 0.6;      /* Un peu transparent par défaut (discret) */
    transition: all 0.2s;
}

.btn-delete:hover {
    opacity: 1;           /* Pleinement visible au survol */
    transform: scale(1.1);
    background-color: #fee2e2; /* Petit fond rouge très clair au survol */
    border-radius: 50%;   /* Rond au survol */
}