* { box-sizing: border-box; }

:root { color-scheme: dark; }
[data-bs-theme="light"] { color-scheme: light; }

select option,
select optgroup,
.form-select option,
.form-control option,
datalist option {
    background-color: var(--surface-solid);
    color: var(--text);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background:
        var(--grad-hero),
        var(--night);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--nav-height);
}

h1, h2, h3, h4, h5, .display-font {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

a { color: var(--cyan-deep); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--cyan); }

.container-x { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.text-muted-2 { color: var(--text-muted) !important; }
.text-dim { color: var(--text-dim) !important; }

.gradient-text {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.section-head h2 {
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-head h2::before {
    content: "";
    width: 5px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: var(--grad-primary);
}

.section-head .link-more {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.section-head .link-more:hover { color: var(--cyan); }

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 22px;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    border: 0;
    margin: 0;
}

::selection { background: rgba(124, 58, 237, 0.4); color: #fff; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--violet), var(--cyan-deep));
    border-radius: var(--radius-pill);
    border: 3px solid var(--night);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: var(--transition);
}

a.chip:hover { color: var(--white); border-color: var(--violet); background: rgba(124, 58, 237, 0.18); }

/* Étiquettes de rôle, sur la fiche profil uniquement.
   Le texte repose sur un fond teinté de sa propre couleur : la nuance doit
   donc changer selon le thème. Toutes les valeurs ci-dessous sont mesurées
   au-dessus de 4,5:1 des deux côtés. */
.chip-role { border-width: 1px; border-style: solid; }

.chip-admin     { background: rgba(239, 68, 68, 0.18);  border-color: var(--danger);  color: #f87171; }
.chip-moderator { background: rgba(56, 189, 248, 0.18); border-color: var(--info);    color: #7dd3fc; }
.chip-editor    { background: rgba(124, 58, 237, 0.18); border-color: var(--violet);  color: #a78bfa; }
.chip-member    { background: rgba(16, 185, 129, 0.18); border-color: var(--success); color: #34d399; }

[data-bs-theme="light"] .chip-admin     { color: #b91c1c; }
[data-bs-theme="light"] .chip-moderator { color: #0369a1; }
[data-bs-theme="light"] .chip-editor    { color: #5b21b6; }
[data-bs-theme="light"] .chip-member    { color: #047857; }


.stars { color: var(--warning); font-size: 0.85rem; letter-spacing: 1px; }

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 3px 8px;
    font-weight: 800;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    color: #fff;
}

.score-excellent { background: linear-gradient(135deg, #059669, #10b981); }
.score-good { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.score-average { background: linear-gradient(135deg, #d97706, #f59e0b); }
.score-low { background: linear-gradient(135deg, #dc2626, #ef4444); }

.badge-ongoing { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }
.badge-completed { background: rgba(16, 185, 129, 0.18); color: #10b981; }
.badge-upcoming { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.badge-cancelled { background: rgba(239, 68, 68, 0.18); color: #ef4444; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

main { min-height: 60vh; }

.page-header {
    padding: 40px 0 28px;
    margin-bottom: 8px;
}

.page-header h1 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); margin-bottom: 8px; }
.page-header p { color: var(--text-muted); max-width: 640px; margin: 0; }

.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-muted);
}

.empty-state > i { font-size: 3rem; opacity: 0.4; display: block; margin-bottom: 16px; }
