/* Styles spécifiques pour la popup parcelle */
.maplibregl-popup.parcelle-container .maplibregl-popup-content {
    width: 100% !important;
    height: 100% !important;
    min-height: 370px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    display: flex !important; /* Ajout d'un display flex */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Structure flex pour la popup */
.parcelle-popup {
    min-width: 300px;
    max-width: 400px;
    font-family: system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 410px;
}

/* Header fixe */
.parcelle-popup .popup-header {
    flex-shrink: 0;
    background: #e63946;
    min-height: 38px;
    padding: 8px 12px 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.parcelle-popup .header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

/* Système de tabs avec défilement */
.parcelle-popup .tabs-scroll-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 4px;
    min-width: 0;
}

/* Style des boutons de navigation */
.parcelle-popup .tab-nav-button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
    z-index: 2;
}

.parcelle-popup .tab-nav-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.parcelle-popup .tab-nav-button:disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Conteneur avec défilement masqué */
.parcelle-popup .popup-tabs {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-grow: 1;
    min-width: 0;
}

/* Zone de défilement des onglets */
.parcelle-popup .tabs-scroll {
    display: flex;
    gap: 1px;
    transition: transform 0.3s ease;
}

/* Style des onglets */
.parcelle-popup .tab-button {
    padding: 5px 5px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    min-width: 42px;
    font-family: inherit;
}

.parcelle-popup .tab-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.parcelle-popup .tab-button.active {
    background: white;
    color: #e63946;
}

.parcelle-popup .tab-button.info-tab {
    padding: 4px 8px;
    min-width: unset;
}

.parcelle-popup .info-tab svg {
    stroke: currentColor;
    width: 14px;
    height: 14px;
}

/* Contenu scrollable */
.parcelle-popup .popup-content {
    flex: 1;
    overflow-y: auto;
    background: white;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Sections */
.parcelle-popup .popup-section {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.parcelle-popup .popup-section:last-child {
    border-bottom: none;
}

.parcelle-popup .popup-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grille de métriques */
.parcelle-popup .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Boîtes de métriques */
.parcelle-popup .metric-box {
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.15s ease;
}

.parcelle-popup .metric-box:hover {
    background-color: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.parcelle-popup .metric-value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.parcelle-popup .metric-label {
    font-size: 11px;
    color: #64748b;
    line-height: 1.2;
}

/* Sous-sections */
.parcelle-popup .subsection {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.parcelle-popup .subsection:last-child {
    border-bottom: none;
}

.parcelle-popup .subsection h4 {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Message pas de données */
.parcelle-popup .no-data {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 24px 16px;
    margin: 0;
}

/* Contenu des onglets */
.parcelle-popup .tab-content {
    display: none;
}

.parcelle-popup .tab-content.active {
    display: block;
}

/* Animation des transitions */
.parcelle-popup .tab-content.active {
    animation: fadeIn 0.2s ease-in-out;
}

/* Styles pour la section d'analyse */
.parcelle-popup .analyze-date-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.parcelle-popup .analyze-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
    margin-top: 10px;
    max-height: 120px;
    overflow-y: auto;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 8px;
    border-radius: 4px;
}

.parcelle-popup .analyze-text:hover {
    background-color: #f3f4f6;
}

/* Modal plein écran */
.comment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 24px;
}

.comment-modal.active {
    opacity: 1;
    visibility: visible;
}

.comment-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.comment-modal.active .comment-modal-content {
    transform: translateY(0);
    opacity: 1;
}

.comment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.comment-modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    line-height: 1.4;
}

/* Style du bouton de fermeture défini dans popup.css */

.comment-modal-body {
    padding: 24px 32px;
    font-size: 18px;
    line-height: 1.8;
    color: #2d3748;
    overflow-y: auto;
    max-height: calc(90vh - 90px);
    white-space: pre-line;
    letter-spacing: 0.3px;
    font-family: "Segoe Print", "Quicksand", "Avenir", "Trebuchet MS", system-ui, sans-serif;
    font-weight: 400;
}

.comment-modal-signature {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    font-family: "Segoe Script", "Brush Script MT", "Bradley Hand", cursive;
    font-size: 26px;
    color: #1f2937;
    text-align: right;
    padding-right: 20px;
    font-weight: 500;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustements responsifs */
@media (max-width: 360px) {
    .parcelle-popup {
        min-width: 280px;
    }

    .parcelle-popup .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .parcelle-popup .metric-box {
        padding: 8px;
    }
    
    .parcelle-popup .popup-section,
    .parcelle-popup .subsection {
        padding: 12px;
    }

    .parcelle-popup .tab-button {
        padding: 4px 8px;
        min-width: 40px;
        font-size: 12px;
    }
}

@media (max-width: 640px) {
    .comment-modal {
        padding: 16px;
    }

    .comment-modal-content {
        max-height: 95vh;
    }

    .comment-modal-header {
        padding: 16px;
    }

    .comment-modal-title {
        font-size: 18px;
    }

    .comment-modal-body {
        padding: 16px;
        font-size: 15px;
        max-height: calc(95vh - 80px);
    }
    
    .comment-modal-signature {
        font-size: 22px;
        margin-top: 24px;
        padding-top: 12px;
    }
}

/* Tooltips et états actifs */
.parcelle-popup .tab-nav-button:disabled:hover::after {
    content: "Fin du défilement";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    margin-top: 4px;
}

/* Amélioration du contraste et de la lisibilité */
.comment-modal-body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Style du scrollbar pour le modal */
.comment-modal-body::-webkit-scrollbar {
    width: 10px;
}

.comment-modal-body::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 5px;
}

.comment-modal-body::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 5px;
    border: 2px solid #f7fafc;
}

.comment-modal-body::-webkit-scrollbar-thumb:hover {
    background-color: #a0aec0;
}

/* Fix pour les espaces blancs */
.parcelle-popup .tabs-scroll {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Header content */
.parcelle-popup .header-content h3 {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ombre sur le contenu principal */
.parcelle-popup .popup-content {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}






.parcelle-popup .info-row {
    display: flex;

}

.parcelle-popup .info-row:last-child {
    margin-bottom: 0;
}

.parcelle-popup .info-row .label {
    flex: 0 0 100px;
    font-weight: 500;
    color: #7d8da9;
}

.parcelle-popup .info-row .farm {
    font-weight: 500;
    color: #7d8da9;
}

.parcelle-popup .info-row .value {
    flex-grow: 1;
    color: #2d3748;
    padding-left: 6px;
}




/* Style pour le conteneur du bouton rapport */
.parcelle-popup .report-button-container {
    padding: 8px 16px 4px;
    display: flex;
    justify-content: center;
}

/* Style pour le bouton de rapport */
.parcelle-popup .report-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #F1F5F9; 
    color: #1E293B;
    border-radius: 4px;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    width: auto;
    min-width: 150px;
}

.parcelle-popup .report-button:hover {
    background-color: #067278; 
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.parcelle-popup .report-button:active {
    transform: translateY(0px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.parcelle-popup .report-button svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
