/* ======================================================================= */
/* FICHIER: style.css                                                      */
/* ======================================================================= */
/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}



.container {
    width: 95%;
    max-width: 800px;
    margin: 1rem auto;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    flex-grow: 1;
}

/* Header */
.app-header {
    background-color: #0056b3;
    color: #fff;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000; /* Pour être au-dessus du contenu */
}
.app-header h1 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}
.status-indicators {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.9rem;
}
.status {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: bold;
}
.status.offline { background-color: #dc3545; color: white; }
.status.online { background-color: #28a745; color: white; }
.status.syncing { background-color: #ffc107; color: #333; }
.status.pending { background-color: #6c757d; color: white; }


/* Navigation / Main Buttons */
.main-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: background-color 0.2s ease;
}
.btn svg {
    vertical-align: middle;
}
.btn-primary {
    background-color: #007bff;
    color: white;
}
.btn-primary:hover {
    background-color: #0056b3;
}
.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
}
.btn-simplified {
    background-color: #ffc107;
    color: #333;
}
.btn-simplified:hover {
    background-color: #e0a800;
}
.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}
.icon-btn {
    background: #eee;
    border: 1px solid #ccc;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin: 0.2rem;
}
.icon-btn.selected {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}


/* Forms */
.hidden-section {
    display: none;
}
#evaluation-form-section.visible,
#pending-list-section.visible,
#simplified-mode-section.visible {
    display: block;
}

#evaluation-form fieldset, #simplified-form fieldset { /* #simplified-form n'a pas de fieldset dans le code actuel, mais au cas où */
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
}
#evaluation-form legend, #simplified-form legend {
    font-weight: bold;
    padding: 0 0.5rem;
    color: #0056b3;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: bold;
    font-size: 0.9rem;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}
.form-group textarea {
    resize: vertical;
}
.form-group input[type="radio"],
.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}
.form-group label input[type="radio"],
.form-group label input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
    vertical-align: middle;
}
.form-group label:has(input[type="radio"]),
.form-group label:has(input[type="checkbox"]) {
    display: inline-block;
    margin-right: 1rem;
    font-weight: normal;
}

#geo-status {
    font-style: italic;
    color: #555;
    margin-right: 0.5rem;
}
#photo-preview img {
    max-width: 100%;
    height: auto;
    margin-top: 0.5rem;
    border: 1px solid #eee;
}
.form-actions, .pending-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Pending List */
#pending-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
}
#pending-list li {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
#pending-list li span {
    flex-grow: 1;
    margin-right: 1rem;
    font-size: 0.9rem;
}
#pending-list li button {
     padding: 0.2rem 0.5rem;
     font-size: 0.8rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #666;
    background-color: #e9ecef;
    position: relative; /* For update notification positioning */
}

.update-notification {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #28a745; /* Green background */
    color: white;
    padding: 10px;
    text-align: center;
    z-index: 2000; /* Ensure it's on top */
    font-size: 0.9rem;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
}
.update-notification.hidden {
    display: none;
}
.update-notification button {
    background-color: white;
    color: #28a745;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 10px;
    font-weight: bold;
}


/* Responsive Adjustments */
@media (min-width: 600px) {
    .app-header h1 {
        font-size: 1.8rem;
    }
    .main-nav {
        flex-direction: row;
        justify-content: center;
    }
    .form-actions, .pending-actions {
        justify-content: flex-end;
    }
    #pending-list li {
        flex-wrap: nowrap;
    }
}

.fieldset-separator {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
    margin: 20px 0;
}

.hidden-conditional-group {
    display: none; /* Caché par défaut */
    /* Animation douce pour l'apparition/disparition */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.hidden-conditional-group.visible {
    display: block; /* Devient visible via JS */
    max-height: 500px; /* Assez grand pour contenir les éléments */
    opacity: 1;
}

/* Amélioration visuelle pour les champs désactivés */
input:disabled, textarea:disabled, select:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Style pour le nouveau bouton OCR dans la navigation principale */
.main-nav .btn-ocr {
    /* Vous pouvez ajouter des styles spécifiques si vous voulez qu'il se distingue */
    /* background-color: #5cb85c; */ /* Exemple: vert */
    /* border-color: #4cae4c; */
}
.main-nav .btn-ocr svg {
    margin-right: 8px;
}


/* Styles pour le Modal */
.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease-out;
}

.modal.visible .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    margin-top: 0;
    color: #0056b3;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.modal-content p strong {
    color: #d9534f;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}
.close-button:hover {
    color: #777;
}

.modal-content .btn {
    margin-top: 10px;
    display: block; 
    width: auto;
    margin-left: auto;
    margin-right: 0;
}

