/* KissBooK Phase 3 — Dark Mode & Accessibility */

:root {
    /* Accessibility Variables */
    --kb-a11y-font: inherit;
    --kb-a11y-spacing: normal;
    --kb-a11y-contrast: normal;
}

/* -------------------
   1. DARK MODE
------------------- */
body.kb-dark-mode {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

body.kb-dark-mode .kbh-page,
body.kb-dark-mode .kbg-page,
body.kb-dark-mode .kbr-swipe-card,
body.kb-dark-mode .kbt-player-container,
body.kb-dark-mode .kb-window {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
}

body.kb-dark-mode input,
body.kb-dark-mode textarea,
body.kb-dark-mode select {
    background-color: #0f172a !important;
    color: #fff !important;
    border-color: #334155 !important;
}

body.kb-dark-mode a {
    color: #818cf8 !important;
}

body.kb-dark-mode h1,
body.kb-dark-mode h2,
body.kb-dark-mode h3,
body.kb-dark-mode h4,
body.kb-dark-mode h5,
body.kb-dark-mode h6 {
    color: #f8fafc !important;
}

/* -------------------
   2. ACCESSIBILITY 
------------------- */

/* Dyslexia Font */
body.kb-a11y-dyslexic * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
    line-height: 1.6 !important;
}

/* Large Text */
body.kb-a11y-large-text {
    font-size: 120% !important;
}
body.kb-a11y-large-text h1 { font-size: 2.5em !important; }
body.kb-a11y-large-text h2 { font-size: 2em !important; }
body.kb-a11y-large-text p { font-size: 1.2em !important; }

/* High Contrast */
body.kb-a11y-high-contrast {
    background-color: #000 !important;
    color: #0f0 !important;
}
body.kb-a11y-high-contrast * {
    background-color: transparent !important;
    color: inherit !important;
    border-color: #0f0 !important;
}
body.kb-a11y-high-contrast img,
body.kb-a11y-high-contrast video {
    filter: contrast(150%) grayscale(100%);
}

/* Pause Animations */
body.kb-a11y-no-animations * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

/* Accessibility Menu Floating Button */
#kb-a11y-toggle {
    position: fixed;
    bottom: 85px; /* Above bottom nav */
    right: 20px;
    width: 50px;
    height: 50px;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: var(--kb-z-overlay);
    border: 2px solid rgba(255,255,255,0.2);
    transition: transform 0.2s;
}
#kb-a11y-toggle:hover {
    transform: scale(1.1);
}

#kb-a11y-menu {
    position: fixed;
    bottom: 145px;
    right: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 15px;
    z-index: var(--kb-z-overlay);
    width: 250px;
    display: none;
    flex-direction: column;
    gap: 10px;
    border: 1px solid #e2e8f0;
}
body.kb-dark-mode #kb-a11y-menu {
    background: #1e293b;
    border-color: #334155;
    color: #fff;
}

.kb-a11y-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #334155;
    transition: all 0.2s;
}
body.kb-dark-mode .kb-a11y-btn {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
.kb-a11y-btn.active {
    background: #e0e7ff;
    border-color: #818cf8;
    color: #4f46e5;
}
body.kb-dark-mode .kb-a11y-btn.active {
    background: #3730a3;
    border-color: #4f46e5;
    color: #fff;
}
