/* assets/css/style.css */
/* Variables Globales pour un design harmonieux et simple à modifier */
:root {
    --primary: #8B5CF6;       /* Violet ludique (Pastel fort) */
    --primary-hover: #7C3AED;
    --secondary: #F472B6;     /* Rose Bonbon pastel */
    --secondary-hover: #DB2777;
    --danger: #FB7185;        /* Rouge-Rose alert */
    --danger-hover: #E11D48;
    
    --text-main: #374151;     /* Texte principal foncé */
    --text-light: #6B7280;    /* Texte secondaire gris */
    
    --bg-gradient-start: #FDF4FF; /* Fond super doux Rosé/Violet */
    --bg-gradient-end: #F0F9FF;   /* Vers Bleu clair */
    
    --card-bg: rgba(255, 255, 255, 0.85); /* Fond de carte translucide (Glassmorphism) */
    --card-border: rgba(255, 255, 255, 0.4);
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 25px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 35px rgba(0,0,0,0.08);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    /* Dégradé doux et moderne */
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   Structure Principale
========================================== */
.app-container {
    max-width: 1200px;
    margin: 40px auto;
    width: 92%;
    flex: 1; /* Pousse le footer vers le bas */
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.6s ease-out; /* Apparition en douceur au chargement */
}

/* Base de Glassmorphism utilisée sur plusieurs éléments */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* Navbar Full-Width Top Bar */
.navbar {
    width: 100%;
    background: #1E293B; /* Bleu-Gris très foncé */
    padding: 15px 5%; /* 5% de marge sur les côtés pour s'adapter à l'écran */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: #FFFFFF; /* En blanc sur le fond sombre */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}
.welcome-text {
    font-weight: 600;
    color: #CBD5E1; /* Gris clair */
    margin-right: 15px;
}

/* Visibility Utilities for Header Icons */
.mobile-icon {
    display: none;
    align-items: center;
    justify-content: center;
}
.desktop-text {
    display: inline;
}
.mobile-only {
    display: none;
}

/* =========================================
   Boutons
========================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px; /* Forme de pilule */
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    text-align: center;
}
.btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #6D28D9 100%);
    transform: translateY(-2px); /* Léger soulèvement au survol */
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}
.btn-nav {
    padding: 10px 20px;
    font-size: 0.95rem;
    box-shadow: none;
}
.btn-nav:hover {
    box-shadow: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    box-shadow: 0 4px 15px rgba(251, 113, 133, 0.3);
}
.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-hover) 0%, #BE123C 100%);
    box-shadow: 0 6px 20px rgba(251, 113, 133, 0.4);
}
.btn-success {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-hover) 100%);
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
}
.btn-success:hover {
    background: linear-gradient(135deg, var(--secondary-hover) 0%, #BE123C 100%);
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.4);
}
.btn-full {
    width: 100%; /* Prend toute la largeur disponible */
}

/* =========================================
   Cartes & Conteneurs
========================================== */
.card {
    padding: 40px;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-hover);
}
.card-header {
    text-align: center;
    margin-bottom: 30px;
}
.card-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
}
.card-title span {
    color: var(--primary); /* Met en évidence une partie du titre */
}
.card-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Pages spécifiques: Authentification */
.auth-wrapper {
    max-width: 500px;
    margin: 0 auto; /* Centre la carte */
}

/* =========================================
   Formulaires
========================================== */
.form-group {
    margin-bottom: 22px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
}
/* Champ de texte, email, password, etc. */
.form-control {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit; /* Utilise la police 'Outfit' */
    font-size: 1.05rem;
    color: var(--text-main);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    /* Effet "Glow" autour du champ quand sélectionné */
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15); 
}
.form-row {
    display: flex;
    gap: 20px;
}
.form-row .form-group {
    flex: 1; /* Chaque colonne prend 50% de l'espace */
}

/* Menus déroulants (select) personnalisés */
select.form-control {
    appearance: none;
    /* Flèche SVG pour le menu déroulant */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234F46E5%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 18px top 50%;
    background-size: 12px auto;
}

/* Boutons Radio personnalisés (OUI / NON) */
.radio-group {
    display: flex;
    gap: 25px;
    margin-top: 5px;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    padding: 10px 20px;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.6);
    transition: var(--transition);
}
.radio-label:hover {
    border-color: rgba(79, 70, 229, 0.3);
    background: white;
}
/* Le point du bouton radio */
input[type="radio"] {
    accent-color: var(--primary); /* Support moderne pour la couleur des radios */
    width: 18px;
    height: 18px;
    cursor: pointer;
}
/* Quand l'input radio caché dedans est coché, on style le parent (.radio-label) grâce à JS ou au focus si on l'adapte */

/* Sections du grand formulaire enfant */
.section-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    border-bottom: 2px solid rgba(79, 70, 229, 0.1);
    padding-bottom: 12px;
    margin: 40px 0 25px 0;
}
.section-title:first-child { margin-top: 0; }

/* =========================================
   Alertes (Succès ou Erreur)
========================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    font-weight: 600;
    animation: slideDown 0.4s ease-out; /* Apparition par le haut */
}
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* =========================================
   Tableau de Bord : Liste des Enfants
========================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.dashboard-title {
    font-size: 2rem;
    font-weight: 800;
}

/* Grille CSS : s'adapte automatiquement à l'espace */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.child-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    position: relative;
    border-top: 6px solid var(--primary); /* Ligne de couleur en haut */
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.child-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}
.child-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.child-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}
.child-age {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}
.child-details {
    flex: 1; /* Pousse les boutons d'actions vers le bas */
}
.child-details p {
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: var(--text-light);
}
.child-details strong {
    color: var(--text-main);
    font-weight: 600;
}
.child-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05); /* Ligne séparatrice */
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}
.btn-outline:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
}
.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    box-shadow: none;
}
.btn-outline-danger:hover {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
    color: white;
}

/* État vide quand il n'y a pas d'enfants encore enregistrés */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}
.empty-state p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* =========================================
   Animations Clés
========================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Footer
========================================== */
.app-footer {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 50px;
}

/* =========================================
   Responsivité Mobile (pour téléphone)
========================================== */
@media (max-width: 768px) {
    /* Maintien de la navbar sur UNE seule ligne */
    .navbar {
        flex-direction: row;
        padding: 12px 15px;
        gap: 10px;
    }
    .nav-brand {
        font-size: 1.1rem; /* Réduction drastique du titre */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; 
        max-width: 60vw; /* Pour ne pas écraser les boutons de droite */
    }
    .nav-links {
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    /* Remplacement des textes par des icônes SVG centrées */
    .desktop-only { display: none !important; }
    .desktop-text { display: none !important; }
    .mobile-icon { display: flex !important; }
    .mobile-only { display: block !important; }
    
    /* Séparateur parent 2 vertical -> horizontal sur mobile */
    .parent-contact-2 {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px dashed rgba(0,0,0,0.1) !important;
        padding-top: 15px !important;
        margin-top: 5px !important;
    }
    
    .navbar .btn-nav {
        padding: 8px; /* Bouton rond uniquement pour le header */
        border-radius: 50%;
        width: 38px;
        height: 38px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Override pour le bouton 'Se connecter' afin de le garder complet en texte */
    .navbar .btn-nav.btn-login-mobile {
        width: auto;
        height: auto;
        padding: 8px 20px;
        border-radius: 50px;
        font-weight: 600;
        font-size: 0.95rem;
    }

    /* Grille de formulaires */
    .form-row {
        flex-direction: column;
        gap: 0; /* En mobile, les trucs s'empilent, donc le margin-bottom du form-group suffit */
    }
    .card {
        padding: 30px 20px;
    }
    .child-card {
        padding: 25px 20px;
    }
    .child-actions {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Modal de Connexion
========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: none; /* Cache par défaut */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-content {
    width: 90%;
    max-width: 450px;
    position: relative;
    transform: translateY(-30px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active {
    opacity: 1;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: var(--transition);
    z-index: 10;
}
.modal-close:hover {
    color: var(--danger);
    transform: scale(1.1);
}
