/* =============================================================================
   Theme MODERNE radical — active via html/body.theme-modern
   L'ancien style.css n'est PAS modifie. Bascule via le bouton flottant.
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=IBM+Plex+Mono:wght@400;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

html.theme-modern,
body.theme-modern {
    --bg-top: #07090d;
    --bg-bottom: #12161f;
    --ink: #f4f0e6;
    --muted: #9aa3b2;
    --card: #141a24;
    --line: #2a3344;
    --accent: #d6ff3f;
    --accent-soft: rgba(214, 255, 63, 0.14);
    --danger: #ff4d6d;
    --success: #3dffa8;
    --radius: 6px;
    --shadow: 8px 8px 0 #d6ff3f;
    --modern-panel: #0d1118;
    --modern-ink-dim: #c5cdd8;
    --modern-hot: #ff5c00;
    --modern-grid: rgba(214, 255, 63, 0.07);
}

body.theme-modern {
    font-family: 'Space Grotesk', 'Manrope', sans-serif;
    color: var(--ink);
    background-color: #07090d;
    background-image:
        linear-gradient(var(--modern-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--modern-grid) 1px, transparent 1px),
        radial-gradient(circle at 85% 10%, rgba(255, 92, 0, 0.22), transparent 28%),
        radial-gradient(circle at 10% 90%, rgba(214, 255, 63, 0.12), transparent 30%),
        linear-gradient(160deg, #07090d 0%, #10151e 55%, #0a0d13 100%);
    background-size: 48px 48px, 48px 48px, auto, auto, auto;
    background-attachment: fixed;
}

body.theme-modern::before {
    content: 'TEACHTOOL';
    position: fixed;
    left: -2vw;
    bottom: 4vh;
    z-index: 0;
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(4rem, 18vw, 14rem);
    line-height: 0.8;
    letter-spacing: -0.06em;
    color: rgba(214, 255, 63, 0.045);
    pointer-events: none;
    transform: rotate(-8deg);
    white-space: nowrap;
}

body.theme-modern > * {
    position: relative;
    z-index: 1;
}

/* ----- Menu : barre noire industrielle ----- */
body.theme-modern .site-menu {
    position: sticky;
    top: 0;
    z-index: 3000;
    background: #05070b;
    border-bottom: 3px solid var(--accent);
    backdrop-filter: none;
    padding: 10px 14px;
}

body.theme-modern .menu-group {
    position: relative;
    z-index: 3010;
}

body.theme-modern .menu-inner {
    width: min(1360px, 100%);
    gap: 16px;
}

body.theme-modern .menu-brand {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.35rem;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
}

body.theme-modern .menu-links {
    gap: 8px;
}

body.theme-modern .menu-btn,
body.theme-modern .menu-group-toggle {
    border: 2px solid #3a4558;
    border-radius: 0;
    background: transparent;
    color: #e8edf5;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 12px;
}

body.theme-modern .menu-btn:hover,
body.theme-modern .menu-btn.is-active,
body.theme-modern .menu-group[open] > summary {
    background: var(--accent);
    border-color: var(--accent);
    color: #07090d;
}

body.theme-modern .menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    background: #05070b;
    border: 2px solid var(--accent);
    border-radius: 0;
    box-shadow: 6px 6px 0 rgba(255, 92, 0, 0.8);
    padding: 6px;
    z-index: 3020;
}

body.theme-modern .menu-sublink {
    border-radius: 0;
    color: #dfe6f0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
}

body.theme-modern .menu-sublink:hover,
body.theme-modern .menu-sublink.is-active {
    background: rgba(214, 255, 63, 0.16);
    color: var(--accent);
    box-shadow: none;
}

body.theme-modern .menu-burger {
    border-radius: 0;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
}

body.theme-modern .smart-search {
    max-width: 420px;
}

body.theme-modern .smart-search-field {
    border-radius: 0;
    border: 2px solid #3a4558;
    background: #0a0e15;
    box-shadow: none;
}

body.theme-modern .smart-search.is-open .smart-search-field,
body.theme-modern .smart-search-field:focus-within {
    border-color: var(--accent);
    box-shadow: 4px 4px 0 var(--accent);
}

body.theme-modern .smart-search-icon,
body.theme-modern .smart-search-field input {
    color: #f4f0e6;
}

body.theme-modern .smart-search-field input::placeholder {
    color: #6f7b8c;
}

body.theme-modern .smart-search-kbd {
    border-radius: 0;
    border: 1px solid #3a4558;
    background: #121821;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
}

body.theme-modern .smart-search-panel {
    border-radius: 0;
    border: 2px solid var(--accent);
    background: #05070b;
    box-shadow: 6px 6px 0 rgba(255, 92, 0, 0.7);
}

/* ----- Layout cartes ----- */
body.theme-modern .auth-page {
    padding: 28px 16px 64px;
}

body.theme-modern .auth-card {
    width: min(100%, 1080px);
    border-radius: 0;
    border: 3px solid var(--accent);
    background: rgba(13, 17, 24, 0.94);
    box-shadow: 12px 12px 0 rgba(255, 92, 0, 0.85);
    padding: 0;
    overflow: visible;
    gap: 0;
}

body.theme-modern .auth-card.app-card-single {
    grid-template-columns: 1fr;
    overflow: hidden;
}

body.theme-modern .auth-card > .auth-form {
    padding: 28px;
    margin: 0;
}

body.theme-modern .auth-card.app-card-single > .auth-form,
body.theme-modern .auth-card.app-card-single > .profile-box,
body.theme-modern .auth-card.app-card-single > .dashboard-notes-alerts,
body.theme-modern .auth-card.app-card-single > .classes-bubbles,
body.theme-modern .auth-card.app-card-single > .section-title {
    margin-left: 24px;
    margin-right: 24px;
}

body.theme-modern .auth-card.app-card-single > .auth-form {
    padding: 0 0 28px;
}

body.theme-modern .brand-block {
    border-radius: 0;
    border: 0;
    border-bottom: 3px solid var(--accent);
    background:
        linear-gradient(120deg, rgba(214, 255, 63, 0.12), transparent 42%),
        linear-gradient(180deg, #10151e, #0a0e14);
    padding: 28px 28px 24px;
    overflow: hidden;
}

body.theme-modern .brand-block::after {
    display: none;
}

body.theme-modern .brand-block .badge {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 10px;
    border: 2px solid var(--accent);
    border-radius: 0;
    background: transparent;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.theme-modern .brand-block h1 {
    margin: 0 0 10px;
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: #f7f4ea;
}

body.theme-modern .brand-block p {
    margin: 0;
    max-width: 46ch;
    color: #b7c0ce;
    font-size: 1rem;
}

body.theme-modern .auth-form,
body.theme-modern .profile-box,
body.theme-modern .dashboard-notes-alerts,
body.theme-modern .classes-bubbles,
body.theme-modern .section-title {
    margin-left: 24px;
    margin-right: 24px;
}

body.theme-modern .auth-form {
    padding-bottom: 28px;
}

body.theme-modern .profile-box {
    border-radius: 0;
    border: 2px dashed #3a4558;
    background: #0a0e15;
    color: var(--modern-ink-dim);
}

body.theme-modern .profile-box p {
    color: var(--modern-ink-dim);
}

body.theme-modern .profile-box strong {
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
}

body.theme-modern .section-title,
body.theme-modern h2,
body.theme-modern h3 {
    font-family: 'Archivo Black', sans-serif;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: #f4f0e6;
}

body.theme-modern .section-title {
    display: inline-block;
    padding: 4px 10px;
    margin: 18px 24px 12px;
    background: var(--accent);
    color: #07090d;
    font-size: 0.95rem;
}

body.theme-modern .field-help,
body.theme-modern .empty-state {
    color: #8b95a5;
}

/* ----- Formulaires / boutons ----- */
body.theme-modern .auth-form label {
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.theme-modern .auth-form input,
body.theme-modern .auth-form textarea,
body.theme-modern .auth-form select,
body.theme-modern .menu-select,
body.theme-modern input,
body.theme-modern select,
body.theme-modern textarea {
    border-radius: 0;
    border: 2px solid #3a4558;
    background: #07090d;
    color: #f4f0e6;
    font-family: 'Space Grotesk', sans-serif;
}

body.theme-modern .auth-form input:focus,
body.theme-modern .auth-form textarea:focus,
body.theme-modern .auth-form select:focus,
body.theme-modern input:focus,
body.theme-modern select:focus,
body.theme-modern textarea:focus {
    border-color: var(--accent);
    box-shadow: 4px 4px 0 var(--accent);
    outline: none;
}

body.theme-modern button,
body.theme-modern .btn-small,
body.theme-modern .menu-btn.btn-nav-dashboard,
body.theme-modern .menu-btn.btn-nav-report,
body.theme-modern .menu-btn.btn-nav-plan,
body.theme-modern .menu-btn.btn-nav-affinities,
body.theme-modern .menu-btn.btn-cancel {
    border-radius: 0 !important;
    border: 2px solid var(--accent) !important;
    background: transparent !important;
    color: var(--accent) !important;
    font-family: 'IBM Plex Mono', monospace !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: none !important;
}

body.theme-modern button:hover,
body.theme-modern .btn-small:hover,
body.theme-modern .menu-btn.btn-nav-dashboard:hover,
body.theme-modern .menu-btn.btn-nav-report:hover,
body.theme-modern .menu-btn.btn-nav-plan:hover,
body.theme-modern .menu-btn.btn-nav-affinities:hover {
    background: var(--accent) !important;
    color: #07090d !important;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--modern-hot) !important;
}

body.theme-modern button[type="submit"],
body.theme-modern .print-button {
    background: var(--accent) !important;
    color: #07090d !important;
    border-color: var(--accent) !important;
    box-shadow: 5px 5px 0 var(--modern-hot) !important;
}

body.theme-modern .btn-danger,
body.theme-modern .menu-btn.btn-cancel {
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

/* ----- Dashboard / bulles classes ----- */
body.theme-modern .classes-bubbles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    padding-bottom: 28px;
}

body.theme-modern .bubble-wrapper {
    position: relative;
}

body.theme-modern .class-bubble {
    --bubble-color: #d6ff3f;
    width: 100%;
    min-height: 120px;
    border-radius: 0 !important;
    border: 3px solid var(--bubble-color) !important;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--bubble-color) 34%, #0a0e15) 0%,
            color-mix(in srgb, var(--bubble-color) 14%, #07090d) 100%
        ) !important;
    box-shadow: 8px 8px 0 color-mix(in srgb, var(--bubble-color) 75%, #000000) !important;
    color: #f7f4ea !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

body.theme-modern .class-bubble::before {
    content: '';
    position: absolute;
    inset: 10px 10px auto auto;
    width: 14px;
    height: 14px;
    background: var(--bubble-color);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
}

body.theme-modern .class-bubble:hover {
    transform: translate(-4px, -4px);
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--bubble-color) 48%, #0a0e15) 0%,
            color-mix(in srgb, var(--bubble-color) 20%, #07090d) 100%
        ) !important;
    box-shadow: 12px 12px 0 var(--bubble-color) !important;
}

body.theme-modern .bubble-name {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: #f7f4ea;
}

body.theme-modern .bubble-level {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: color-mix(in srgb, var(--bubble-color) 70%, #ffffff);
    text-transform: uppercase;
}

body.theme-modern .bubble-settings {
    border-radius: 0;
    border: 2px solid var(--bubble-color);
    background: #07090d;
    opacity: 1;
}

body.theme-modern .bubble-settings::before {
    color: var(--bubble-color);
}

/* ----- Notifs dashboard ----- */
body.theme-modern .dashboard-notes-alerts {
    gap: 14px;
}

body.theme-modern .dashboard-notif {
    border-radius: 0;
    border: 2px solid #3a4558;
    background: #0a0e15;
    box-shadow: 6px 6px 0 #2a3344;
}

body.theme-modern .dashboard-notif-urgent {
    border-color: var(--danger);
    background: rgba(255, 77, 109, 0.08);
    box-shadow: 6px 6px 0 var(--danger);
    color: #ffd0da;
}

body.theme-modern .dashboard-notif-warning {
    border-color: var(--modern-hot);
    background: rgba(255, 92, 0, 0.08);
    box-shadow: 6px 6px 0 var(--modern-hot);
    color: #ffd8c2;
}

body.theme-modern .dashboard-notif-info {
    border-color: var(--accent);
    box-shadow: 6px 6px 0 var(--accent);
    color: #eef6c8;
}

body.theme-modern .dashboard-notif-kicker {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--accent);
}

body.theme-modern .dashboard-notif-title {
    font-family: 'Archivo Black', sans-serif;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

body.theme-modern .dashboard-notif-link:hover {
    transform: translate(-3px, -3px);
}

/* ----- Panneaux / stats / tables ----- */
body.theme-modern .feature-panel,
body.theme-modern .stat-card,
body.theme-modern .chart-card,
body.theme-modern .stats-interpretation,
body.theme-modern .insight-group-card,
body.theme-modern .attendance-chip {
    border-radius: 0;
    border: 2px solid #3a4558;
    background: #0a0e15;
    box-shadow: none;
}

body.theme-modern .feature-summary {
    background: #10151e;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
}

/* Cartes d'exercices : le vert fluo sur fond blanc était illisible. */
body.theme-modern .exercise-card {
    border-radius: 0;
    border: 2px solid #3a4558;
    background: #10151e;
    color: #f4f0e6;
}

body.theme-modern .exercise-builder .field-help {
    color: #d5dbe6;
}

body.theme-modern .exercise-card label {
    color: #f4f0e6;
}

body.theme-modern .exercise-card input {
    background: #f4f0e6;
    color: #07090d;
    border-color: #d6ff3f;
    font-weight: 650;
    color-scheme: light;
}

body.theme-modern .exercise-card input:focus {
    background: #ffffff;
    color: #07090d;
    border-color: #d6ff3f;
    box-shadow: 4px 4px 0 #d6ff3f;
}

body.theme-modern .exercise-card input:-webkit-autofill {
    -webkit-text-fill-color: #07090d;
    box-shadow: 0 0 0 1000px #f4f0e6 inset;
}

body.theme-modern .evaluation-date-form {
    border-radius: 0;
    border: 2px solid #3a4558;
    background: #10151e;
    color: #f4f0e6;
}

body.theme-modern .evaluation-date-form .field-help {
    color: #d5dbe6;
}

body.theme-modern .evaluation-date-form input[type="date"] {
    background: #f4f0e6;
    color: #07090d;
    border-color: #d6ff3f;
    color-scheme: light;
    font-weight: 650;
}

body.theme-modern .evaluation-date-form input[type="date"]:focus {
    background: #ffffff;
    color: #07090d;
    border-color: #d6ff3f;
    box-shadow: 4px 4px 0 #d6ff3f;
}

body.theme-modern .stat-card-value,
body.theme-modern .insight-headline {
    font-family: 'Archivo Black', sans-serif;
    color: var(--accent);
}

body.theme-modern .insight-headline {
    border-radius: 0;
    background: rgba(214, 255, 63, 0.1);
    border: 2px solid var(--accent);
}

body.theme-modern .table-wrap,
body.theme-modern table {
    border-radius: 0;
}

body.theme-modern table {
    border: 2px solid #3a4558;
    background: #07090d;
}

body.theme-modern th {
    background: #10151e;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

body.theme-modern td {
    border-color: #243041;
    color: #e6ebf2;
}

body.theme-modern tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

/* Annule le hover clair du style classique (lisible uniquement sur fond sombre). */
body.theme-modern tbody tr:hover,
body.theme-modern tbody tr:hover td {
    background: rgba(214, 255, 63, 0.12) !important;
    color: #f7f4ea !important;
}

body.theme-modern tbody tr:hover a,
body.theme-modern tbody tr:hover .btn-small {
    color: inherit;
}

/* Liens et actions dans les tableaux : rester lisibles sur fond sombre. */
body.theme-modern td a:not(.btn-small):not(.menu-btn) {
    color: var(--accent);
}

body.theme-modern .row-actions {
    gap: 10px;
}

body.theme-modern .auth-form > .row-actions,
body.theme-modern .auth-form > a.menu-btn {
    margin-left: 0;
}

body.theme-modern .color-swatch {
    border-radius: 0;
    border: 2px solid #3a4558;
}

body.theme-modern .color-swatch.is-selected {
    border-color: var(--accent);
    box-shadow: 3px 3px 0 var(--accent);
}

body.theme-modern .badge {
    border-radius: 0;
}

body.theme-modern .smart-search-item,
body.theme-modern .smart-search-item:hover,
body.theme-modern .smart-search-item.is-active {
    color: #f4f0e6;
}

body.theme-modern .smart-search-item:hover,
body.theme-modern .smart-search-item.is-active {
    background: rgba(214, 255, 63, 0.14);
}

body.theme-modern .auth-form a:not(.menu-btn):not(.btn-small),
body.theme-modern .profile-box a,
body.theme-modern .dashboard-notif a,
body.theme-modern .feature-body a:not(.menu-btn):not(.btn-small),
body.theme-modern .brand-block a {
    color: var(--accent);
}

body.theme-modern .chart-card-head h3,
body.theme-modern .insight-subtitle {
    color: #f4f0e6;
}

body.theme-modern .stat-card-label {
    color: #9aa3b2;
}

body.theme-modern .alert {
    border-radius: 0;
    border-width: 2px;
}

body.theme-modern .alert-success {
    background: rgba(61, 255, 168, 0.08);
    border-color: var(--success);
    color: #b8ffe0;
}

body.theme-modern .alert-error {
    background: rgba(255, 77, 109, 0.08);
    border-color: var(--danger);
    color: #ffc2cf;
}

body.theme-modern .attendance-chip.is-absent {
    background: rgba(255, 77, 109, 0.12);
    border-color: var(--danger);
    color: #ffb3c1;
}

body.theme-modern .plan-cell {
    border-radius: 0;
}

/* ----- Bouton bascule ----- */
.theme-toggle-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(16, 24, 32, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: #101820;
    font: 700 0.82rem/1 'Manrope', sans-serif;
    box-shadow: 0 12px 30px rgba(16, 24, 32, 0.16);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.theme-toggle-btn:hover {
    transform: translateY(-1px);
}

body.theme-modern .theme-toggle-btn {
    border-radius: 0;
    border: 2px solid var(--accent);
    background: #07090d;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 4px 4px 0 var(--modern-hot);
    backdrop-filter: none;
}

@media (max-width: 820px) {
    body.theme-modern .auth-form,
    body.theme-modern .profile-box,
    body.theme-modern .dashboard-notes-alerts,
    body.theme-modern .classes-bubbles,
    body.theme-modern .section-title {
        margin-left: 14px;
        margin-right: 14px;
    }

    body.theme-modern .auth-card {
        box-shadow: 6px 6px 0 rgba(255, 92, 0, 0.85);
    }
}

@media print {
    body.theme-modern {
        background: #fff;
        color: #000;
    }

    body.theme-modern::before,
    .theme-toggle-btn {
        display: none !important;
    }
}
