
/* === NOUVEAU CSS GANTT (basé sur ta maquette) === */
.gantt-container {
    position: relative;
    height: calc(100vh - 120px);
    background: #fff;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === BLOC FIXE (contrôles seulement) === */
.gantt-controls-fixed {
    flex-shrink: 0;
    background: white;
    z-index: 200;
    border-bottom: 2px solid #ddd;
}

/* === BLOC SCROLLABLE (tableau) === */
.gantt-tableau-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
}

.gantt-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* === LÉGENDE === */
.gantt-legend {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}
.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* === TIMELINE (Header) === */
.gantt-timeline-header {
    /* Les styles sont maintenant inline dans buildTimelineHeader() */
    background: white;
}
.gantt-timeline-month {
    /* Position absolue définie inline */
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 12px;
}

/* === CONTENU GANTT (Lignes) === */
.gantt-rows-container {
    min-width: 1200px;
    padding: 0 20px;
}

/* Ligne de culture */
.gantt-culture-row {
    margin-bottom: 5px;
    transition: background 0.2s;
}
.gantt-culture-row:hover {
    background: #fdfdfd;
}
.gantt-culture-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.gantt-culture-label {
    width: 250px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--primary-color, #2c7a31);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 5px;
    position: sticky;
    left: 0;
    background: white;
    z-index: 100;
    border-right: 2px solid #e0e0e0;
}
.gantt-expand-icon {
    font-size: 14px;
    color: var(--primary-color, #2c7a31);
    width: 15px;
    text-align: center;
}
.gantt-culture-info {
    font-size: 11px;
    color: #666;
    font-weight: normal;
}
.gantt-timeline-content {
    flex: 1;
    position: relative;
    height: 70px; /* Augmenté pour 4 niveaux de jalons */
    display: flex;
    align-items: flex-start; /* Alignement en haut pour les niveaux */
}

/* Ligne parcelle (dépliée) */
.gantt-parcelle-row {
    display: none; /* Cachée par défaut */
    margin-left: 20px;
    padding: 2px 0;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}
.gantt-parcelle-row.visible {
    display: flex; /* Visible si 'visible' */
}
.gantt-parcelle-label {
    width: 230px;
    flex-shrink: 0;
    font-size: 12px;
    color: #555;
    padding-left: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    left: 0;
    background: #f8f9fa;
    z-index: 90;
    border-right: 1px solid #e0e0e0;
}
.gantt-parcelle-timeline {
    flex: 1;
    position: relative;
    height: 60px; /* Augmenté pour 4 niveaux de jalons */
    display: flex;
    align-items: flex-start; /* Alignement en haut pour les niveaux */
}

/* === PHASES (Non utilisées pour l'instant) === */
.gantt-phase {
    position: absolute;
    height: 30px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0.8;
}
.gantt-phase.small {
    height: 20px;
    opacity: 0.5;
}

/* === JALONS (Interventions) === */
.gantt-jalon {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    transform: translateX(-8px); /* Centre le jalon */
}
.gantt-jalon:hover {
    transform: translateX(-8px) scale(1.3);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.gantt-jalon.small {
    width: 10px;
    height: 10px;
    border-width: 2px;
    transform: translateX(-5px);
}
.gantt-jalon.small:hover {
    transform: translateX(-5px) scale(1.3);
}

/* Couleurs des jalons */
.gantt-jalon.travail_sol { background: #FFC107; } /* Jaune */
.gantt-jalon.phyto { background: #E53935; } /* Rouge */
.gantt-jalon.fertilisation { background: #66BB6A; } /* Vert */
.gantt-jalon.semis { background: #AB47BC; } /* Violet */
.gantt-jalon.autre { background: #9E9E9E; } /* Gris */
.gantt-jalon.recolte { background: #29B6F6; } /* Bleu clair (récolte) */
.gantt-jalon.semis_interculture { background: #42A5F5; } /* Bleu interculture */

/* === SIDEBAR (Panneau latéral) === */
/* Style récupéré de l'ancien css_gantt.txt et de la maquette */
#ganttSidebar {
    position: fixed;
    right: -400px; /* Caché */
    top: 60px; /* Hauteur du header de l'app */
    width: 400px;
    height: calc(100vh - 60px);
    background: #f8f9fa;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    border-left: 3px solid var(--primary-color, #2c7a31);
}
#ganttSidebar.active {
    right: 0; /* Visible */
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 15px 20px;
    background: white;
    border-bottom: 1px solid #ddd;
}
.sidebar-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-color, #2c7a31);
}
.sidebar-close {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
#sidebarContent {
    padding: 20px;
}
.sidebar-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.sidebar-section h3 {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-color, #2c7a31);
    padding-bottom: 5px;
}
.detail-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}
.detail-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eee;
}
.detail-table td:first-child {
    font-weight: 600;
    color: #666;
    width: 40%;
}


/* === BOUTONS DE ZOOM === */
.zoom-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-weight: 500;
}

.zoom-btn:hover {
    background: #f5f5f5;
    border-color: var(--primary-color, #2c7a31);
}

.zoom-btn.active {
    background: var(--primary-color, #2c7a31);
    color: white;
    border-color: var(--primary-color, #2c7a31);
}


/* === CHIPS CAMPAGNE === */
.campaign-chip {
    padding: 6px 14px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.campaign-chip:hover {
    border-color: var(--primary-color, #2c7a31);
    background: #f5f5f5;
}

.campaign-chip.active {
    background: var(--primary-color, #2c7a31);
    color: white;
    border-color: var(--primary-color, #2c7a31);
}
