/* ==========================================================================
   ACCESSIBILITY PANEL — Template pn_kubar  
   Panel aksesibilitas floating untuk disabilitas
   ========================================================================== */

/* --- Google Font untuk Disleksia --- */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

/* ======================
   1. FLOATING TOGGLE BUTTON
   ====================== */
#accessibility-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #0D47A1);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#accessibility-toggle:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}

#accessibility-toggle:focus {
    outline: 3px solid #FFD600;
    outline-offset: 2px;
}

/* ======================
   2. ACCESSIBILITY PANEL
   ====================== */
#accessibility-panel {
    position: fixed;
    bottom: 90px;
    left: 24px;
    z-index: 9999;
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    border: 1px solid #e0e0e0;
    padding: 0;
    display: none;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#accessibility-panel.acc-open {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Panel Header */
.acc-panel-header {
    background: linear-gradient(135deg, #1565C0, #0D47A1);
    color: #fff;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.acc-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.acc-panel-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.acc-panel-close:hover {
    background: rgba(255,255,255,0.4);
}

/* Panel Body */
.acc-panel-body {
    padding: 16px 20px;
}

/* Feature Section */
.acc-feature {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.acc-feature:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.acc-feature-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.acc-feature-label i {
    font-size: 16px;
    color: #1565C0;
}

/* Button Group */
.acc-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.acc-btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.acc-btn:hover {
    border-color: #1565C0;
    background: #E3F2FD;
    color: #1565C0;
}

.acc-btn:focus {
    outline: 3px solid #FFD600;
    outline-offset: 1px;
}

.acc-btn.acc-active {
    background: #1565C0;
    color: #fff;
    border-color: #1565C0;
}

.acc-btn.acc-active:hover {
    background: #0D47A1;
}

/* Toggle Switch Style */
.acc-toggle-btn {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.acc-toggle-btn:hover {
    border-color: #1565C0;
    background: #E3F2FD;
}

.acc-toggle-btn.acc-active {
    background: #1565C0;
    color: #fff;
    border-color: #1565C0;
}

.acc-toggle-indicator {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.08);
    font-weight: 600;
}

.acc-toggle-btn.acc-active .acc-toggle-indicator {
    background: rgba(255,255,255,0.25);
}

/* TTS Controls */
.acc-tts-controls {
    display: flex;
    gap: 6px;
}

.acc-tts-controls .acc-btn {
    flex: 1;
}

/* Reset All Button */
.acc-reset-btn {
    width: 100%;
    padding: 10px;
    border: 2px solid #ef5350;
    border-radius: 8px;
    background: #fff;
    color: #ef5350;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.acc-reset-btn:hover {
    background: #ef5350;
    color: #fff;
}

/* ======================
   3. DYSLEXIA MODE
   ====================== */
body.acc-dyslexia-mode,
body.acc-dyslexia-mode * {
    font-family: 'Lexend', 'Arial', sans-serif !important;
    letter-spacing: 0.05em !important;
}

body.acc-dyslexia-mode p,
body.acc-dyslexia-mode li,
body.acc-dyslexia-mode td,
body.acc-dyslexia-mode th,
body.acc-dyslexia-mode span,
body.acc-dyslexia-mode div,
body.acc-dyslexia-mode a {
    line-height: 1.8 !important;
    word-spacing: 0.15em !important;
}

/* ======================
   4. COLOR-BLIND MODE (HIGH CONTRAST)
   ====================== */
body.acc-colorblind-mode {
    filter: none !important;
}

body.acc-colorblind-mode * {
    border-color: #000 !important;
}

body.acc-colorblind-mode a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}

body.acc-colorblind-mode a:hover {
    outline: 2px solid #000 !important;
    outline-offset: 2px;
}

body.acc-colorblind-mode img {
    outline: 2px solid #333 !important;
}

/* High Contrast overrides */
body.acc-colorblind-mode .bg-primary,
body.acc-colorblind-mode .bg-warning {
    position: relative;
}

body.acc-colorblind-mode .badge,
body.acc-colorblind-mode .btn {
    border: 2px solid #000 !important;
    font-weight: 700 !important;
}

body.acc-colorblind-mode .text-primary {
    color: #0D47A1 !important;
    text-decoration: underline;
}

body.acc-colorblind-mode .text-warning {
    color: #E65100 !important;
}

body.acc-colorblind-mode .text-danger {
    color: #B71C1C !important;
}

body.acc-colorblind-mode .text-success {
    color: #1B5E20 !important;
}

/* Patterned badges for color-blind */
body.acc-colorblind-mode .badge-light-danger {
    background: repeating-linear-gradient(45deg, #FFCDD2, #FFCDD2 4px, #EF9A9A 4px, #EF9A9A 8px) !important;
    color: #000 !important;
}

body.acc-colorblind-mode .badge-light-warning {
    background: repeating-linear-gradient(-45deg, #FFF9C4, #FFF9C4 4px, #FFE082 4px, #FFE082 8px) !important;
    color: #000 !important;
}

body.acc-colorblind-mode .badge-light-success {
    background: repeating-linear-gradient(90deg, #C8E6C9, #C8E6C9 4px, #A5D6A7 4px, #A5D6A7 8px) !important;
    color: #000 !important;
}

/* ======================
   5. FONT SIZE SCALING
   ====================== */
body.acc-font-scale-90  { font-size: 90% !important; }
body.acc-font-scale-100 { font-size: 100% !important; }
body.acc-font-scale-110 { font-size: 110% !important; }
body.acc-font-scale-120 { font-size: 120% !important; }
body.acc-font-scale-130 { font-size: 130% !important; }
body.acc-font-scale-140 { font-size: 140% !important; }
body.acc-font-scale-150 { font-size: 150% !important; }

/* ======================
   6. RESPONSIVE
   ====================== */
@media (max-width: 480px) {
    #accessibility-panel {
        left: 10px;
        right: 10px;
        width: auto;
        bottom: 86px;
    }

    #accessibility-toggle {
        bottom: 16px;
        left: 16px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
}

/* ======================
   7. TTS HIGHLIGHT
   ====================== */
.acc-tts-highlight {
    background-color: #FFEB3B !important;
    color: #000 !important;
    outline: 2px solid #F57F17;
    border-radius: 3px;
    padding: 0 2px;
}
