/* ══════════════════════════════════════════════════════════════════
   ACCESSIBILITY TOOLBAR & INCLUSIVE STYLES - SLBN 3 JAKARTA
   ══════════════════════════════════════════════════════════════════ */

/* ── 1. Skip to Content Link (Screen Readers) ── */
.skip-to-content {
    position: fixed;
    top: -80px;
    left: 20px;
    background: #059669;
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 800;
    z-index: 999999;
    transition: top 0.25s ease;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    border: 2px solid #ffffff;
}
.skip-to-content:focus {
    top: 20px;
    outline: 3px solid #facc15;
}

/* ── 2. Font Scaling ── */
html.font-size-sm { font-size: 90% !important; }
html.font-size-md { font-size: 100% !important; }
html.font-size-lg, html.font-size-large { font-size: 114% !important; }
html.font-size-xl, html.font-size-xlarge { font-size: 128% !important; }

/* ── 3. High Contrast Mode (WCAG Black & Yellow / Crisp Contrast) ── */
body.accessibility-contrast {
    background-color: #0a0a0a !important;
    color: #ffff00 !important;
}
body.accessibility-contrast *:not(.hero-live-header-bar *):not(.fa):not(.fas):not(.far):not(.fab):not(.a11y-panel *):not(.a11y-float-btn) {
    background-color: #121212 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
body.accessibility-contrast a {
    color: #38bdf8 !important;
    text-decoration: underline !important;
}
body.accessibility-contrast button {
    border: 2px solid #ffff00 !important;
    color: #ffff00 !important;
}
body.accessibility-contrast img {
    filter: contrast(125%) brightness(95%);
}

/* ── 4. Dyslexia Friendly Mode ── */
body.accessibility-dyslexia,
body.accessibility-dyslexia * {
    font-family: 'Comic Sans MS', 'Trebuchet MS', 'Arial', sans-serif !important;
    letter-spacing: 0.06em !important;
    word-spacing: 0.12em !important;
    line-height: 1.8 !important;
}

/* ── 5. Reading Ruler (Garis Pemandu Baca untuk ADHD/Autis) ── */
#accessibility-reading-ruler {
    position: fixed;
    left: 0;
    width: 100vw;
    height: 40px;
    background: rgba(250, 204, 21, 0.22);
    border-top: 2px solid #f59e0b;
    border-bottom: 2px solid #f59e0b;
    pointer-events: none;
    z-index: 999998;
    display: none;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

/* ── 6. Reduced Motion Support ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
}
body.accessibility-no-motion *,
body.accessibility-no-motion *::before,
body.accessibility-no-motion *::after {
    animation: none !important;
    transition: none !important;
}

/* ── 7. Floating Accessibility Widget & Panel ── */
.a11y-float-btn, .a11y-btn-floating {
    position: fixed;
    bottom: 86px;
    left: 24px;
    z-index: 99998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}
.a11y-float-btn:hover, .a11y-btn-floating:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.55);
}
.a11y-badge-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    animation: a11yPulse 2.5s infinite;
    pointer-events: none;
}
@keyframes a11yPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.18); opacity: 0.15; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Panel Modal / Flyout */
.a11y-panel {
    position: fixed;
    bottom: 146px;
    left: 24px;
    width: 320px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
    border: 1.5px solid #e2e8f0;
    z-index: 99999;
    padding: 18px;
    display: none;
    animation: a11ySlideUp 0.3s ease;
}
@keyframes a11ySlideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.a11y-panel.active {
    display: block;
}
.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 14px;
}
.a11y-panel-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.a11y-close-btn, .a11y-panel-close {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: #64748b;
    cursor: pointer;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.a11y-close-btn:hover, .a11y-panel-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Tool Rows */
.a11y-tool-row, .a11y-group {
    margin-bottom: 12px;
}
.a11y-tool-label, .a11y-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    display: block;
}
.a11y-btn-group {
    display: flex;
    gap: 6px;
}
.a11y-opt-btn, .a11y-btn-opt {
    flex: 1;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}
.a11y-opt-btn:hover, .a11y-btn-opt:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.a11y-opt-btn.active, .a11y-btn-opt.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25);
}

.a11y-tts-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 12px;
}

.a11y-reset-btn {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
    background: #ffffff;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}
.a11y-reset-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

@media (max-width: 576px) {
    .a11y-float-btn {
        bottom: 76px;
        left: 16px;
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    .a11y-panel {
        left: 16px;
        bottom: 130px;
    }
}
