/* =========================================================================
   CSS POUR LE FORMULAIRE DE SAISIE D'ACTIONS (dataForm)
   A ajouter dans votre fichier CSS principal
   ========================================================================= */

/* Conteneur principal du formulaire */
#dataForm {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Overlay de fond */
#form-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}

/* Titre du formulaire */
#dataForm h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

/* Groupes de champs */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* Indicateur de champ obligatoire */
.required {
    color: red;
    margin-left: 2px;
}

/* Champs de saisie */
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group select {
    height: 42px;
    cursor: pointer;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Compteur de caracteres */
.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Zone d'actions (boutons) */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

/* Styles des boutons */
#dataForm .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

#dataForm .btn-primary {
    background-color: #007bff;
    color: white;
}

#dataForm .btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

#dataForm .btn-secondary {
    background-color: #6c757d;
    color: white;
}

#dataForm .btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* Styles specifiques pour les types d'actions */
.action-recolte { 
    background-color: #ffeaa7; 
}

.action-taille { 
    background-color: #fab1a0; 
}

.action-traitement { 
    background-color: #74b9ff; 
}

.action-autre { 
    background-color: #ddd; 
}

/* Responsive - Mobile */
@media (max-width: 600px) {
    #dataForm {
        width: 95%;
        padding: 15px;
        max-height: 90vh;
    }
    
    #dataForm h3 {
        font-size: 18px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Animation d'ouverture */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

#dataForm[style*="display: block"] {
    animation: slideIn 0.3s ease-out;
}

/* =========================================================================
   CSS POUR LE SELECTEUR DE DONNEES (ViewData)
   ========================================================================= */

/* Conteneur du selecteur de donnees */
#selector-viewData {
    display: none;
    position: fixed;
    top: 60px;
    right: 10px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9000;
    min-width: 250px;
    max-width: 300px;
}

/* Titre du selecteur */
#selector-viewData h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

/* Header du selecteur avec bouton fermer */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.view-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

/* Label pour la liste */
#lbl_viewArboids {
    font-weight: bold;
    color: #333;
    font-size: 14px;
    margin-bottom: 5px;
    display: block;
}

/* Liste de selection des arboids */
#viewArboidsSelect {
    width: 100%;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    overflow-y: scroll;
    overflow-x: hidden;
    display: block;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px;
    font-size: 13px;
    background-color: #fff;
}

#viewArboidsSelect option {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
    display: list-item;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.2;
}

#viewArboidsSelect option:hover {
    background-color: #f0f0f0;
}

#viewArboidsSelect option:selected {
    background-color: #2c5aa0;
    color: white;
}

/* Scrollbar personnalisee */
#viewArboidsSelect::-webkit-scrollbar {
    width: 12px;
}

#viewArboidsSelect::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#viewArboidsSelect::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#viewArboidsSelect::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Bouton d'affichage */
#btn_displayData {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background-color: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#btn_displayData:hover {
    background-color: #1e3d6f;
}

#btn_displayData:active {
    background-color: #16324a;
}

/* Instructions */
.view-instructions {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
    font-style: italic;
}

/* Responsive pour selector-viewData */
@media (max-width: 768px) {
    #selector-viewData {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 350px;
    }
}

/* Actions du selecteur viewData */
.viewdata-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

/* =========================================================================
   STYLES COMMUNS POUR LES BOUTONS DU FORMULAIRE VIEWDATA
   ========================================================================= */

.FormButtonStyles {
    pointer-events: auto;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
    font-family: Arial, sans-serif;
    font-size: 12px;
    padding: 3px 3px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #000;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    display: block;
    width: 100%;
}

.FormButtonStyles:hover {
    background-color: #7ae95c;
    color: white;
    border-color: #7ae95c;
}

/* Classe pour masquer completement un element */
.hidden {
    display: none !important;
    visibility: hidden !important;
}
