/* =====================================================
   Benchmark IA - Styles
   Design professionnel inspire de Bootstrap 5
   ===================================================== */

/* Accessibilité / SEO : texte visible pour les lecteurs d'écran et Google, caché visuellement */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--dark);
    background: var(--body-bg);
    -webkit-font-smoothing: antialiased;
}

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #0d6efd;
    --primary-hover: #0b5ed7;
    --primary-light: rgba(13, 110, 253, 0.1);
    --success: #198754;
    --success-hover: #157347;
    --warning: #ffc107;
    --warning-hover: #e0a800;
    --danger: #dc3545;
    --brand-red: #CD1528;
    --danger-hover: #bb2d3b;
    --info: #0dcaf0;
    --light: #f8f9fa;
    --dark: #212529;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    /* Fond des cellules de tableaux (modifiable facilement pour ajuster) */
    --table-cell-bg: var(--gray-100);
    --border-radius: 0.5rem;
    --border-radius-sm: 0.375rem;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.15s ease-in-out;
    --sidebar-width: 240px;
    --navbar-height: 60px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

code {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
    padding: 0.15em 0.4em;
    background: var(--gray-100);
    border-radius: 3px;
    color: var(--danger);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-fluid {
    padding: 0 1.25rem;
}

.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - var(--navbar-height) - 80px);
}

/* ===== UTILITIES ===== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { display: flex; flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-600); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* ===== NAVBAR ===== */
.navbar {
    background: #CD1528;
    border-bottom: none;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(139, 26, 43, 0.15);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    letter-spacing: -0.02em;
}

.navbar .btn-outline {
    color: #faf0ec;
    border-color: rgba(255,255,255,0.3);
}

.navbar .btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

.navbar .btn-primary {
    background: #9b8574;
    border-color: #9b8574;
    color: #fff;
}

.navbar .btn-primary:hover {
    background: #8a7463;
    border-color: #8a7463;
}

.navbar .btn-success {
    background: #c9a96e;
    border-color: #c9a96e;
    color: #fff;
}

.navbar .btn-success:hover {
    background: #b8985d;
    border-color: #b8985d;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-separator {
    color: rgba(255,255,255,0.3);
    font-weight: 300;
    margin-left: 0.75rem;
}

.navbar-user {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: var(--success-hover); border-color: var(--success-hover); color: #fff; }

.btn-warning {
    background: var(--warning);
    color: var(--dark);
    border-color: var(--warning);
}
.btn-warning:hover { background: var(--warning-hover); border-color: var(--warning-hover); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border-color: var(--border-color);
}
.btn-outline:hover { background: var(--gray-100); color: var(--dark); }

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 0.875rem 1.25rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.875rem 1.25rem;
    background: var(--gray-100);
    border-top: 1px solid var(--border-color);
}

/* ===== TABLES ===== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background: var(--gray-100);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 0.875rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    color: var(--gray-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: top;
}

.table td {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--primary-light);
}

.table .th-category,
.table .td-category {
    max-width: 250px;
    width: 250px;
    font-weight: 500;
    word-wrap: break-word;
    white-space: normal;
}

.table .th-ai {
    text-align: center;
    min-width: 100px;
    width: 100px;
    vertical-align: bottom;
    padding-bottom: 0.75rem;
}

.table .td-score {
    text-align: center;
    white-space: nowrap;
    width: 100px;
}

.td-score-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 50px;
}

.td-score-inner .info-slot {
    display: inline-block;
    width: 16px;
    text-align: center;
}

/* Colonnes IA : largeur auto pour respecter display:none */
#comparison-table,
.use-cases-table {
    table-layout: auto;
    width: auto;
}

#comparison-table .th-category,
#comparison-table .td-category,
.use-cases-table .th-category,
.use-cases-table .td-category {
    width: 250px;
    max-width: 250px;
    overflow-wrap: break-word;
}

.td-actions {
    white-space: nowrap;
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

/* ===== SCORES ===== */
.score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1;
}

.score-5 { background: #198754; color: #fff; }
.score-4 { background: #20c997; color: #fff; }
.score-3 { background: #ffc107; color: var(--dark); }
.score-2 { background: #fd7e14; color: #fff; }
.score-1 { background: #dc3545; color: #fff; }
.score-none { background: var(--gray-200); color: var(--gray-500); }
.score-na { background: var(--gray-400); color: #fff; font-size: 0.6rem; }

/* ===== AI HEADER ===== */
.ai-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.ai-name {
    font-weight: 600;
    font-size: 0.8rem;
}

.ai-model {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 400;
}

/* ===== INFO ICON (commentaires) ===== */
.info-icon {
    position: relative;
    display: inline-block;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--primary);
    margin-left: 0.25rem;
    vertical-align: middle;
}

/* ===== TABLE LEGEND ===== */
.table-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-600);
    align-items: center;
}

.table-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.config-icon-legend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: var(--brand-red);
}

/* ===== SCOPE BADGE (T=Transversal, M=Metier) ===== */
.scope-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    margin-right: 0.4rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.scope-badge-t {
    background: var(--primary);
}

.scope-badge-m {
    background: var(--brand-red);
}

.config-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: var(--brand-red);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-left: 0.3rem;
    vertical-align: middle;
    font-style: italic;
}

.comment-popin {
    position: fixed;
    z-index: 200;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    min-width: 320px;
    max-width: 750px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.popin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.popin-table thead th {
    background: var(--gray-100);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--gray-600);
    padding: 0.4rem 0.6rem;
    border-bottom: 2px solid var(--gray-300);
    text-align: left;
    white-space: nowrap;
}

.popin-table tbody td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
    line-height: 1.4;
}

.popin-table tbody tr:last-child td {
    border-bottom: none;
}

.popin-col-author {
    max-width: 250px;
    width: 150px;
    overflow-wrap: break-word;
    font-weight: 500;
    color: var(--gray-700);
}

.popin-col-score {
    width: 50px;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
}

.popin-col-comment {
    max-width: 250px;
    overflow-wrap: break-word;
    color: var(--gray-600);
}

.popin-col-usecase {
    max-width: 250px;
    overflow-wrap: break-word;
    color: var(--gray-700);
    font-style: italic;
}

.popin-loading, .popin-empty, .popin-error {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin: 0;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--dark);
    background: var(--card-bg);
    border: 1px solid var(--gray-400);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control-sm {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
    border-color: #ffecb5;
}

.alert-info {
    background: #cff4fc;
    color: #055160;
    border-color: #b6effb;
}

/* ===== HERO BANNER ===== */
.hero-banner {
    background: linear-gradient(135deg, #faf8f6 0%, #f5f0ec 50%, #f0eae4 100%);
    border-bottom: 3px solid #CD1528;
    padding: 1.25rem 0;
    margin-bottom: 0;
}

.hero-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.hero-logo img {
    display: block;
    width: 200px;
    height: auto;
    object-fit: contain;
}

.hero-center {
    text-align: center;
    flex: 1;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #CD1528;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.hero-title-accent {
    color: #9b8574;
    font-weight: 800;
}

.hero-subtitle {
    color: #9b8574;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ===== FILTERS ===== */
/* ===== BANDEAU PARTICIPATIF ===== */
.participate-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #fff5f5 0%, #fef0f0 100%);
    border-left: 4px solid var(--brand-red);
    border-radius: var(--border-radius);
    padding: 0.9rem 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.participate-banner .participate-icon {
    font-size: 1.4rem;
    color: var(--brand-red);
    flex-shrink: 0;
}

.participate-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.4;
}

.participate-banner a {
    color: var(--brand-red);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

.participate-banner a:hover {
    color: #a8111f;
}

.filters-section {
    margin-bottom: 1.5rem;
}

.filters-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.filter-search {
    flex: 1;
    position: relative;
}

.filter-search::before {
    content: '\1F50D';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

.filter-search .form-control {
    padding-left: 2.2rem;
}

/* ===== ACCORDION FILTER ===== */
.filter-accordion {
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.5rem;
}

.filter-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: background 0.15s ease;
    border-radius: var(--border-radius);
}

.filter-accordion-header:hover {
    background: var(--gray-200);
}

.filter-accordion-header .filter-count {
    font-weight: 600;
    color: var(--brand-red);
    font-size: 0.8rem;
}

.filter-accordion-header .accordion-arrow {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    color: var(--gray-400);
}

.filter-accordion.open .accordion-arrow {
    transform: rotate(180deg);
}

.filter-accordion-body {
    display: none;
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid var(--gray-200);
}

.filter-accordion.open .filter-accordion-body {
    display: block;
}

.ai-selector {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.ai-selector-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.ai-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.ai-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--gray-700);
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid var(--gray-300);
    background: var(--gray-100);
    transition: all 0.2s ease;
    user-select: none;
}

.ai-checkbox-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* Cacher la checkbox native */
.ai-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Pastille custom a la place de la checkbox */
.ai-checkbox-label::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid var(--gray-400);
    background: #fff;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-checkbox:checked + .ai-checkbox-label,
.ai-checkbox-label:has(.ai-checkbox:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

/* Coche : le ::before quand la checkbox dans le label est cochee */
.ai-checkbox-label:has(.ai-checkbox:checked)::before {
    background: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2.5-2.5a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.ai-checkbox-label .text-muted {
    font-size: 0.75rem;
}

/* ===== BOUTON EXPLICATION ===== */
.explain-bar {
    display: flex;
    justify-content: center;
    margin: 1rem 0 1.25rem;
}

.btn-explain {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border: 2px solid #CD1528;
    border-radius: 2rem;
    background: transparent;
    color: #CD1528;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}

.btn-explain::before {
    content: '?';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #CD1528;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.btn-explain:hover {
    background: #CD1528;
    color: #fff;
}

.btn-explain:hover::before {
    background: #fff;
    color: #CD1528;
}

.btn-explain-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 1rem;
    border: none;
    border-radius: 2rem;
    background: var(--brand-red);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.btn-explain-hero:hover {
    background: #a8111f;
}

/* ===== MODAL EXPLICATION ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(3px);
}

.modal-overlay.visible {
    display: flex;
}

.modal-card {
    background: #fff;
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    padding: 2rem 2.5rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    border: none;
    background: none;
    font-size: 1.75rem;
    color: var(--gray-500);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #CD1528;
    margin-bottom: 1.25rem;
    padding-right: 2rem;
}

.modal-body p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.modal-section {
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid #9b8574;
}

.modal-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #CD1528;
    margin-bottom: 0.5rem;
}

.modal-section p {
    margin-bottom: 0;
}

.modal-cta {
    background: linear-gradient(135deg, #faf0ec, #f5ebe4);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    border: 1px solid rgba(139, 26, 43, 0.15);
}

.modal-cta p {
    margin-bottom: 0;
    color: #5a4a3a;
}

/* ===== TABLE SECTION ===== */
.table-section {
    margin-bottom: 3rem;
}

#comparison-table thead th {
    background: var(--gray-100);
}

/* Fond des cellules des tableaux publics — pour mieux distinguer le tableau du body */
#comparison-table tbody td,
.use-cases-table tbody td {
    background: var(--table-cell-bg);
}

.category-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.category-link:hover {
    text-decoration: underline;
}

.separator-row td {
    background: var(--gray-200);
    padding: 0.5rem 0.875rem;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border: none;
}

.separator-label {
    display: block;
}

.characteristic-row {
    background: var(--gray-100);
}

.characteristic-row:hover {
    background: var(--primary-light) !important;
}

/* ===== USE CASES DETAIL ===== */
.use-cases-section {
    padding-top: 1rem;
}

.use-cases-section > h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.category-detail {
    margin-bottom: 2.5rem;
    scroll-margin-top: calc(var(--navbar-height) + 1rem);
}

.category-detail h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.1rem;
}

.use-cases-table {
    font-size: 0.85rem;
}

/* ===== USE CASE COMMENT TOGGLE ===== */
.uc-comment-toggle {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 0.25rem;
    width: fit-content;
    transition: var(--transition);
}

.uc-comment-toggle:hover {
    background: var(--primary);
    color: #fff;
}

.uc-comment-popin {
    display: none;
    position: fixed;
    z-index: 300;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    min-width: 300px;
    max-width: 450px;
    box-shadow: var(--shadow-lg, 0 4px 20px rgba(0,0,0,0.15));
    font-size: 0.85rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.uc-comment-popin.visible {
    display: block;
}

.uc-comment-popin-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-500);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.uc-comment-popin-close:hover {
    color: var(--gray-800);
}

.uc-comment-popin-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}

/* ===== SIDEBAR (admin) ===== */
body.has-sidebar {
    --sidebar-width: 240px;
}

.layout-with-sidebar {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: block;
    padding: 0.625rem 1.5rem;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--gray-100);
    color: var(--primary);
    text-decoration: none;
}

.sidebar-link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 1.5rem;
}

.main-content-sidebar {
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

.page-title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* ===== COMMUNITY NAV ===== */
.community-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.community-nav .container {
    display: flex;
    gap: 0;
}

.community-tab {
    display: inline-block;
    padding: 0.875rem 1.25rem;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.community-tab:hover {
    color: var(--primary);
    text-decoration: none;
}

.community-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== STATS GRID (admin dashboard) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.375rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ===== TOKEN DISPLAY ===== */
.token-display {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.75rem;
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    word-break: break-all;
    color: var(--gray-700);
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 440px;
    width: 100%;
    padding: 2.5rem;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.login-back {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
}

.login-info {
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    text-align: center;
    line-height: 1.5;
}

.login-info-small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Onglets de connexion */
.login-tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
    gap: 0;
}

.login-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.login-tab:hover {
    color: var(--gray-700);
}

.login-tab.active {
    color: #CD1528;
    border-bottom-color: #CD1528;
}

.login-tab-content {
    display: none;
}

.login-tab-content.active {
    display: block;
}

.login-links {
    text-align: right;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.login-links a {
    color: var(--primary);
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

/* Bandeau création de compte */
.account-banner {
    background: linear-gradient(135deg, #e8f4fd, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.account-banner h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.account-banner p {
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.account-banner .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.account-banner .btn {
    margin-top: 0.75rem;
}

/* ===== RATING INTERFACE (community) ===== */
.section-title {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.rating-block {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.rating-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.rating-block-title {
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.recommended-config {
    font-size: 0.78rem;
    color: var(--gray-600);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.rating-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rating-ai-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-value {
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 2rem;
    text-align: center;
    color: var(--gray-400);
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
}

.slider-label-ne {
    color: var(--gray-400);
}

.slider-label-na {
    color: var(--gray-600);
    background: var(--gray-200);
}

.slider-label-active {
    color: var(--primary);
}

/* ===== RANGE SLIDER ===== */
input[type="range"].rating-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--gray-300);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background 0.15s;
}

/* État NE (gris clair) */
input[type="range"].slider-ne {
    background: var(--gray-200);
}
input[type="range"].slider-ne::-webkit-slider-thumb {
    background: var(--gray-400);
}
input[type="range"].slider-ne::-moz-range-thumb {
    background: var(--gray-400);
}

/* État NA (gris foncé) */
input[type="range"].slider-na {
    background: var(--gray-300);
}
input[type="range"].slider-na::-webkit-slider-thumb {
    background: var(--gray-600);
}
input[type="range"].slider-na::-moz-range-thumb {
    background: var(--gray-600);
}

/* État actif (bleu) */
input[type="range"].slider-active {
    background: linear-gradient(to right, var(--primary-light), var(--primary));
}

input[type="range"].rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

input[type="range"].rating-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="range"].rating-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== LÉGENDE SLIDER ===== */
.rating-legend {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
}

.rating-legend p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.legend-items {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--gray-700);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-ne { background: var(--gray-400); }
.legend-na { background: var(--gray-600); }
.legend-score { background: var(--primary); }

/* ===== COMMENTS (community) ===== */
.comment-section {
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}

.comment-section h4 {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.comment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
}

.comment-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.comment-input-row {
    display: flex;
    gap: 0.375rem;
}

.comment-input-row .form-control {
    flex: 1;
}

/* ===== RATING LINES (1 ligne = 1 IA : nom + slider + commentaire) ===== */
.rating-lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-line {
    display: grid;
    grid-template-columns: 160px 200px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.rating-line.is-dirty {
    background-color: rgba(205, 21, 40, 0.15);
}

.rating-line.is-saved {
    background-color: rgba(25, 135, 84, 0.18);
    transition: background-color 0.3s ease;
}

.rating-line:last-child {
    border-bottom: none;
}

.rating-line-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.3;
}

.rating-line-name .text-muted {
    font-weight: 400;
    font-size: 0.7rem;
}

.rating-line-slider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-line-comment {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.rating-line-comment .form-control {
    flex: 1;
    font-size: 0.8rem;
}

.rating-line-comment .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Commentaires en liste verticale pleine largeur */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-item-full {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-item-full .rating-ai-name {
    min-width: 100px;
    flex-shrink: 0;
}

.comment-input-row-full {
    display: flex;
    gap: 0.375rem;
    flex: 1;
}

.char-counter {
    font-size: 0.7rem;
    color: var(--gray-500);
    min-width: 1.75rem;
    text-align: right;
    flex-shrink: 0;
}

.char-counter-warn {
    color: var(--danger);
    font-weight: 600;
}

.comment-input-row-full .form-control {
    flex: 1;
}

/* ===== ACTION CARDS (community dashboard) ===== */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none !important;
    color: var(--dark);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
    color: var(--dark);
}

.action-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.action-card h3 {
    margin-bottom: 0.375rem;
    font-size: 1rem;
}

.action-card p {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin: 0;
}

/* ===== FEATURE LIST ===== */
.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.375rem 0;
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.9rem;
}

.feature-list li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* ===== USE CASE LIST ===== */
.use-case-list {
    list-style: none;
    padding: 0;
}

.use-case-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
}

.use-case-list li:last-child {
    border-bottom: none;
}

/* ===== FOOTER ===== */
.footer {
    padding: 1.5rem 0;
    border-top: 3px solid #CD1528;
    background: #faf8f6;
}

.footer p {
    color: #9b8574;
    font-size: 0.8rem;
    margin: 0;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50rem;
    line-height: 1;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #d1e7dd; color: var(--success); }
.badge-warning { background: #fff3cd; color: #664d03; }
.badge-danger { background: #f8d7da; color: var(--danger); }

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Tablet */
@media (max-width: 992px) {
    .sidebar {
        display: none;
    }

    .main-content-sidebar {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .navbar-actions {
        gap: 0.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body { font-size: 14px; }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }

    .container { padding: 0 0.75rem; }

    .hero-banner { padding: 1rem 0; }
    .hero-banner-inner { flex-direction: column; gap: 0.75rem; text-align: center; }
    .hero-logo img { width: 140px; }
    .hero-title { font-size: 1.5rem; }
    .hero-subtitle { font-size: 0.85rem; }
    .hero-logo-left, .hero-logo-right { display: flex; justify-content: center; }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-checkboxes {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Tableau : scroll horizontal, 1ere colonne sticky */
    #comparison-table {
        min-width: 700px;
    }

    #comparison-table th:first-child,
    #comparison-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 5;
        background: var(--card-bg);
    }

    #comparison-table thead th:first-child {
        background: var(--gray-100);
    }

    .use-cases-table {
        min-width: 600px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rating-grid {
        grid-template-columns: 1fr;
    }

    .rating-line {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 0.75rem 0;
    }

    .rating-line-comment {
        flex-wrap: wrap;
    }

    .comment-grid {
        grid-template-columns: 1fr;
    }

    .action-cards {
        grid-template-columns: 1fr;
    }

    .card-body { padding: 1rem; }

    .login-card { padding: 1.5rem; }

    .navbar-actions .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .community-nav .container {
        overflow-x: auto;
    }

    .td-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .navbar-brand { font-size: 1rem; }

    .btn-block { padding: 0.625rem; }

    .stat-card { padding: 0.875rem; }
    .stat-number { font-size: 1.5rem; }
}
