/* Timeline Styles */
.timeline-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: rgba(20, 20, 30, 0.98);
    backdrop-filter: blur(10px);
    transition: height 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
}

.timeline-panel.active {
    height: 300px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #8B008B 0%, #4B0082 100%);
    color: white;
    position: relative;
}

.timeline-header h3 {
    margin: 0;
    font-size: 18px;
}

.timeline-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.timeline-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Switch de mode */
.timeline-mode-switch {
    display: flex;
    gap: 10px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 15px;
}

.timeline-mode-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.7);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.timeline-mode-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.timeline-mode-btn.active {
    background: rgba(255,255,255,0.3);
    border-color: white;
    color: white;
    font-weight: bold;
}

.timeline-content {
    height: calc(100% - 60px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px;
}

/* === CHRONOLOGIE DU CHANTIER === */
.timeline-container {
    position: relative;
    min-width: 800px;
    height: 100%;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: translateY(-50%);
}

.timeline-events {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.timeline-event {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s;
}

.timeline-event:hover {
    transform: scale(1.1);
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
    border: 3px solid white;
}

.timeline-event.general .timeline-marker {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.timeline-event.technical .timeline-marker {
    background: linear-gradient(135deg, #4a90e2, #357abd);
}

.timeline-event.response .timeline-marker {
    background: linear-gradient(135deg, #28a745, #218838);
}

.timeline-event.admin .timeline-marker {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.timeline-label {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.timeline-date {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: #ccc;
    font-size: 11px;
    white-space: nowrap;
}

/* === TIMELINE DES VERSIONS MENSUELLES === */
.versions-timeline-container {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px 0;
}

.versions-timeline-line {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 4px;
    background: linear-gradient(90deg, 
        #4facfe 0%, 
        #00f2fe 50%, 
        #43e97b 100%);
    transform: translateY(-50%);
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(79, 172, 254, 0.3);
}

.versions-timeline-items {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    padding: 0 40px;
    gap: 30px;
    overflow-x: auto;
}

.version-item {
    flex: 0 0 auto;
    position: relative;
}

.version-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    min-width: 200px;
    max-width: 250px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.version-item.active .version-card {
    background: rgba(255, 255, 255, 0.15);
    border-color: #4facfe;
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.3);
}

.version-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.version-date {
    font-size: 12px;
    color: #4facfe;
    margin-bottom: 8px;
    font-weight: bold;
}

.version-title {
    font-size: 14px;
    color: white;
    font-weight: bold;
    margin-bottom: 8px;
}

.version-description {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 12px;
}

.version-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
    font-size: 11px;
    color: #aaa;
}

.version-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.version-progress {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 10px;
    color: #aaa;
    display: block;
    text-align: center;
}

/* Tooltip */
.timeline-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 15px;
    border-radius: 8px;
    max-width: 300px;
    z-index: 2000;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.timeline-tooltip.visible {
    display: block;
}

.timeline-tooltip-title {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timeline-tooltip-meta {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 8px;
}

.timeline-tooltip-content {
    font-size: 13px;
    line-height: 1.4;
}

.timeline-tooltip-attachments {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 12px;
    color: #8b9dc3;
}

/* Filtres de timeline */
.timeline-filters {
    position: absolute;
    top: 15px;
    right: 60px;
    display: flex;
    gap: 10px;
}

.timeline-filter {
    padding: 5px 10px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.timeline-filter:hover {
    background: rgba(255,255,255,0.3);
}

.timeline-filter.active {
    background: rgba(255,255,255,0.4);
    border-color: white;
}

/* Animation */
@keyframes timelinePulse {
    0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.timeline-event.new .timeline-marker {
    animation: timelinePulse 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-panel.active {
        height: 250px;
    }
    
    .timeline-container {
        min-width: 600px;
    }
    
    .timeline-mode-switch {
        flex-direction: column;
        gap: 5px;
    }
    
    .timeline-mode-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
}