/* Accessibilité - RLN Formation */

/* Variables pour l'accessibilité */
:root {
    --line-height: 1.6;
    --letter-spacing: normal;
}

/* Appliquer les variables */
body {
    line-height: var(--line-height);
    letter-spacing: var(--letter-spacing);
}

/* Bouton d'accessibilité */
.accessibility-toggle {
    position: fixed;
    bottom: 100px; /* Au-dessus du bouton dark mode */
    left: 30px;
    width: 60px;
    height: 60px;
    background: #77021D; /* Bordeaux comme le site */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(119, 2, 29, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(119, 2, 29, 0.4);
}

.accessibility-toggle i {
    font-size: 1.5rem;
    color: white;
}

/* Panneau d'accessibilité */
.accessibility-panel {
    position: fixed;
    bottom: 170px; /* Au-dessus du bouton */
    left: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 998;
}

.accessibility-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du panneau */
.accessibility-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.accessibility-panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.accessibility-panel-header h3 i {
    color: #77021D;
}

.accessibility-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.accessibility-panel-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Contenu du panneau */
.accessibility-panel-content {
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

/* Option d'accessibilité */
.accessibility-option {
    margin-bottom: 1.5rem;
}

.accessibility-option:last-child {
    margin-bottom: 0;
}

.accessibility-option label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.accessibility-option label i {
    color: #77021D;
}

/* Boutons d'options */
.accessibility-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.accessibility-btn {
    flex: 1;
    min-width: fit-content;
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.accessibility-btn:hover {
    background: #e5e7eb;
    border-color: #77021D;
}

.accessibility-btn.active {
    background: #77021D;
    border-color: #77021D;
    color: white;
}

.accessibility-btn i {
    font-size: 1rem;
}

/* Icône de lecture vocale */
.voice-read-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    background: #77021D;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.5rem;
    margin-left: 6px;
    transition: all 0.2s ease;
    opacity: 0.7;
    vertical-align: middle;
    flex-shrink: 0;
}

.voice-read-icon:hover {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(119, 2, 29, 0.3);
}

.voice-read-icon i {
    pointer-events: none;
    font-size: 0.5rem !important;
    color: white !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    height: 100%;
}

/* Correction pour les sections centrées */
.advantage h3,
.advantage p {
    display: inline-block;
    text-align: center;
}

.advantages-grid .voice-read-icon i {
    margin-top: 15px;
}

.contact-info-row .voice-read-icon i {
    margin-top: 5px;
}

.contact-info-row .voice-read-icon {
    background: #77021D !important;
}

/* Bouton toggle (lecteur vocal) */
.accessibility-toggle-btn {
    width: 100%;
    padding: 1rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.accessibility-toggle-btn:hover {
    background: #e5e7eb;
    border-color: #77021D;
}

.accessibility-toggle-btn.active {
    background: #77021D;
    border-color: #77021D;
    color: white;
}

/* Bouton réinitialiser */
.accessibility-reset-btn {
    width: 100%;
    padding: 1rem;
    background: #ef4444;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.accessibility-reset-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Mode contraste élevé */
body.high-contrast {
    --text-dark: #000000;
    --text-light: #1a1a1a;
}

/* Améliore le contraste sans casser le design */
body.high-contrast .hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

body.high-contrast .hero-title,
body.high-contrast .hero-subtitle {
    color: #000000 !important;
    text-shadow: none !important;
}

body.high-contrast .btn-primary {
    background: #77021D !important;
    color: #ffffff !important;
    border: 3px solid #000000 !important;
    font-weight: 700 !important;
}

body.high-contrast .btn-outline {
    background: #ffffff !important;
    color: #000000 !important;
    border: 3px solid #000000 !important;
    font-weight: 700 !important;
}

body.high-contrast a {
    color: #77021D !important;
    font-weight: 600 !important;
    text-decoration: underline;
}

body.high-contrast .nav-link {
    color: #ffffff !important;
    font-weight: 700 !important;
}

body.high-contrast .formation-card,
body.high-contrast .testimonial-card,
body.high-contrast .feature {
    border: 2px solid #000000 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4 {
    color: #000000 !important;
    font-weight: 800 !important;
}

body.high-contrast p,
body.high-contrast li,
body.high-contrast span {
    color: #1a1a1a !important;
}

/* Forcer les fonds clairs en mode contraste élevé (light mode) */
body.high-contrast .about,
body.high-contrast .formations,
body.high-contrast .advantages,
body.high-contrast .testimonials,
body.high-contrast .contact,
body.high-contrast .cta,
body.high-contrast .footer {
    background: #ffffff !important;
}

body.high-contrast .formation-card,
body.high-contrast .testimonial-card,
body.high-contrast .feature,
body.high-contrast .advantage {
    background: #f8f9fa !important;
}

body.high-contrast .header {
    background: #222222 !important; /* Garde le header noir */
}

body.high-contrast .footer {
    background: #f8f9fa !important; /* Footer clair */
}

body.high-contrast .footer h3,
body.high-contrast .footer p,
body.high-contrast .footer a {
    color: #000000 !important;
}

/* Mode contraste élevé + Dark mode */
html.dark body.high-contrast {
    --text-dark: #ffffff;
    --text-light: #e5e5e5;
}

html.dark body.high-contrast .hero {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%) !important;
}

html.dark body.high-contrast .hero-title,
html.dark body.high-contrast .hero-subtitle {
    color: #ffffff !important;
}

html.dark body.high-contrast .btn-primary {
    background: #77021D !important;
    color: #ffffff !important;
    border: 3px solid #ffffff !important;
}

html.dark body.high-contrast .btn-outline {
    background: transparent !important;
    color: #ffffff !important;
    border: 3px solid #ffffff !important;
}

html.dark body.high-contrast a {
    color: #ff6b6b !important; /* Rouge plus clair pour le dark mode */
    font-weight: 600 !important;
}

html.dark body.high-contrast .nav-link {
    color: #ffffff !important;
    font-weight: 700 !important;
}

html.dark body.high-contrast .formation-card,
html.dark body.high-contrast .testimonial-card,
html.dark body.high-contrast .feature {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2) !important;
}

html.dark body.high-contrast h1,
html.dark body.high-contrast h2,
html.dark body.high-contrast h3,
html.dark body.high-contrast h4 {
    color: #ffffff !important;
    font-weight: 800 !important;
}

html.dark body.high-contrast p,
html.dark body.high-contrast li,
html.dark body.high-contrast span {
    color: #e5e5e5 !important;
}

html.dark body.high-contrast .about,
html.dark body.high-contrast .formations,
html.dark body.high-contrast .advantages,
html.dark body.high-contrast .testimonials,
html.dark body.high-contrast .contact,
html.dark body.high-contrast .cta,
html.dark body.high-contrast body {
    background: #000000 !important;
}

html.dark body.high-contrast .header {
    background: #000000 !important;
    border-bottom: 2px solid #ffffff !important;
}

html.dark body.high-contrast .footer {
    background: #000000 !important;
    border-top: 2px solid #ffffff !important;
}

html.dark body.high-contrast .footer h3,
html.dark body.high-contrast .footer p,
html.dark body.high-contrast .footer a,
html.dark body.high-contrast .footer-bottom p {
    color: #ffffff !important;
}

html.dark body.high-contrast .advantage {
    background: #1a1a1a !important;
    border: 2px solid #ffffff !important;
}

html.dark body.high-contrast .stat-number,
html.dark body.high-contrast .stat-label {
    color: #ffffff !important;
}

html.dark body.high-contrast .section-header h2,
html.dark body.high-contrast .section-header p {
    color: #ffffff !important;
}

html.dark body.high-contrast .about-text h3,
html.dark body.high-contrast .about-text p {
    color: #ffffff !important;
}

html.dark body.high-contrast strong {
    color: #ffffff !important;
}

html.dark body.high-contrast .testimonial-author strong {
    color: #ffffff !important;
}

html.dark body.high-contrast .contact-item h3 {
    color: #ffffff !important;
}

/* Dark mode pour le panneau d'accessibilité */
html.dark .accessibility-panel {
    background: #1f2937;
    color: #f3f4f6;
}

html.dark .accessibility-panel-header {
    border-bottom-color: #374151;
}

html.dark .accessibility-panel-header h3 {
    color: #f3f4f6;
}

html.dark .accessibility-panel-close {
    color: #9ca3af;
}

html.dark .accessibility-panel-close:hover {
    background: #374151;
    color: #f3f4f6;
}

html.dark .accessibility-option label {
    color: #e5e7eb;
}

html.dark .accessibility-btn {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

html.dark .accessibility-btn:hover {
    background: #4b5563;
}

html.dark .accessibility-btn.active {
    background: #77021D;
    border-color: #77021D;
    color: white;
}

html.dark .accessibility-toggle-btn {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

html.dark .accessibility-toggle-btn:hover {
    background: #4b5563;
}

html.dark .accessibility-toggle-btn.active {
    background: #77021D;
    border-color: #77021D;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .accessibility-toggle {
        width: 50px;
        height: 50px;
        bottom: 80px; /* Au-dessus du bouton dark mode mobile */
        left: 20px;
    }

    .accessibility-toggle i {
        font-size: 1.2rem;
    }

    .accessibility-panel {
        bottom: 140px;
        left: 20px;
        width: calc(100vw - 40px);
    }

    .accessibility-panel-content {
        max-height: 400px;
    }

    .accessibility-buttons {
        flex-direction: column;
    }

    .accessibility-btn {
        width: 100%;
    }
}

/* ==========================================
   FILTRES DALTONIENS OPTIMISÉS
   Préserve position sticky/fixed
   ========================================== */

/* Appliquer le filtre uniquement aux éléments de contenu, pas au body */
body.colorblind-protanopia .header,
body.colorblind-protanopia main,
body.colorblind-protanopia footer,
body.colorblind-protanopia section {
    filter: url(#protanopia-filter);
}

body.colorblind-deuteranopia .header,
body.colorblind-deuteranopia main,
body.colorblind-deuteranopia footer,
body.colorblind-deuteranopia section {
    filter: url(#deuteranopia-filter);
}

body.colorblind-tritanopia .header,
body.colorblind-tritanopia main,
body.colorblind-tritanopia footer,
body.colorblind-tritanopia section {
    filter: url(#tritanopia-filter);
}

/* Exclure les éléments de contrôle du filtre */
body[class*="colorblind-"] #accessibility-toggle,
body[class*="colorblind-"] #accessibility-panel,
body[class*="colorblind-"] #theme-toggle,
body[class*="colorblind-"] .scroll-to-top {
    filter: none !important;
}

/* Préserver les performances du sticky */
.header {
    will-change: auto;
    transform: translateZ(0);
}

/* S'assurer que le filtre n'interfère pas avec position sticky */
body[class*="colorblind-"] .header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
}
