/* ============================================
   BARRE D'OUTILS ACCESSIBILITÉ - VERSION SIMPLIFIÉE
   Interface utilisateur intuitive et pédagogique
   ============================================ */

/* ====================================
   CONTENEUR PRINCIPAL
   ==================================== */

.accessibility-toolbar {
    position: relative;
    z-index: 10;
}

/* ====================================
   PANNEAU DE CONTENU
   ==================================== */

.toolbar-content {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
}

.accessibility-toolbar.open .toolbar-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ====================================
   HEADER DU PANNEAU
   ==================================== */

.toolbar-header {
    background: #2270b2;
    color: #fff;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
}

.toolbar-header .material-icons {
    font-size: 1.5rem;
}

/* ====================================
   GROUPES DE CONTRÔLES
   ==================================== */

.control-group {
    padding: 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.control-group:last-child {
    border-bottom: none;
}

/* Header de chaque groupe */
.control-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.control-header .material-icons {
    font-size: 1.5rem;
    margin-top: 2px;
}

.control-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
    margin-bottom: 0.25rem;
    display: block;
}

.control-description {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.3;
}

/* ====================================
   BOUTONS DE TAILLE
   ==================================== */

.size-options {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.size-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    color: #495057;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.size-btn:focus-visible {
    outline: 3px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.size-btn.active {
    background-color: #2270b2;
    border-color: #fff;
    color: #fff;
}

.size-btn.active:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
}

/* Icônes dans les boutons de taille d'affichage */
.size-btn[data-size] .material-icons {
    font-size: 1.25rem;
}

.size-btn[data-size="small"] .material-icons {
    font-size: 1rem;
}

.size-btn[data-size="large"] .material-icons {
    font-size: 1.5rem;
}

/* Prévisualisation de police */
.font-preview {
    font-weight: 600;
    display: block;
    line-height: 1;
}

.small-preview {
    font-size: 1rem;
}

.normal-preview {
    font-size: 1.25rem;
}

.large-preview {
    font-size: 1.5rem;
}

/* ====================================
   BOUTON DE RÉINITIALISATION
   ==================================== */

.reset-control {
    display: none;
    padding: 1rem 1.25rem;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.reset-control.show {
    display: block;
}

.reset-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #fff;
    border: 2px solid #dc3545;
    border-radius: 8px;
    color: #dc3545;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background-color: #dc3545;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.reset-btn:focus-visible {
    outline: 3px solid rgba(220, 53, 69, 0.5);
    outline-offset: 2px;
}

.reset-btn .material-icons {
    font-size: 1.125rem;
}

/* ====================================
   RESPONSIVE - TABLETTES
   ==================================== */

@media (max-width: 991px) {
    .toolbar-content {
        width: 300px;
    }
    
    .control-description {
        font-size: 0.75rem;
    }
    
    .size-btn {
        padding: 0.625rem 0.375rem;
        font-size: 0.8rem;
    }
}

/* ====================================
   RESPONSIVE - MOBILES
   ==================================== */

@media (max-width: 767px) {
    .toolbar-content {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .accessibility-toolbar.open .toolbar-content {
        transform: translateY(0);
    }
    
    /* Backdrop mobile */
    .accessibility-toolbar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        animation: fadeIn 0.3s ease;
    }
    
    .toolbar-header {
        border-radius: 16px 16px 0 0;
    }
    
    .size-options {
        flex-direction: row;
    }
    
    .size-btn {
        min-width: 0;
    }
}

/* ====================================
   ACCESSIBILITÉ - CONTRASTE ÉLEVÉ
   ==================================== */

@media (prefers-contrast: high) {
    .toolbar-content {
        border: 3px solid #000;
    }
    
    .toolbar-header {
        background: #000;
        border-bottom: 3px solid #fff;
    }
    
    .size-btn {
        border-width: 3px;
    }
    
    .size-btn.active {
        background-color: #000;
        border-color: #000;
    }
    
    .reset-btn {
        border-width: 3px;
    }
}

/* ====================================
   MODE SOMBRE
   ==================================== */

@media (prefers-color-scheme: dark) {
    .toolbar-content {
        background-color: #212529;
        border-color: #495057;
    }
    
    .toolbar-header {
        background: linear-gradient(135deg, #0d6efd0%, #084298 100%);
    }
    
    .control-label {
        color: #f8f9fa;
    }
    
    .control-description {
        color: #adb5bd;
    }
    
    .control-group {
        border-bottom-color: #495057;
    }
    
    .size-btn {
        background-color: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .size-btn:hover {
        background-color: #495057;
        border-color: #6c757d;
    }
    
    .size-btn.active {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }
    
    .reset-control {
        background-color: #1a1d20;
    }
    
    .reset-btn {
        background-color: #212529;
        border-color: #dc3545;
        color: #dc3545;
    }
    
    .reset-btn:hover {
        background-color: #dc3545;
        color: #fff;
    }
}

/* ====================================
   RÉDUCTION DU MOUVEMENT
   ==================================== */

@media (prefers-reduced-motion: reduce) {
    .toolbar-content,
    .size-btn,
    .reset-btn {
        transition: none;
        animation: none;
    }
    
    .size-btn:hover,
    .reset-btn:hover {
        transform: none;
    }
    
    .accessibility-toolbar.open::before {
        animation: none;
    }
}

/* ====================================
   ANIMATION FADEIN
   ==================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}