/* ===== PROFILING STYLES ===== */

/* Chart Container */
.chart-container.interactive {
    cursor: crosshair;
    position: relative;
    min-height: 450px;
}

.chart-container.interactive svg {
    width: 100%;
    height: 100%;
}

/* Cluster Legend */
.cluster-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-item.active {
    border-color: #4f46e5;
    background: #f0f4ff;
}

/* Student Selector */
.student-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    max-height: 120px;
    overflow-y: auto;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.student-card {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.student-card:hover {
    border-color: #dad9f1;
    background: #f0f4ff;
    color :white;
}

.student-card.selected {
    background: #c9c8e2;
    color: white;
    border-color: #4f46e5;
}

.student-info {
    display: flex;
    justify-content: space-between;
}

.student-name {
    font-weight: 500;
}

.student-depression {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: #fee2e2;
    color: #dc2626;
}

.student-depression.depressed {
    background: #dcfce7;
    color: #16a34a;
}

/* Cluster Stats */
.cluster-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #4f46e5;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
}

.cluster-id-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cluster-risk-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.cluster-risk-badge.low {
    background: #dcfce7;
    color: #16a34a;
}

.cluster-risk-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.cluster-risk-badge.high {
    background: #fee2e2;
    color: #dc2626;
}

/* Small Multiples */
.small-multiples {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.small-chart {
    height: 500px;
    background: white;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e2e8f0;
}

/* Outliers Container */
.outliers-container {
    display: flex;
    flex-direction: row;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    justify-content: center;
    
}

.large-heatmap {
    overflow: visible !important;
}
.outlier-card {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
    
}

.outlier-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.outlier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.outlier-id {
    font-weight: 600;
    color: #1e293b;
}

.outlier-score {
    padding: 4px 8px;
    background: #fef3c7;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #d97706;
}

.outlier-reason {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 8px;
    line-height: 1.4;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

.action-plan-item {
    padding: 15px;
    margin: 10px 0;
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    border-radius: 6px;
}

.action-plan-item.high-priority {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Control Buttons */
.control-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.control-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.control-btn.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .small-multiples {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .profiles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .small-multiples {
        grid-template-columns: 1fr;
    }
    
    .cluster-stats {
        grid-template-columns: 1fr;
    }
    
    .chart-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .control-btn, select {
        width: 100%;
    }
}
/* Styles pour le scatter plot */
.scatter-plot-svg {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 8px;
}

.data-point {
    cursor: pointer;
    transition: r 0.3s ease, opacity 0.3s ease, fill 0.3s ease;
}

.data-point:hover {
    r: 8px !important;
    opacity: 1 !important;
    stroke: #1e293b !important;
    stroke-width: 2px !important;
}

.scatter-tooltip {
    min-width: 200px;
    max-width: 300px;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

.x-axis-label, .y-axis-label {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.chart-title {
    font-weight: 600;
    fill: #1e293b;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Animation pour le changement de projection */
.data-point {
    transition: cx 0.75s cubic-bezier(0.34, 1.56, 0.64, 1), 
                cy 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Effet 3D */
.data-point[data-3d="true"] {
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

/* Boutons actifs */
.control-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* Légende améliorée */
.cluster-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: white;
    border-radius: 20px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.legend-item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.legend-item.active {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Select stylisés */
.chart-controls select {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.chart-controls select:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(148, 163, 184, 0.2);
}

.chart-controls select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Student Selector amélioré */
.student-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-height: 280px; /* Plus grand pour voir plus d'étudiants */
    overflow-y: auto;
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
}

.student-card {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.student-card:hover {
    border-color: #4f46e5;
    background: #f0f4ff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
}

.student-card.selected {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: white;
    border-color: #4f46e5;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.student-card.selected .student-name {
    color: white !important;
}

.student-card.selected .student-info {
    color: rgba(255, 255, 255, 0.9) !important;
}

.student-header {
    margin-bottom: 10px;
}

.student-name {
    color: #1e293b;
    font-weight: 600;
    font-size: 1rem;
}

.student-depression-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.student-depression-badge.depressed {
    background: #fee2e2;
    color: #dc2626;
}

.student-depression-badge.healthy {
    background: #dcfce7;
    color: #16a34a;
}

.student-card.selected .student-depression-badge.depressed {
    background: rgba(220, 38, 38, 0.2);
    color: white;
}

.student-card.selected .student-depression-badge.healthy {
    background: rgba(22, 163, 74, 0.2);
    color: white;
}

.student-info {
    color: #64748b;
    line-height: 1.5;
}

/* Scrollbar personnalisée */
.student-selector::-webkit-scrollbar {
    width: 8px;
}

.student-selector::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.student-selector::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.student-selector::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Résumé Étudiant */
.student-summary {
    margin: 15px 0;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.student-detail-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.detail-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 18px;
}

.detail-status {
    display: flex;
    gap: 10px;
    align-items: center;
}

.depression-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.depression-status.depressed {
    background: #fee2e2;
    color: #dc2626;
}

.depression-status.healthy {
    background: #dcfce7;
    color: #16a34a;
}

.risk-badge {
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.stat-value.cluster-value {
    color: #4f46e5;
}

.comparisons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.comparison-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}

.comparison-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
}

.comparison-feature {
    color: #475569;
    font-weight: 500;
}

.comparison-value {
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.comparison-value.higher {
    background: #fef3c7;
    color: #92400e;
}

.comparison-value.lower {
    background: #dbeafe;
    color: #1e40af;
}

/* css/radar.css */
.radar-svg {
    width: 100%;
    height: 100% !important;
    display: block;
}

.radar-area {
    transition: opacity 0.3s ease;
}

.radar-area:hover {
    opacity: 0.8;
}

.radar-point {
    transition: r 0.3s ease;
}

.radar-point:hover {
    r: 6px !important;
    cursor: pointer;
}

.radar-label {
    user-select: none;
    pointer-events: none;
}

.radar-circle-grid {
    stroke-dasharray: 3,3;
}

.radar-axis {
    stroke-dasharray: 2,2;
}

.radar-title {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.radar-legend text {
    font-size: 12px;
    fill: #64748b;
}

.radar-level-label {
    font-size: 10px;
    fill: #94a3b8;
}
.radar-svg g {
    transform-origin: center;
}
/* css/heatmap.css - Styles pour la légende */

/* Styles de base pour la heatmap */
.heatmap-svg {
    font-family: 'Inter', sans-serif;
}

.heatmap-cell {
    transition: stroke 0.2s ease;
}

.heatmap-cell:hover {
    stroke: #1e293b !important;
    stroke-width: 2px !important;
    cursor: pointer;
}

/* Légende des couleurs */
.color-legend {
    pointer-events: none;
}

.legend-title {
    font-weight: 500;
    fill: #475569;
}

.legend-label {
    fill: #64748b;
}

/* Version compacte de la légende */
.compact-color-legend {
    pointer-events: none;
}

/* Tooltip amélioré */
.heatmap-tooltip {
   position: absolute !important;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    font-family: 'Inter', sans-serif !important;
    padding: 12px !important;
    max-width: 250px !important;
    z-index: 9999 !important; /* Augmentez le z-index */
    pointer-events: none !important;
    opacity: 0; /* Initialement caché */
    transition: opacity 0.2s ease !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
}

.heatmap-tooltip div {
    margin-bottom: 5px !important;
}
.heatmap-tooltip strong {
    color: #1e293b !important;
    font-weight: 600 !important;
}

/* 3. Flèche du tooltip */
.heatmap-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: white;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    z-index: 9998;
}

/* 4. S'assurer que le conteneur de la heatmap permet le débordement */
#cluster-heatmap {
    overflow: visible !important; /* IMPORTANT: permet au tooltip de sortir */
    position: relative;
}
.heatmap-cell {
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
    cursor: pointer;
}

.heatmap-cell:hover {
    stroke: #4f46e5 !important;
    stroke-width: 2px !important;
}

/* 6. Assurer que le SVG n'a pas d'overflow caché */
.heatmap-svg {
    overflow: visible !important;
}
.heatmap-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* Labels */
.x-label, .y-label {
    font-weight: 500;
    fill: #475569;
}

.heatmap-title {
    font-weight: 600;
    fill: #1e293b;
}

.bubble-chart {
    width: 100%;
    
    background: #f8fafc;
    border-radius: 8px;
    position: relative;
}

.bubble-tooltip {
    position: absolute;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    max-width: 300px;
    border: 1px solid #e5e7eb;
}

.bubble-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.bubble-node:hover {
    stroke: #000;
    stroke-width: 2px;
    filter: brightness(1.1);
}

.bubble-label {
    font-size: 12px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    fill: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.cluster-stats {
    margin-top: 10px;
    font-size: 11px;
    color: #666;
}

.cluster-stats div {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}

.legend-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 8px;
}

.risk-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.risk-high {
    background: #dc2626;
    color: white;
}

.risk-medium {
    background: #f59e0b;
    color: white;
}

.risk-low {
    background: #16a34a;
    color: white;
}

#cluster-detail-section {
    margin-top: 30px;
    animation: fadeInUp 0.6s ease-out;
}

.cluster-detail-view {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

/* Animation d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltips pour la vue détaillée */
.cluster-detail-view .tooltip {
    position: absolute;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 300px;
}

/* Effets de hover sur les éléments SVG */
.cluster-detail-view svg g:hover {
    opacity: 1 !important;
}

.cluster-detail-view rect {
    transition: all 0.3s ease;
}

.cluster-detail-view text {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Boutons d'action dans le footer */
.cluster-detail-view .action-button {
    cursor: pointer;
    transition: all 0.2s ease;
}

.cluster-detail-view .action-button:hover rect {
    fill: rgba(255, 255, 255, 0.3) !important;
}

.cluster-detail-view .action-button:active {
    transform: scale(0.95);
}

/* Responsive pour petits écrans */
@media (max-width: 1200px) {
    #cluster-detail-container {
        min-height: 600px !important;
    }
    
    #cluster-detail-container svg {
        width: 100% !important;
        height: auto !important;
    }
}

/* Amélioration de la lisibilité */
.cluster-detail-view svg text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animation des barres */
.cluster-detail-view rect.animated-bar {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Highlights au survol */
.cluster-detail-view .hoverable:hover {
    filter: brightness(1.1);
    cursor: pointer;
}
/* Styles pour le bouton d'explication et son conteneur */
.explanation-btn-container {
    display: inline-flex;
    align-items: center;
    margin: 0 5px;
    height: 100%;
}

.comment-button {
    background: #000000;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
    height: 36px; /* Hauteur similaire aux selects */
    min-width: 36px; /* Largeur minimale pour un carré */
}

.comment-button:hover {
    background: #374151;
    transform: translateY(-1px);
}

.comment-button:active {
    transform: translateY(0);
}

/* Ajuster les selects pour qu'ils aient la même hauteur */
.chart-controls select {
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

/* Positionnement de la boîte d'explication */
.chart-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-box {
    position: absolute;
    z-index: 1000; /* Augmenter le z-index pour être au-dessus */
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
    display: none;
    top: 45px; /* Positionner sous le bouton */
    right: 0; /* Aligner à droite du conteneur parent */
}

/* Assurer que la boîte d'explication s'affiche correctement */
.chart-card.large {
    position: relative;
}

.comment-box.show {
    display: block;
}


/* Styles pour la table des couleurs */
.color-table-section {
    margin-top: 20px;
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
}

.color-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    cursor: pointer;
    user-select: none;
}

.color-table-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-color-table {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.toggle-color-table:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.color-table-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.color-table-container::-webkit-scrollbar {
    width: 6px;
}

.color-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.color-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.color-table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.color-scheme-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.color-scheme-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.color-scheme-card.active {
    border-color: #4f46e5;
    background: #f8fafc;
}

.color-scheme-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.color-scheme-icon {
    font-size: 16px;
}

.color-scheme-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

.color-scheme-status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #dcfce7;
    color: #166534;
}

.color-scheme-status.active {
    background: #4f46e5;
    color: white;
}

.color-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.color-sample {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.color-label {
    font-size: 11px;
    color: #4b5563;
    flex: 1;
}

.color-value {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
}

/* Animation pour la table */
.color-table-container.collapsed {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.color-table-container.expanded {
    animation: expandTable 0.3s ease-out;
}

@keyframes expandTable {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 300px;
        opacity: 1;
    }
}

/* Styles spécifiques pour les différents schémas de couleur */
.color-sample.cluster-1 { background-color: #4E79A7 !important; }
.color-sample.cluster-2 { background-color: #F28E2C !important; }
.color-sample.cluster-3 { background-color: #E15759 !important; }
.color-sample.cluster-4 { background-color: #76B7B2 !important; }
.color-sample.cluster-5 { background-color: #59A14F !important; }
.color-sample.cluster-6 { background-color: #EDC949 !important; }
.color-sample.cluster-7 { background-color: #AF7AA1 !important; }
.color-sample.cluster-8 { background-color: #FF9DA7 !important; }


/* Styles pour la description de la heatmap */
.cluster-analysis-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.heatmap-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#cluster-heatmap {
    flex: 1;
    min-height: 550px;
}

.heatmap-description {
    flex: 0 0 300px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4f46e5;
}

.description-header h4 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
    font-weight: 600;
}

.info-icon {
    font-size: 14px;
    opacity: 0.6;
}

.description-content {
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
}

.description-points {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.point {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #4f46e5;
}

.point-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.description-insights {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.description-insights h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #1e293b;
}

.description-insights ul {
    margin: 10px 0;
    padding-left: 20px;
}

.description-insights li {
    margin-bottom: 5px;
    font-size: 12px;
}

.example {
    margin-top: 15px;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    font-size: 12px;
}

.example p {
    margin: 5px 0 0 0;
    font-style: italic;
}

/* Styles pour la description du sunburst */
.sunburst-description {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.description-main {
    margin-bottom: 25px;
}

.visual-guide {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.guide-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.guide-text {
    flex: 1;
    font-size: 13px;
}

.subtext {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.description-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.action-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.action-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.action-text {
    font-size: 12px;
}

.interpretation-guide {
    margin: 25px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #4f46e5;
}

.interpretation-guide h5 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #1e293b;
}

.interpretation-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.point {
    display: flex;
    gap: 12px;
}

.point-number {
    width: 24px;
    height: 24px;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.point-content {
    flex: 1;
    font-size: 13px;
    padding-top: 2px;
}

.insight-example {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 8px;
    border: 1px solid #10b981;
    margin-top: 20px;
}

.insight-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.insight-text {
    font-size: 13px;
    color: #065f46;
}

/* Responsive design */
@media (max-width: 1200px) {
    .heatmap-section {
        flex-direction: column;
    }
    
    .heatmap-description {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .description-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .heatmap-description,
    .sunburst-description {
        padding: 15px;
    }
    
    .guide-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .action-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .insight-example {
        flex-direction: column;
        gap: 10px;
    }
}

