/* ========================================================= */
/* 1. RESET ET TYPOGRAPHIE */
/* ========================================================= */
:root {
    --color-primary: #4CAF50; /* Vert Nature */
    --color-secondary: #FF9800; /* Orange Avertissement */
    --color-danger: #F44336; /* Rouge Erreur */
    --color-info: #2196F3; /* Bleu Info */
    --color-background: #f0f4f8; /* Fond léger */
    --color-card-bg: #ffffff;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-button: 0 4px 6px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}




body {
    padding-bottom: 70px; /* Assurez-vous que cette valeur est plus grande que la hauteur du bouton */
}









body {
    background-color: var(--color-background);
    color: #333;
    line-height: 1.6;
}

/* ========================================================= */
/* 2. ÉCRAN GLOBAL ET STRUCTURE */
/* ========================================================= */

.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
}

.screen.active {
    display: block;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background-color: var(--color-card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
}

h1, h2, h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

/* ========================================================= */
/* 3. SPLASH SCREEN (UX AMÉLIORÉE) */
/* ========================================================= */

#splashScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-tree {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounceY 1.5s infinite alternate; 
}

@keyframes bounceY {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-15px);
    }
}

/* ========================================================= */
/* 4. ONBOARDING (UX Améliorée) */
/* ========================================================= */

.onboarding-container {
    padding-top: 50px;
    text-align: center;
}

.onboarding-claim {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 30px;
}

#onboardingForm {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    background: var(--color-card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.footer-note {
    margin-top: 20px;
    font-size: 0.9em;
    color: #777;
}

/* ========================================================= */
/* 5. BOUTONS et FORMULAIRES (UX Améliorée) */
/* ========================================================= */

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease-in-out;
    box-shadow: var(--shadow-button);
    margin-top: 10px;
    text-decoration: none;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
    box-shadow: none;
}

.btn-warning {
    background-color: var(--color-secondary);
    color: #333;
}

.btn-info {
    background-color: var(--color-info);
    color: white;
}

.btn-large {
    width: 100%;
    padding: 15px 25px;
    font-size: 1.1em;
    margin-top: 20px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn:not(:disabled):hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn:not(:disabled):active {
    transform: scale(0.98);
}

/* Boutons d'Upload */
.input-options {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-upload {
    flex: 1;
    background-color: #ecf0f1;
    color: #2c3e50;
    box-shadow: none;
}

.btn-upload input[type="file"] {
    display: none;
}

/* ========================================================= */
/* 6. DASHBOARD ET AFFICHAGE STATUT */
/* ========================================================= */
.fixed-header {
    /* Suppression de position: fixed, top, left, etc. */
    width: 100%;
    background-color: var(--color-card-bg);
    box-shadow: var(--shadow-light);
    padding: 15px 0; /* Un peu plus de padding pour l'aérer */
    margin-bottom: 20px; /* Ajout d'une marge en bas pour décoller du contenu */
}


.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    margin: 0;
    color: var(--color-primary);
}

.user-control {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.greeting-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.greeting-text {
    font-size: 1.1em;
    font-weight: bold;
    color: #2c3e50;
}

/* MARGE PRINCIPALE CORRIGÉE (Par défaut pour Desktop/Tablette) */
.main-content-margin {
    margin-top: 0px; 
}

/* Styles Quota Visuel (Points Verts) */
.quota-area {
    display: flex;
    align-items: center;
    gap: 10px; 
}

.gift-sticker {
    background-color: #e67e22;
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
}

.visual-quota {
    display: flex;
    gap: 4px; /* Espacement entre les points */
}

.quota-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    /* Couleur gérée par JS: #388e3c (foncé) ou #a5d6a7 (clair) */
    transition: background-color 0.4s ease-in-out; 
}

/* Media Query pour la responsivité sur petits écrans (< 600px) */
@media (max-width: 600px) {
    
    /* Augmenter la marge pour compenser la hauteur du header sur mobile */
    .main-content-margin {
        margin-top: 10px; 
    }
    
    .header-content {
        flex-wrap: wrap; 
        padding-bottom: 5px; 
    }

    .user-control {
        width: 100%; 
        flex-direction: row;
        justify-content: space-between;
        margin-top: 5px;
        align-items: center;
    }
    
    .greeting-text {
        font-size: 1em;
    }
}


/* ========================================================= */
/* 7. DIAGNOSTIC ET RÉSULTAT */
/* ========================================================= */

.preview-container {
    text-align: center;
    margin-bottom: 20px;
}

/* Fixer la taille de la prévisualisation d'image */
.image-preview {
    width: 250px; 
    height: 250px;
    border-radius: 8px;
    margin-bottom: 15px;
    object-fit: cover;
    border: 2px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-box {
    border-left: 5px solid var(--color-primary);
}

.spinner {
    display: none;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================================= */
/* 8. HISTORIQUE */
/* ========================================================= */

.history-list {
    list-style: none;
    padding: 0;
}

.history-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.history-item:hover {
    background-color: #f7f7f7;
}

.history-item-date {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 5px;
}

.history-item-summary {
    font-weight: 500;
}

.expert-assistance-zone {
    border: 2px dashed var(--color-info);
    background-color: #e3f2fd;
}


/* ========================================================= */
/* 9. MODALS */
/* ========================================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--color-card-bg);
    margin: auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.modal-title-warning {
    color: var(--color-secondary);
}

.modal-title-info {
    color: var(--color-info);
}

.expert-instruction {
    margin-bottom: 20px;
    font-weight: 500;
}

.expert-contact-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Styles spécifiques aux boutons de contact */
.btn-whatsapp { background-color: #25D366; color: white; }
.btn-email { background-color: #D9534F; color: white; }
.btn-sms { background-color: #8E44AD; color: white; }

.full-result {
    white-space: pre-wrap;
    background-color: #f7f7f7;
    padding: 15px;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

/* Animations de notification */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
@keyframes fadeOut {
    to {
        opacity: 0;
    }
}