/* Comparator Specific Styles */

.comparator-grid {
    display: grid;
    gap: 1rem;
}

.comparator-grid.gap-0 {
    gap: 0;
}

.comparator-grid.grid-cols-2 {
    grid-template-columns: minmax(200px, 250px) minmax(200px, 1fr);
}
.comparator-grid.grid-cols-3 {
    grid-template-columns: minmax(200px, 250px) repeat(2, minmax(200px, 1fr));
}
.comparator-grid.grid-cols-4 {
    grid-template-columns: minmax(200px, 250px) repeat(3, minmax(200px, 1fr));
}
.comparator-grid.grid-cols-5 {
    grid-template-columns: minmax(200px, 250px) repeat(4, minmax(200px, 1fr));
}

/* Simulation cards */
.simulation-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.simulation-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Régime selector */
.regime-selector {
    font-size: 0.875rem;
}

.regime-selector:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* Metric values */
.metric-value {
    font-size: 1.125rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.metric-value.is-best {
    color: #059669;
    position: relative;
}

.metric-value.is-best::after {
    content: "👑";
    position: absolute;
    right: -20px;
    top: 0;
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Metric labels */
.metric-label {
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Position indicators */
.position-indicator {
    background: #3b82f6;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Controls bar */
.controls-bar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comparator-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .simulation-card {
        padding: 0.75rem;
    }

    .metric-value {
        font-size: 1rem;
    }
}

/* Dark mode support */
.dark .simulation-card {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

.dark .controls-bar {
    background: #374151;
    border-color: #4b5563;
}

.dark .metric-label {
    color: #d1d5db;
}

.dark .loading-shimmer {
    background: linear-gradient(90deg, #4b5563 25%, #6b7280 50%, #4b5563 75%);
    background-size: 200% 100%;
}

/* Error states */
.error-value {
    color: #dc2626;
    font-style: italic;
}

/* Success highlighting */
.text-success {
    color: #059669 !important;
    font-weight: 700 !important;
}

/* Modal improvements */
.metrics-modal {
    backdrop-filter: blur(4px);
}

/* Button improvements */
.btn-comparator {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-comparator:hover {
    background: #2563eb;
}

.btn-comparator:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Scrollbar styling for horizontal scroll */
.overflow-x-auto::-webkit-scrollbar {
    height: 8px;
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Metric Row Bubbles - toute la ligne dans une bulle */
.metric-row-bubble {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Gradient backgrounds for metric rows by color */
.metric-row-bubble.bg-gradient-cyan {
    background: linear-gradient(to right, rgb(6, 182, 212), rgb(34, 211, 238));
}

.metric-row-bubble.bg-gradient-violet {
    background: linear-gradient(to right, rgb(139, 92, 246), rgb(167, 139, 250));
}

.metric-row-bubble.bg-gradient-blue {
    background: linear-gradient(to right, rgb(59, 130, 246), rgb(96, 165, 250));
}

.metric-row-bubble.bg-gradient-green {
    background: linear-gradient(to right, rgb(16, 185, 129), rgb(52, 211, 153));
}

/* Séparateur entre catégories */
.category-separator {
    height: 2rem;
    margin: 0.5rem 0;
}

/* Wrapper pour annuler l'espace des sous-métriques */
.metric-wrapper-sub {
    margin-top: 0 !important;
    padding-top: 0.25rem;
}

/* Sous-métriques */
.metric-row-bubble.sub-metric {
    margin-left: 2rem;
    margin-top: 0.25rem !important;
    opacity: 0.95;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.metric-row-bubble.sub-metric .font-semibold {
    font-weight: 500;
    font-size: 0.95em;
}

/* Dernière sous-métrique d'un groupe - ajouter de l'espace après */
.metric-row-bubble.last-sub-metric {
    margin-bottom: 0.75rem !important;
}

.metric-row-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.metric-row-bubble.sub-metric:hover {
    transform: translateY(-2px) translateX(4px);
}

/* Cells inside the row */
.metric-value-cell {
    padding: 0.25rem 0.25rem;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

/* Best value cell - fond vert très clair et subtil */
.metric-value-best {
    background: rgba(134, 239, 172, 0.25);
    border-radius: 12px;
    margin: -0.75rem 0.75rem;
    padding: 1.5rem 0.5rem;
}

/* Text color adjustments for best value */
.metric-value-best .text-xl {
    color: #059669;
    font-weight: 800;
}

.metric-value-best .text-sm {
    color: #059669;
}

/* Dark mode support for bubbles */
.dark .metric-row-bubble {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

/* Dark mode - Gradient backgrounds for metric rows by color */
.dark .metric-row-bubble.bg-gradient-cyan {
    background: linear-gradient(to right, rgb(8, 145, 178), rgb(6, 182, 212));
}

.dark .metric-row-bubble.bg-gradient-violet {
    background: linear-gradient(to right, rgb(109, 40, 217), rgb(139, 92, 246));
}

.dark .metric-row-bubble.bg-gradient-blue {
    background: linear-gradient(to right, rgb(29, 78, 216), rgb(59, 130, 246));
}

.dark .metric-row-bubble.bg-gradient-green {
    background: linear-gradient(to right, rgb(5, 150, 105), rgb(16, 185, 129));
}

.dark .metric-row-bubble:hover {
    background: #4b5563;
}

/* Dark mode - Override hover for gradient bubbles */
.dark .metric-row-bubble.bg-gradient-cyan:hover {
    background: linear-gradient(to right, rgb(14, 165, 233), rgb(34, 211, 238));
}

.dark .metric-row-bubble.bg-gradient-violet:hover {
    background: linear-gradient(to right, rgb(124, 58, 237), rgb(167, 139, 250));
}

.dark .metric-row-bubble.bg-gradient-blue:hover {
    background: linear-gradient(to right, rgb(37, 99, 235), rgb(96, 165, 250));
}

.dark .metric-row-bubble.bg-gradient-green:hover {
    background: linear-gradient(to right, rgb(16, 185, 129), rgb(52, 211, 153));
}

.dark .metric-value-best {
    background: rgba(134, 239, 172, 0.2);
}

.dark .metric-value-best .text-xl,
.dark .metric-value-best .text-sm {
    color: #86efac;
}

/* Dark mode support for sub-metrics */
.dark .metric-row-bubble.sub-metric {
    border-left-color: rgba(255, 255, 255, 0.15);
}

/* Modal styles */
.dark .bg-white {
    background: #374151 !important;
    color: white;
}

.dark .text-gray-600 {
    color: #d1d5db;
}

.dark .text-gray-500 {
    color: #9ca3af;
}

.dark .hover\:bg-gray-50:hover {
    background-color: #4b5563 !important;
}

.dark .border-gray-200 {
    border-color: #4b5563;
}
