/* ===========================================
   ACCESSIBILITY STYLES
   =========================================== */

/* OpenDyslexic Font Import */
@import url('https://fonts.cdnfonts.com/css/opendyslexic');

/* CSS Variables for theming */
:root {
    --bg-primary: #e5e7eb;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #6366f1;
    --border-color: #e2e8f0;
    --font-base-size: 1rem;

    /* RTTI Default Colors */
    --rtti-color-r: #3b82f6;
    /* Blue */
    --rtti-color-t1: #22c55e;
    /* Green */
    --rtti-color-t2: #eab308;
    /* Yellow */
    --rtti-color-i: #ef4444;
    /* Red */
}

/* ===========================================
   COLORBLIND MODE
   =========================================== */
body.colorblind-mode {
    /* IBM Colorblind Safe Palette */
    --rtti-color-r: #648FFF;
    /* Blue */
    --rtti-color-t1: #FFB000;
    /* Gold */
    --rtti-color-t2: #FE6100;
    /* Orange */
    --rtti-color-i: #785EF0;
    /* Purple */
}

/* ===========================================
   DYSLEXIA MODE
   =========================================== */
body.dyslexia-mode {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Arial', sans-serif !important;
    letter-spacing: 0.05em;
    word-spacing: 0.1em;
}

body.dyslexia-mode * {
    font-family: inherit !important;
}

/* Exclude icons from dyslexia font */
body.dyslexia-mode svg,
body.dyslexia-mode [class*="lucide"] {
    font-family: initial !important;
}

/* Increase line height for better readability */
body.dyslexia-mode p,
body.dyslexia-mode li,
body.dyslexia-mode div,
body.dyslexia-mode span {
    line-height: 1.8 !important;
}

/* ===========================================
   HIGH CONTRAST MODE
   =========================================== */
body.high-contrast {
    --bg-primary: #000000;
    --bg-secondary: #ffffff;
    --text-primary: #000000;
    --text-secondary: #000000;
    --accent-primary: #000000;
    --accent-secondary: #000000;
    --border-color: #000000;
}

body.high-contrast {
    background-color: #ffffff !important;
}

body.high-contrast .bg-slate-50,
body.high-contrast .bg-slate-100,
body.high-contrast .bg-gray-50,
body.high-contrast .bg-gray-100 {
    background-color: #ffffff !important;
}

body.high-contrast .bg-slate-800,
body.high-contrast .bg-slate-900,
body.high-contrast .bg-gray-800,
body.high-contrast .bg-gray-900,
body.high-contrast [class*="bg-blue-"],
body.high-contrast [class*="bg-indigo-"],
body.high-contrast [class*="bg-purple-"] {
    background-color: #000000 !important;
    color: #ffffff !important;
}

body.high-contrast .text-slate-500,
body.high-contrast .text-slate-600,
body.high-contrast .text-gray-500,
body.high-contrast .text-gray-600 {
    color: #000000 !important;
}

body.high-contrast button,
body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea {
    border: 2px solid #000000 !important;
}

body.high-contrast a {
    color: #000000 !important;
    text-decoration: underline !important;
}

/* Ensure text is always readable in high contrast */
body.high-contrast .shadow-lg,
body.high-contrast .shadow-xl,
body.high-contrast .shadow-2xl {
    box-shadow: 0 0 0 2px #000000 !important;
}

/* ===========================================
   FONT SIZE MODES
   =========================================== */
body.font-size-normal {
    --font-base-size: 1rem;
}

body.font-size-large {
    --font-base-size: 1.125rem;
}

body.font-size-large {
    --font-base-size: 1.125rem;
}

body.font-size-large {
    font-size: var(--font-base-size);
}

body.font-size-large p,
body.font-size-large div,
body.font-size-large span,
body.font-size-large li {
    font-size: 1.1em;
}

/* ===========================================
   PRINT STYLES - Reset accessibility for print
   =========================================== */
@media print {

    body.dyslexia-mode,
    body.dyslexia-mode * {
        font-family: 'Arial', sans-serif !important;
    }

    body.high-contrast {
        background-color: white !important;
    }

    body.high-contrast * {
        color: black !important;
        background-color: transparent !important;
    }
}

/* ===========================================
   OFFLINE INDICATOR STYLES
   =========================================== */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===========================================
   TRANSITION ANIMATION FOR SETTINGS CHANGES
   =========================================== */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}