/* Panel d'accessibilité - Version compacte et améliorée */
.asrgaa-panel {
    position: fixed;
    top: 100px;
    right: 0;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
}

.asrgaa-toggle {
    background: #0053b3;
    color: white;
    border: none;
    border-radius: 4px 0 0 4px;
    padding: 12px 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10001;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG œil accessibilité */
.asrgaa-toggle::before {
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.asrgaa-toggle:hover::before {
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

.asrgaa-toggle:hover,
.asrgaa-toggle:focus {
    background: #003d82;
    outline: 3px solid #0053b3;
    outline-offset: 2px;
    transform: scale(1.05);
}

.asrgaa-panel-content {
    position: absolute;
    top: 0;
    right: -300px;
    width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    padding: 15px;
    box-shadow: -2px 2px 15px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    visibility: hidden;
    opacity: 0;
}

.asrgaa-panel-content.asrgaa-visible {
    right: 100%;
    visibility: visible;
    opacity: 1;
}

.asrgaa-panel-content h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #0053b3;
}

/* Groupes compacts */
.asrgaa-feature-group {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.asrgaa-feature-group:last-child {
    border-bottom: none;
    margin-bottom: 10px;
}

.asrgaa-feature-group h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.asrgaa-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 6px 0;
}

.asrgaa-control-label {
    font-size: 0.9em;
    color: #333;
    flex: 1;
    line-height: 1.4;
}

/* Contrôles compacts */
.asrgaa-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    max-width: 130px;
    background: white;
}

.asrgaa-control:focus {
    outline: 2px solid #0053b3;
    border-color: #0053b3;
}

.asrgaa-button {
    background: #0053b3;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.asrgaa-button:hover,
.asrgaa-button:focus {
    background: #003d82;
    outline: 2px solid #0053b3;
    outline-offset: 2px;
    transform: translateY(-1px);
}

.asrgaa-button--secondary {
    background: #6c757d;
    font-size: 0.85em;
    padding: 7px 10px;
}

.asrgaa-button--secondary:hover,
.asrgaa-button--secondary:focus {
    background: #545b62;
}

/* Switch compact */
.asrgaa-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}

.asrgaa-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.asrgaa-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s ease;
    border-radius: 22px;
}

.asrgaa-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

input:checked + .asrgaa-slider {
    background-color: #0053b3;
}

input:checked + .asrgaa-slider:before {
    transform: translateX(22px);
}

input:focus + .asrgaa-slider {
    box-shadow: 0 0 0 2px rgba(0, 83, 179, 0.3);
}

/* Styles pour les fonctionnalités */

/* CONTRASTES */
body.asrgaa-high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.asrgaa-high-contrast * {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.asrgaa-dark-contrast {
    background: #000 !important;
    color: #ffff00 !important;
}

body.asrgaa-dark-contrast * {
    background: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

/* TAILLE POLICE */
body.asrgaa-large-font {
    font-size: 120% !important;
}

body.asrgaa-large-font h1,
body.asrgaa-large-font h2,
body.asrgaa-large-font h3 {
    font-size: 140% !important;
}

body.asrgaa-x-large-font {
    font-size: 150% !important;
}

body.asrgaa-x-large-font h1,
body.asrgaa-x-large-font h2,
body.asrgaa-x-large-font h3 {
    font-size: 180% !important;
}

/* RÉDUIRE LES ANIMATIONS (pas les arrêter) */
body.asrgaa-reduce-motion * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
    scroll-behavior: auto !important;
}

/* Les menus et interactions restent fonctionnels */
body.asrgaa-reduce-motion .menu-item:hover,
body.asrgaa-reduce-motion a:hover,
body.asrgaa-reduce-motion button:hover {
    transition-duration: 0.2s !important;
}

/* AIDE CLAVIER VISIBLE */
.asrgaa-keyboard-helper {
    position: fixed;
    top: 15px;
    left: 15px;
    background: #0053b3;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    z-index: 10002;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 2px solid white;
}

.asrgaa-keyboard-helper.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}

.asrgaa-keyboard-helper kbd {
    background: #003d82;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: monospace;
    margin: 0 3px;
    font-size: 0.8em;
    border: 1px solid rgba(255,255,255,0.3);
}

/* MODE CONCENTRATION AMÉLIORÉ */
body.asrgaa-focus-mode {
    position: relative;
}

body.asrgaa-focus-mode::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    z-index: 9998;
    pointer-events: none;
}

body.asrgaa-focus-mode .asrgaa-distraction {
    opacity: 0.3 !important;
    filter: blur(1px) !important;
    transition: all 0.5s ease !important;
}

body.asrgaa-focus-mode main,
body.asrgaa-focus-mode article,
body.asrgaa-focus-mode .content,
body.asrgaa-focus-mode [role="main"] {
    position: relative;
    z-index: 9999;
    background: white;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
    margin: 15px;
    border-radius: 8px;
    padding: 25px;
}

/* Surbrillance des titres */
body.asrgaa-highlight-headings h1,
body.asrgaa-highlight-headings h2,
body.asrgaa-highlight-headings h3 {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 0, 0.3), transparent) !important;
    padding: 10px 15px !important;
    border-left: 4px solid #ffeb3b !important;
    margin-left: -15px !important;
    border-radius: 0 4px 4px 0 !important;
}

/* Curseur très visible */
body.asrgaa-big-cursor,
body.asrgaa-big-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="15" fill="%230053b3" fill-opacity="0.3"/><circle cx="16" cy="16" r="8" fill="%230053b3" fill-opacity="0.6"/><circle cx="16" cy="16" r="3" fill="%230053b3"/></svg>') 16 16, pointer !important;
}

/* Mode daltonien amélioré */
body.asrgaa-protanopia {
    filter: saturate(0.8) hue-rotate(10deg);
}

body.asrgaa-deuteranopia {
    filter: saturate(0.7) hue-rotate(25deg);
}

body.asrgaa-tritanopia {
    filter: saturate(0.6) hue-rotate(45deg);
}

/* Espacement du texte */
body.asrgaa-spacing-enabled {
    letter-spacing: 0.1em !important;
    line-height: 1.8 !important;
    word-spacing: 0.2em !important;
}

/* Soulignement des liens */
body.asrgaa-underline-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}

/* Guide de lecture */
.asrgaa-reading-guide {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0053b3, #00b3b3);
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,83,179,0.5);
}

/* Liens mis en évidence */
.asrgaa-links-visible a {
    outline: 3px dashed #0053b3 !important;
    padding: 3px !important;
    margin: 1px !important;
    border-radius: 3px !important;
}

/* Navigation clavier améliorée */
.asrgaa-focus-visible :focus {
    outline: 3px solid #0053b3 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 4px rgba(0, 83, 179, 0.3) !important;
}

/* Animation pour l'apparition */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE - MOBILE */
@media (max-width: 768px) {
    .asrgaa-panel {
        top: auto;
        bottom: 20px;
        left: 20px;
    }
    
    .asrgaa-toggle {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        font-size: 22px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        padding: 0;
    }
    
    .asrgaa-panel-content {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 320px;
        max-height: 80vh;
        right: auto;
        border-radius: 12px;
        border: 2px solid #ddd;
        padding: 20px;
    }
    
    .asrgaa-panel-content.asrgaa-visible {
        right: auto;
        transform: translate(-50%, -50%);
        animation: fadeIn 0.3s ease;
    }
    
    .asrgaa-keyboard-helper {
        top: 10px;
        left: 10px;
        right: 10px;
        font-size: 0.8em;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .asrgaa-panel-content {
        width: 95vw;
        padding: 15px;
    }
    
    .asrgaa-control-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .asrgaa-control {
        max-width: 100%;
        width: 100%;
    }
    
    .asrgaa-feature-group h4 {
        font-size: 0.95em;
    }
    
    .asrgaa-control-label {
        font-size: 0.85em;
    }
    
    .asrgaa-button {
        padding: 10px;
        font-size: 0.9em;
    }
}

/* Overlay mobile */
.asrgaa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    display: none;
}

.asrgaa-overlay.visible {
    display: block;
}

/* Texte caché pour lecteurs d'écran - Version spécifique au plugin */
.asrgaa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Amélioration de la scrollbar */
.asrgaa-panel-content::-webkit-scrollbar {
    width: 6px;
}

.asrgaa-panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.asrgaa-panel-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.asrgaa-panel-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}