/* SPDX-License-Identifier: AGPL-3.0-only
 * Copyright (C) 2026 Vivian Epiney (AP-EdNum, HEP-VS) */
/* --- Header unifié --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
    margin-bottom: 24px;
    width: 100%;
}

.header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.header-icon {
    background: var(--accent, var(--primary, #2563eb));
    color: white;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px oklch(0 0 0 / 0.15);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s var(--spring-easing, ease);
}

.header-icon:hover {
    transform: scale(1.05);
}

.app-header h1 {
    margin-bottom: 0;
    font-size: clamp(1.2rem, 5vw, 1.75rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* --- Boutons d'action --- */
.action-buttons {
    display: flex;
    gap: 8px;
    z-index: 100;
}
/* --- Dropdown Réglages --- */
.settings-dropdown {
    position: relative;
    display: inline-block;
}

.settings-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    background: var(--container-bg, oklch(1 0 0 / 0.95));
    min-width: 60px;
    box-shadow: 0 10px 40px -10px oklch(0 0 0 / 0.3);
    border: 1px solid var(--card-border, oklch(0 0 0 / 0.1));
    border-radius: var(--radius-lg);
    z-index: 101;
    backdrop-filter: blur(20px);
    padding: 10px;
    flex-direction: column;
    gap: 10px;
}

/* Pseudo-element to bridge the gap between button and dropdown to prevent hover loss */
.dropdown-divider {
    height: 1px;
    background-color: oklch(0 0 0 / 0.1);
    margin: 2px 0;
}
body.dark .dropdown-divider {
    background-color: oklch(1 0 0 / 0.1);
}

.settings-dropdown-content::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

body.dark .settings-dropdown-content {
    background: rgb(15 23 42 / 98%);
    border: 1px solid oklch(1 0 0 / 0.1);
    box-shadow: 0 10px 40px -10px oklch(0 0 0 / 0.6);
}

/* Affichage au survol ou au clic sur le bouton déclencheur */
.settings-dropdown:hover .settings-dropdown-content,
.settings-dropdown-content.show {
    display: flex;
    animation: fade-in-cascade 0.2s var(--spring-easing, cubic-bezier(0.175, 0.885, 0.32, 1.275)) forwards;
}

.icon-action-btn {
    background: var(--card-bg, oklch(1 0 0 / 0.8));
    border: 1px solid var(--card-border, oklch(0 0 0 / 0.1));
    color: var(--text-main, #1e293b);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-full);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 5px oklch(0 0 0 / 0.05);
    min-width: 44px;
    min-height: 44px;
}

.icon-action-btn:hover {
    background: oklch(1 0 0 / 0.9);
    transform: scale(1.05);
}

.settings-dropdown-content .icon-action-btn {
    color: var(--text-main, #1e293b);
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
}

body.dark .icon-action-btn {
    background: rgb(30 41 59 / 80%);
    border: 1px solid oklch(1 0 0 / 0.1);
    color: #f8fafc;
}

.settings-dropdown-content .icon-action-btn:hover {
    background: oklch(0 0 0 / 0.05);
    transform: none;
}

body.dark .icon-action-btn:hover {
    background: rgb(30 41 59 / 90%);
}

body.dark .settings-dropdown-content .icon-action-btn {
    color: #fff;
    background: transparent;
    border: 1px solid transparent;
}

body.dark .settings-dropdown-content .icon-action-btn:hover {
    background: oklch(1 0 0 / 0.1);
}
/* --- Footer commun --- */
footer {
    text-align: center;
    margin-top: 30px;
    font-size: 13px;
    color: oklch(1 0 0 / 0.8);
}

footer a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}
/* ============================================================
   Modal Statistiques détaillées (ScoreManager)
   ============================================================ */
.ui-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: oklch(0 0 0 / 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ui-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ui-modal-content {
    background: var(--card-bg, oklch(1 0 0 / 0.95));
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-2xl);
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-color, #1a202c);
}

body.dark .ui-modal-content {
    background: #2d3748;
    color: #f7fafc;
}

.ui-modal-overlay.active .ui-modal-content {
    transform: scale(1) translateY(0);
}

.btn-reset-scores {
    margin-top: 25px;
    padding: 12px 24px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: block;
    width: 100%;
}

.btn-reset-scores:hover {
    background: #c53030;
    transform: scale(1.02);
}

.stat-mode-title {
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-color, #667eea);
    padding-bottom: 5px;
    font-size: 1.2rem;
}

.stat-table-wrapper {
    overflow-x: auto;
}

.stat-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.stat-table th, .stat-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid oklch(0 0 0 / 0.1);
}

.stat-table th {
    font-weight: bold;
    color: var(--primary-color, #667eea);
}

/* Dark mode overrides (si géré par des classes sur body, à ajuster selon le projet) */

body.dark .stat-table th, body.dark .stat-table td {
    border-bottom: 1px solid oklch(1 0 0 / 0.1);
}

.menu-item-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-main, #1e293b);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-md);
    text-align: left;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.menu-item-btn:hover {
    background: oklch(0 0 0 / 0.05);
}

.menu-item-btn:active {
    transform: scale(0.98);
}

body.dark .menu-item-btn {
    color: #f8fafc;
}

body.dark .menu-item-btn:hover {
    background: oklch(1 0 0 / 0.1);
}

/* Graphiques Donut */
.stat-mode-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.stat-chart-wrapper {
    display: flex;
    align-items: center;
    gap: 30px;
    background: oklch(0 0 0 / 0.02);
    padding: 20px;
    border-radius: var(--radius-xl);
    flex-wrap: wrap;
    justify-content: center;
}

body.dark .stat-chart-wrapper {
    background: oklch(1 0 0 / 0.03);
}

.stat-donut-container {
    position: relative;
    width: 140px;
    height: 140px;
    animation: donut-fade-in 0.5s ease-out forwards;
}

.stat-donut {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.stat-donut-circle {
    fill: none;
    stroke-width: 18;
    stroke-linecap: butt;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-donut-bg {
    fill: none;
    stroke: oklch(0 0 0 / 0.05);
    stroke-width: 18;
}

body.dark .stat-donut-bg {
    stroke: oklch(1 0 0 / 0.1);
}

.stat-legend {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.stat-legend-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
}

.color-success-1st { background-color: #22c55e; stroke: #22c55e; }
.color-success-more { background-color: #f59e0b; stroke: #f59e0b; }
.color-mistakes { background-color: #ef4444; stroke: #ef4444; }

body.dark .color-success-1st { background-color: #16a34a; stroke: #16a34a; }
body.dark .color-success-more { background-color: #d97706; stroke: #d97706; }
body.dark .color-mistakes { background-color: #b91c1c; stroke: #b91c1c; }

.stat-legend-label {
    color: var(--text-secondary);
}

.stat-legend-value {
    font-weight: 700;
    margin-left: auto;
}

@keyframes donut-fade-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   Mobile Bottom Tab Bar (Espace, Simulateur, Pilotage, etc.)
   ============================================================ */
@media (width <= 600px) {
    /* Fix for position: fixed failing inside animated containers */
    html body:has(.tabs) > main,
    html body:has(.tab-bar) > main {
        transform: none;
        animation: none;
        backdrop-filter: none;
    }

    html body {
        padding-bottom: 90px; /* Prevent content from being hidden behind the bar */
    }

    html body > .tabs, html body main > .tabs, html body > .tab-bar, html body .container > .tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 10px;
        background: var(--container-bg, oklch(1 0 0 / 0.9));
        backdrop-filter: var(--glass-blur, blur(16px));
        border-top: var(--glass-border, 1px solid oklch(1 0 0 / 0.2));
        box-shadow: 0 -4px 16px oklch(0 0 0 / 0.1);
        z-index: 1000;
        display: flex;
        justify-content: center;
        gap: 8px;
        border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    }

    /* Make buttons expand to fill the bar */
    html body > .tabs > *, html body main > .tabs > *, html body > .tab-bar > *, html body .container > .tabs > * {
        flex: 1;
        text-align: center;
        min-width: 0; /* allows flex to shrink below intrinsic width if needed */
        font-size: 12px;
        padding: 8px 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }

    html body.dark .tabs, html body.dark main > .tabs, html body.dark .tab-bar {
        background: rgb(30 41 59 / 90%);
        border-top: 1px solid oklch(1 0 0 / 0.1);
        box-shadow: 0 -4px 16px oklch(0 0 0 / 0.5);
    }

    html .settings-dropdown-content {
        right: 0;
        left: auto;
    }

    /* Fix containing block issues on mobile for fixed bottom bars */
    html body > header, html .container, html body > .container {
        transform: none;
        animation: none;
        backdrop-filter: none;
    }
}

/* TBI (Tableau Blanc Interactif) & Large Screens Optimization */
@media (width >= 1200px) {
  :root {
    --container-max-width: 1400px;
  }

  body {
    font-size: 18px; /* Bump base font size for better readability from afar */
  }

  body .container {
    max-width: var(--container-max-width);
  }

  /* Increase base interactive element sizes slightly */
  button, select, input {
    font-size: 1.1em;
  }

}
/* ============================================================
   Unified Toast Notification (c2-toast / toast.js)
   ============================================================ */
#c2-toast-container {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.c2-toast {
    padding: 10px 20px;
    border-radius: var(--radius-pill, 30px);
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    background: rgb(30 41 59 / 90%);
    backdrop-filter: blur(8px);
    border: 1px solid oklch(1 0 0 / 0.1);
    box-shadow: 0 10px 25px oklch(0 0 0 / 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(12px) scale(0.95);
    transition: opacity 0.3s var(--spring-easing, ease),
                transform 0.3s var(--spring-easing, ease);
    text-align: center;
    max-width: min(90vw, 450px);
    white-space: pre-wrap;
    pointer-events: auto;
}

.c2-toast.success { background: rgb(16 185 129 / 95%); }
.c2-toast.error   { background: rgb(239 68 68 / 95%); }
.c2-toast.warn    { background: rgb(245 158 11 / 95%); }
.c2-toast.info    { background: rgb(99 102 241 / 95%); }

.c2-toast i {
    flex-shrink: 0;
}

.c2-toast.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ============================================================
   Boutons (Standardisés)
   ============================================================ */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--spring-easing, ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn:active:not(:disabled) {
    transform: scale(0.95) translateY(0);
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    min-height: auto;
    min-width: auto;
}

.btn-primary, .btn-new {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled), .btn-new:hover:not(:disabled) {
    background: var(--accent-dark, var(--accent-hover, #4f46e5));
}

.btn-success, .btn-check {
    background: var(--success);
    color: #fff;
}

.btn-success:hover:not(:disabled), .btn-check:hover:not(:disabled) {
    background: #059669;
}

.btn-clear {
    background: var(--bb-blue, #3b82f6);
    color: #fff;
}

.btn-clear:hover:not(:disabled) {
    background: var(--bb-blue-shadow, #2563eb);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--card-border, #e2e8f0);
    color: var(--text-muted);
}

body.dark .btn-outline {
    border-color: #334155;
    color: #cbd5e1;
}

.btn-outline:hover:not(:disabled) {
    background: var(--card-bg, #f1f5f9);
    color: var(--text-main);
    border-color: var(--text-secondary, #cbd5e1);
}

.btn-outline-error {
    background: transparent;
    border: 2px solid #fca5a5;
    color: #ef4444;
}

body.dark .btn-outline-error {
    border-color: #991b1b;
    color: #f87171;
}

.btn-outline-error:hover:not(:disabled) {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #f87171;
}

body.dark .btn-outline:hover:not(:disabled) {
    background: #334155;
    color: #f8fafc;
}

body.dark .btn-outline-error:hover:not(:disabled) {
    background: #450a0a;
    color: #fca5a5;
}
/* ============================================================
   Navigation par onglets (Standardisée)
   ============================================================ */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--spring-easing, ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
}

.tab-btn:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.tab-btn:active {
    transform: scale(0.95);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgb(99 102 241 / 30%);
}

body.dark .tab-btn {
    background: var(--card-bg);
    border-color: #334155;
    color: #94a3b8;
}

body.dark .tab-btn:hover {
    border-color: #475569;
}

body.dark .tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
/* ============================================================
   Instructions (Standardisée)
   ============================================================ */
.game-instruction {
    text-align: center;
    color: var(--text-main);
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
}

.fa-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentcolor;
    overflow: visible;
}

.header-icon svg {
    width: 24px;
    height: 24px;
}

/* Accessibility: Skip to main content link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary, #2563eb);
    color: white;
    padding: 8px;
    z-index: 10000;
    transition: top 0.2s;
    text-decoration: none;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}
/* ============================================================
   Card Footer & Score Bar
   ============================================================ */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border, #e2e8f0);
    flex-wrap: wrap;
    gap: 15px;
}

body.dark .card-footer {
    border-top-color: #334155;
}

.card-footer .score-bar {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex: 1;
    justify-content: flex-end;
}

/* Fix for .card-footer inside .desktop-layout-side to prevent squeezing */
.desktop-layout-side .card-footer {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.desktop-layout-side .card-footer .score-bar {
    justify-content: center;
    width: 100%;
}

/* ============================================================
   Share Modal Styles
   ============================================================ */
#share-modal {
    max-width: 850px;
}

.share-header {
    text-align: center;
    margin-bottom: 25px;
}

.share-header h2 {
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5em;
}

.share-header p {
    color: var(--text-secondary, #4a5568);
    margin: 0;
}

body.dark .share-header p {
    color: #a0aec0;
}

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

.share-url-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-color, #f7fafc);
    padding: 10px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--grid-border, #e2e8f0);
}

body.dark .share-url-container {
    background: #1a202c;
    border-color: #4a5568;
}

#share-url-input {
    flex-grow: 1;
    min-width: 200px;
    border: none;
    background: transparent;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-color, #1a202c);
    padding: 0 10px;
    outline: none;
}

body.dark #share-url-input {
    color: #f7fafc;
}

.share-url-container .btn {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
}

.share-advanced {
    border-top: 1px solid var(--grid-border, #e2e8f0);
    padding-top: 20px;
}

body.dark .share-advanced {
    border-top-color: #4a5568;
}

.btn-advanced-toggle {
    background: transparent;
    border: none;
    color: var(--btn-primary-bg, #667eea);
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin-bottom: 15px;
    transition: color 0.2s;
}

.btn-advanced-toggle:hover {
    color: var(--btn-primary-hover, #5a67d8);
}

body.dark .btn-advanced-toggle {
    color: #7f9cf5;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: var(--bg-color, #f7fafc);
    padding: 15px;
    border-radius: var(--radius-lg);
}

body.dark .options-grid {
    background: #2d3748;
}

.options-column h3 {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #4a5568);
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--grid-border, #e2e8f0);
    padding-bottom: 5px;
}

body.dark .options-column h3 {
    color: #a0aec0;
    border-bottom-color: #4a5568;
}

.share-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--grid-border, #e2e8f0);
}

.share-option:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

body.dark .share-option {
    border-bottom-color: #4a5568;
}

.share-option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-option-label {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-color, #1a202c);
    cursor: pointer;
}

body.dark .share-option-label {
    color: #e2e8f0;
}

.share-option-desc {
    font-size: 0.8em;
    color: var(--text-secondary, #718096);
    line-height: 1.4;
}

body.dark .share-option-desc {
    color: #a0aec0;
}

/* Toggle Switch Styles */
.share-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.share-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.share-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

body.dark .share-toggle-slider {
    background-color: #475569;
}

.share-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .share-toggle-slider {
    background-color: var(--success, #10b981);
}

input:focus + .share-toggle-slider {
    box-shadow: 0 0 1px var(--success, #10b981);
}

input:checked + .share-toggle-slider:before {
    transform: translateX(20px);
}

.instructions {
    background: #f0f4ff;
    padding: 15px;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
    cursor: pointer;
}

.instructions strong {
    color: var(--accent);
}

/* Modal Prompt (Popups and Alerts) */
.ui-modal-overlay.z-top {
    z-index: 10001;
}

.ui-modal-content.ui-modal-prompt {
    max-width: 400px;
    text-align: center;
}

.ui-modal-prompt h2 {
    margin-bottom: 15px;
}

.ui-modal-prompt p {
    margin-bottom: 20px;
}

.ui-modal-prompt-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ui-modal-prompt-actions .btn {
    flex: 1;
    justify-content: center;
}

.ui-btn-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 20px;
    color: var(--text-muted, #777);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full, 9999px);
    transition: all 0.2s;
    z-index: 10;
}

.ui-btn-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--error, #ef4444);
    transform: rotate(90deg) scale(1.1);
}

body.dark .ui-btn-close {
    background: rgba(255, 255, 255, 0.08);
    color: #f7fafc;
}

body.dark .ui-btn-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* UI Panels (Side Drawers) */
.ui-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.ui-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ui-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 400px;
    height: 100vh;
    background: var(--card-bg, #ffffff);
    z-index: 9999;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    color: var(--text-main, #333);
}

@media (max-width: 600px) {
    .ui-panel {
        width: 100%;
        right: -100%;
    }
}

.ui-panel.active {
    right: 0;
}

.ui-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--grid-border, #e2e8f0);
    flex-shrink: 0;
}

.ui-panel-header h2 {
    margin: 0;
    font-size: 24px;
}

.btn-preset {
    background: var(--bg-color, #f7fafc);
    border: 1px solid var(--grid-border, #e2e8f0);
    color: var(--text-color, #1a202c);
    padding: 10px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-weight: 500;
}

body.dark .btn-preset {
    background: #2d3748;
    border-color: #4a5568;
    color: #f7fafc;
}

.btn-preset:hover {
    background: var(--grid-border, #e2e8f0);
    transform: translateY(-2px);
}

body.dark .btn-preset:hover {
    background: #4a5568;
}

.badge-specific {
    font-size: 0.8em;
    color: var(--btn-primary-bg, #667eea);
    cursor: help;
    font-weight: bold;
}


/* Override pour les icones personnalisées border-all et border-all-slash */
body .fa-border-all-slash path.fa-secondary,
body .fa-border-all path.fa-secondary {
    opacity: 1;
    fill: currentColor;
}
