/**
 * Frontend Appearance Settings Panel
 * Styles for the frontend customization interface
 */

/* Ensure Bootstrap modal appears above the settings panel overlay */
/* #resetSettingsModal {
    z-index: 1999999 !important;
}
#resetSettingsModal + .modal-backdrop,
.modal-backdrop {
    z-index: 1999990 !important;
} */

/* Settings Panel Container */
.globec-settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.globec-settings-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Settings Overlay */
.settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Settings Container */
.settings-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.globec-settings-panel.active .settings-container {
    transform: translate(-50%, -50%) scale(1);
}

/* Settings Header */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
}

.settings-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color, #1a1a1a);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-color, #666);
    cursor: pointer;
    padding: 0;
    /* WCAG 2.5.5: minimum 44×44px touch target */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--border-color, #f0f0f0);
    color: var(--text-color, #000);
}

/* Settings Content */
.settings-content {
    padding: 24px;
}

/* Setting Groups */
.setting-group {
    margin-bottom: 32px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-weight: 600;
    color: var(--text-color, #1a1a1a);
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Theme Mode Options */
.theme-mode-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.theme-option {
    background: var(--secondary-bg, #f8f9fa);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.theme-option:hover {
    background: var(--border-color, #e5e5e5);
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: var(--accent-color, #1e3a8a);
    background: var(--accent-color, #1e3a8a);
    color: white;
}

.theme-option .icon {
    font-size: 20px;
}

.theme-option .label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Font Size Control */
.font-size-control {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#font-size-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color, #e5e5e5);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#font-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color, #1e3a8a);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#font-size-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color, #1e3a8a);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Font Presets */
.font-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.preset-btn {
    background: var(--secondary-bg, #f8f9fa);
    border: 1px solid color-mix(in srgb, var(--link-color) 20%, transparent);
    border-radius: 8px;
    padding: 6px 10px;
    /* WCAG 2.5.5: minimum 44px height touch target */
    min-height: 36px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--text-color, #1a1a1a);
}

.preset-btn:hover {
    border-color: var(--accent-color, #1e3a8a);
    background: var(--accent-color, #1e3a8a);
    color: white;
}

.preset-btn.active {
    border-color: var(--accent-color, #1e3a8a);
    background: var(--accent-color, #1e3a8a);
    color: white;
}

/* Checkbox Options */
.checkbox-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color, #1a1a1a);
}

.checkbox-label input[type="checkbox"] {
    /* Visually hidden but still keyboard and screen-reader accessible */
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color, #e5e5e5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-color, #1e3a8a);
    border-color: var(--accent-color, #1e3a8a);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label input[type="checkbox"]:focus + .checkmark {
    outline: 2px solid var(--accent-color, #1e3a8a);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.25);
}

.checkbox-label input[type="checkbox"]:focus + .checkmark {
    outline: 2px solid var(--accent-color, #1e3a8a);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.25);
}

/* Setting descriptions for screen readers & cognitive accessibility */
/* WCAG 1.4.3: use explicit #595959 on white = 7:1 contrast — do NOT use opacity reduction */
.setting-desc {
    margin: 2px 0 12px 32px;
    font-size: 12px;
    color: #595959;
    line-height: 1.4;
}

/* Range slider focus rings (WCAG 2.4.7 Focus Visible) */
#font-size-slider:focus-visible,
#line-height-slider:focus-visible,
#letter-spacing-slider:focus-visible,
#word-spacing-slider:focus-visible {
    outline: 3px solid var(--accent-color, #1e3a8a);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Line Height slider (reuses font-size-slider styles) */
#line-height-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color, #e5e5e5);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    display: block;
    margin-top: 8px;
}

#line-height-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color, #1e3a8a);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#line-height-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color, #1e3a8a);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Letter-spacing & word-spacing sliders (WCAG 1.4.12) */
#letter-spacing-slider,
#word-spacing-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color, #e5e5e5);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    display: block;
    margin-top: 8px;
}

#letter-spacing-slider::-webkit-slider-thumb,
#word-spacing-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color, #1e3a8a);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#letter-spacing-slider::-moz-range-thumb,
#word-spacing-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color, #1e3a8a);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Screen-reader-only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Dyslexia / reading-ease font body class (Lexend — Google Fonts) */
body.dyslexia-font,
body.dyslexia-font p,
body.dyslexia-font li,
body.dyslexia-font input,
body.dyslexia-font textarea,
body.dyslexia-font select {
    font-family: "Lexend", "Arial", sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

/* Windows / OS High Contrast — honour OS-level setting */
@media (forced-colors: active) {
    body { forced-color-adjust: auto; }
}

/* Colour-blind friendly palette (deuteranopia/protanopia safe: blue–orange, no red-green) */
/* Light Theme - Colour-Blind Mode */
body.theme-mode-light.colour-blind-mode {
    --body-bg: #ffffff;
    --letter-spacing: 0em;
    --word-spacing: 0em;
    --bg-color: #ffffff;
    --text-color: #262424;
    --border-color: #bbd7f6;
    --accent-color: #1e3a8a;
    --secondary-bg: #f8f9fa;
    --section-bg: #f8f9fa;
    --section-secondary-bg: #f8f9fa;
    --card-bg: #ffffff;
    --card-color: #262424;
    --card-reverse-bg: #ffffff;
    --card-reverse-color: #262424;
    --card-border: #ecf7fc;
    --card-secondary-bg: #ffffff;
    --card-secondary-color: #262424;
    --card-secondary-border: #ecf7fc;
    --link-color: #1e7ae0;
    --link-hover-color: #1e40af;
    --caption-color: #1e3a8a;
    --button-bg: #1e3a8a;
    --button-text: #ffffff;
    --button-hover-bg: #1e40af;
    --button-hover-text: #ffffff;
    --input-bg: #ffffff;
    --input-text: #262424;
    --input-border: #e5e5e5;
    --input-focus-border: #1e3a8a;
    --input-placeholder: #999999;
    --header-bg: #ffffff;
    --header-text: #262424;
    --footer-bg: #f8f9fa;
    --footer-text: #262424;
    --nav-bg: #ffffff;
    --nav-text: #262424;
    --nav-hover-bg: #f8f9fa;
    --nav-hover-text: #262424;
    --table-header-bg: #f8f9fa;
    --table-header-text: #262424;
    --table-row-bg: #ffffff;
    --table-row-alt-bg: #f8f9fa;
    --table-row-text: #262424;
    --table-row-hover-bg: #f1f1f1;
    --table-row-hover-text: #262424;
    --blockquote-bg: #f8f9fa;
    --blockquote-border: #e5e5e5;
    --blockquote-text: #262424;
    --code-bg: #f1f1f1;
    --code-text: #262424;
    --code-border: #e5e5e5;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --success-bg: #d4edda;
    --error-bg: #f8d7da;
    --warning-bg: #fff3cd;
    --info-bg: #d1ecf1;
    --blue-color: #1e7ae0;
    --grey-color: #262424;
    --yellow-color: #fdf6c9;
    --light-blue-color: #bbd7f6;
    --light-white-color: #f9fafb;
    --sky-blue-color: #e9f7fd;
    --data-bg: var(--bg-color);
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* Font families */
    --font-primary: 'Metrophobic', sans-serif;
    --font-secondary: 'Maison Neue', sans-serif;
    --font-dyslexia: "Lexend", "Arial", sans-serif;
}

/* Dark Theme - Colour-Blind Mode */
body.theme-mode-dark.colour-blind-mode {
    --body-bg: #003049;
    --letter-spacing: 0em;
    --word-spacing: 0em;
    --bg-color: #003049;
    --text-color: #ffffff;
    --border-color: #60a5fa;
    --accent-color: #60a5fa;
    --secondary-bg: #1a1a1a;
    --section-bg: #1a1a1a;
    --section-secondary-bg: #1a1a1a;
    --card-bg: #03045e;
    --card-color: #ffffff;
    --card-border: #444444;
    --card-reverse-bg: #03045e;
    --card-reverse-color: #ffffff;
    --card-secondary-bg: #03045e;
    --card-secondary-color: #ffffff;
    --card-secondary-border: #444444;
    --link-color: #00ffff;
    --link-hover-color: #06dede;
    --caption-color: #60a5fa;
    --button-bg: #1e7ae0;
    --button-text: #ffffff;
    --button-hover-bg: #3b82f6;
    --button-hover-text: #ffffff;
    --input-bg: #1a1a1a;
    --input-text: #ffffff;
    --input-border: #333333;
    --input-focus-border: #60a5fa;
    --input-placeholder: #cccccc;
    --header-bg: #1a1a1a;
    --header-text: #ffffff;
    --footer-bg: #1a1a1a;
    --footer-text: #ffffff;
    --nav-bg: #023e8a;
    --nav-text: #ffffff;
    --nav-hover-bg: #333333;
    --nav-hover-text: #00ffff;
    --table-header-bg: #333333;
    --table-header-text: #ffffff;
    --table-row-bg: #1a1a1a;
    --table-row-alt-bg: #333333;
    --table-row-text: #ffffff;
    --table-row-hover-bg: #444444;
    --table-row-hover-text: #ffffff;
    --blockquote-bg: #1a1a1a;
    --blockquote-border: #333333;
    --blockquote-text: #ffffff;
    --code-bg: #333333;
    --code-text: #ffffff;
    --code-border: #444444;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --success-bg: #155724;
    --error-bg: #721c24;
    --warning-bg: #856404;
    --info-bg: #0c5460;
    --blue-color: #1e7ae0;
    --grey-color: #cccccc;
    --yellow-color: #fdf6c9;
    --light-blue-color: #bbd7f6;
    --light-white-color: #003153;
    --sky-blue-color: #00a6fb;
    --data-bg: var(--bg-color);
    --shadow-color: rgba(255, 255, 255, 0.1);
    /* Font families */
    --font-primary: 'Metrophobic', sans-serif;
    --font-secondary: 'Maison Neue', sans-serif;
    --font-dyslexia: "Lexend", "Arial", sans-serif;
}

/* Auto Theme - Colour-Blind Mode (Light preference) */
body.theme-mode-auto.colour-blind-mode {
    --body-bg: #ffffff;
    --letter-spacing: 0em;
    --word-spacing: 0em;
    --bg-color: #ffffff;
    --text-color: #262424;
    --border-color: #bbd7f6;
    --accent-color: #1e3a8a;
    --secondary-bg: #f8f9fa;
    --section-bg: #f8f9fa;
    --section-secondary-bg: #f8f9fa;
    --card-bg: #ffffff;
    --card-color: #262424;
    --card-reverse-bg: #ffffff;
    --card-reverse-color: #262424;
    --card-border: #ecf7fc;
    --card-secondary-bg: #ffffff;
    --card-secondary-color: #262424;
    --card-secondary-border: #ecf7fc;
    --link-color: #1e7ae0;
    --link-hover-color: #1e40af;
    --caption-color: #1e3a8a;
    --button-bg: #1e3a8a;
    --button-text: #ffffff;
    --button-hover-bg: #1e40af;
    --button-hover-text: #ffffff;
    --input-bg: #ffffff;
    --input-text: #262424;
    --input-border: #e5e5e5;
    --input-focus-border: #1e3a8a;
    --input-placeholder: #999999;
    --header-bg: #ffffff;
    --header-text: #262424;
    --footer-bg: #f8f9fa;
    --footer-text: #262424;
    --nav-bg: #ffffff;
    --nav-text: #262424;
    --nav-hover-bg: #f8f9fa;
    --nav-hover-text: #262424;
    --table-header-bg: #f8f9fa;
    --table-header-text: #262424;
    --table-row-bg: #ffffff;
    --table-row-alt-bg: #f8f9fa;
    --table-row-text: #262424;
    --table-row-hover-bg: #f1f1f1;
    --table-row-hover-text: #262424;
    --blockquote-bg: #f8f9fa;
    --blockquote-border: #e5e5e5;
    --blockquote-text: #262424;
    --code-bg: #f1f1f1;
    --code-text: #262424;
    --code-border: #e5e5e5;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --success-bg: #d4edda;
    --error-bg: #f8d7da;
    --warning-bg: #fff3cd;
    --info-bg: #d1ecf1;
    --blue-color: #1e7ae0;
    --grey-color: #262424;
    --yellow-color: #fdf6c9;
    --light-blue-color: #bbd7f6;
    --light-white-color: #f9fafb;
    --sky-blue-color: #e9f7fd;
    --data-bg: var(--bg-color);
    --shadow-color: rgba(0, 0, 0, 0.1);
    /* Font families */
    --font-primary: 'Metrophobic', sans-serif;
    --font-secondary: 'Maison Neue', sans-serif;
    --font-dyslexia: "Lexend", "Arial", sans-serif;
}

/* Auto Theme - Colour-Blind Mode (Dark system preference) */
@media (prefers-color-scheme: dark) {
    body.theme-mode-auto.colour-blind-mode {
        --body-bg: #003049;
        --bg-color: #003049;
        --text-color: #ffffff;
        --border-color: #60a5fa;
        --accent-color: #60a5fa;
        --secondary-bg: #1a1a1a;
        --section-bg: #1a1a1a;
        --section-secondary-bg: #1a1a1a;
        --card-bg: #03045e;
        --card-color: #ffffff;
        --card-border: #444444;
        --card-reverse-bg: #03045e;
        --card-reverse-color: #ffffff;
        --card-secondary-bg: #03045e;
        --card-secondary-color: #ffffff;
        --card-secondary-border: #444444;
        --link-color: #00ffff;
        --link-hover-color: #06dede;
        --caption-color: #60a5fa;
        --button-bg: #1e7ae0;
        --button-text: #ffffff;
        --button-hover-bg: #3b82f6;
        --button-hover-text: #ffffff;
        --input-bg: #1a1a1a;
        --input-text: #ffffff;
        --input-border: #333333;
        --input-focus-border: #60a5fa;
        --input-placeholder: #cccccc;
        --header-bg: #1a1a1a;
        --header-text: #ffffff;
        --footer-bg: #1a1a1a;
        --footer-text: #ffffff;
        --nav-bg: #023e8a;
        --nav-text: #ffffff;
        --nav-hover-bg: #333333;
        --nav-hover-text: #00ffff;
        --table-header-bg: #333333;
        --table-header-text: #ffffff;
        --table-row-bg: #1a1a1a;
        --table-row-alt-bg: #333333;
        --table-row-text: #ffffff;
        --table-row-hover-bg: #444444;
        --table-row-hover-text: #ffffff;
        --blockquote-bg: #1a1a1a;
        --blockquote-border: #333333;
        --blockquote-text: #ffffff;
        --code-bg: #333333;
        --code-text: #ffffff;
        --code-border: #444444;
        --success-color: #28a745;
        --error-color: #dc3545;
        --warning-color: #ffc107;
        --info-color: #17a2b8;
        --success-bg: #155724;
        --error-bg: #721c24;
        --warning-bg: #856404;
        --info-bg: #0c5460;
        --blue-color: #1e7ae0;
        --grey-color: #cccccc;
        --yellow-color: #fdf6c9;
        --light-blue-color: #bbd7f6;
        --light-white-color: #003153;
        --sky-blue-color: #00a6fb;
        --data-bg: var(--bg-color);
        --shadow-color: rgba(255, 255, 255, 0.1);
        /* Font families */
    --font-primary: 'Metrophobic', sans-serif;
    --font-secondary: 'Maison Neue', sans-serif;
    --font-dyslexia: "Lexend", "Arial", sans-serif;
    }
}

/* Common styles for all colour-blind modes */
body.colour-blind-mode a {
    color: var(--link-color);
    text-decoration: underline;
}
body.colour-blind-mode .btn-primary,
body.colour-blind-mode button[type="submit"],
body.colour-blind-mode .theme-option.active,
body.colour-blind-mode .preset-btn.active {
    background: var(--button-bg) !important;
    border-color: var(--button-bg) !important;
}
/* Ensure interactive elements have shape/pattern cues beyond colour alone */
body.colour-blind-mode input:invalid,
body.colour-blind-mode .error {
    border-color: var(--error-color) !important;
    border-width: 2px !important;
    border-style: dashed !important;
}

/* Respect OS-level reduce motion setting automatically */
@media (prefers-reduced-motion: reduce) {
    .globec-settings-panel,
    .settings-container,
    .theme-option,
    .preset-btn,
    .btn-primary,
    .btn-secondary,
    .close-btn,
    .settings-toggle-btn,
    .save-feedback,
    .checkmark {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* Action Buttons */
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--link-color) 20%, transparent);;;
}

.btn-primary,
.btn-secondary {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: var(--accent-color, #1e3a8a);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-color, #1e3a8a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background: var(--secondary-bg, #f8f9fa);
    color: var(--text-color, #666);
    border: 1px solid var(--border-color, #e5e5e5);
}

.btn-secondary:hover {
    background: var(--border-color, #e5e5e5);
}

/* Settings Toggle Button */
.settings-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent-color, #1e3a8a);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: all;
    opacity: 1;
    visibility: visible;
}

.settings-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-container {
        width: 95%;
        max-height: 85vh;
    }
    
    .settings-content {
        padding: 20px;
    }
    
    .theme-mode-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .font-presets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions {
        grid-template-columns: 1fr;
    }
    
    .settings-toggle-btn {
        bottom: 16px;
        right: 16px;
        padding: 12px 16px;
    }
    
    .settings-toggle-btn .text {
        display: none;
    }
}

/* Dark Mode Specific Styles */
.theme-mode-dark .settings-container,
[data-theme="dark"] .settings-container {
    background: var(--card-bg, #03045e);
    color: var(--text-color, #ffffff);
}

.theme-mode-dark .close-btn:hover,
[data-theme="dark"] .close-btn:hover {
    background: var(--border-color, #404040);
}

/* Animation for saving feedback */
.settings-saving {
    pointer-events: none;
    opacity: 0.7;
}

.save-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent-color, #1e3a8a);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-feedback.show {
    opacity: 1;
}

/* Focus styles for accessibility */
.settings-toggle-btn:focus,
.theme-option:focus,
.preset-btn:focus,
.close-btn:focus,
.btn-primary:focus,
.btn-secondary:focus {
    outline: 2px solid var(--accent-color, #1e3a8a);
    outline-offset: 2px;
}

/* ================================================================
   Semantic Body Classes — Applied by the Settings Panel
   JS sets inline styles for immediate visual change; these classes
   act as reliable CSS hooks for theme authors and serve as
   pre-JavaScript-execution fallbacks.
   ================================================================ */

/* Font Size */
body.font-xs  { --fs-base: 14px; }
body.font-sm  { --fs-base: 15px; }
body.font-md  { --fs-base: 16px; }
body.font-lg  { --fs-base: 18px; }
body.font-xl  { --fs-base: 20px; }
body.font-xxl { --fs-base: 22px; }

/* Line Height */
body.lh-tight,
body.lh-tight p,  body.lh-tight li,  body.lh-tight td,  body.lh-tight th  { line-height: 1.3; }

body.lh-normal,
body.lh-normal p, body.lh-normal li, body.lh-normal td, body.lh-normal th { line-height: 1.6; }

body.lh-relaxed,
body.lh-relaxed p, body.lh-relaxed li, body.lh-relaxed td, body.lh-relaxed th { line-height: 1.8; }

body.lh-spacious,
body.lh-spacious p, body.lh-spacious li, body.lh-spacious td, body.lh-spacious th { line-height: 2.0; }

/* Letter Spacing (WCAG 1.4.12) */
body.ls-normal,
body.ls-normal p, body.ls-normal li, body.ls-normal td, body.ls-normal th { letter-spacing: 0; }

body.ls-wide,
body.ls-wide p, body.ls-wide li, body.ls-wide td, body.ls-wide th { letter-spacing: 0.03em; }

body.ls-wider,
body.ls-wider p, body.ls-wider li, body.ls-wider td, body.ls-wider th { letter-spacing: 0.08em; }

body.ls-widest,
body.ls-widest p, body.ls-widest li, body.ls-widest td, body.ls-widest th { letter-spacing: 0.15em; }

/* Word Spacing (WCAG 1.4.12) */
body.ws-normal,
body.ws-normal p, body.ws-normal li, body.ws-normal td, body.ws-normal th { word-spacing: 0; }

body.ws-wide,
body.ws-wide p, body.ws-wide li, body.ws-wide td, body.ws-wide th { word-spacing: 0.06em; }

body.ws-wider,
body.ws-wider p, body.ws-wider li, body.ws-wider td, body.ws-wider th { word-spacing: 0.15em; }

body.ws-widest,
body.ws-widest p, body.ws-widest li, body.ws-widest td, body.ws-widest th { word-spacing: 0.3em; }

/* =============================================================================
   GC ACCESSIBILITY PANEL — New Tabbed Design
   ============================================================================= */

/* Modal overrides */
.gc-a11y-modal .modal-dialog { max-width: 460px; }
.gc-a11y-content {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}

/* Header */
.gc-a11y-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e3a8a;
  color: #fff;
  padding: 18px 20px;
  flex-shrink: 0;
}
.gc-a11y-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.gc-a11y-icon { font-size: 22px; opacity: .9; }
.gc-a11y-title {
  margin: 0;
  margin-top: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.gc-a11y-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.75);
}
.gc-a11y-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.gc-a11y-close:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Tabs */
.gc-a11y-tabs {
  display: flex;
  border-bottom: 2px solid transparent;
  /* background: #fff; */
  flex-shrink: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gc-a11y-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.gc-a11y-tab a,
.gc-a11y-tab a.btn {
  display: block;
  width: 100%;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--link-color, #1e3a8a) !important;
  text-align: center;
  text-decoration: none !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.gc-a11y-tab:hover a,
.gc-a11y-tab:hover a.btn { color: var(--link-color, #1e3a8a) !important; }
.gc-a11y-tab.active {
  border-bottom-color: color-mix(in srgb, var(--link-color) 80%, transparent);
}
.gc-a11y-tab.active a,
.gc-a11y-tab.active a.btn { color: var(--link-color, #1e3a8a) !important; }

/* Body / scrollable content */
.gc-a11y-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  /* background: #fff; */
}

/* Tab panes */
.gc-a11y-tab-pane { display: none; }
.gc-a11y-tab-pane.active { display: block; }

/* Section labels */
.gc-a11y-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-color, #1e3a8a);
  margin: 0 0 10px;
}
.fa-4x  {font-size: 42px !important;}
/* Control row */
.gc-a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid color-mix(in srgb, var(--link-color) 35%, transparent);
}
.gc-a11y-row-label {
  font-size: 14px;
  font-weight: 500;
  color:var(--text-color, #1e3a8a);;
}

/* Stepper */
.gc-a11y-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}
.gc-a11y-content .gc-stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none !important;
  background: #dce8fb !important;
  color: #1e3a8a !important;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  font-weight: 600;
  box-shadow: none !important;
  padding: 0;
}
.gc-a11y-content .gc-stepper-btn:hover { background: #b8d0f5 !important; }
.gc-stepper-val {
  min-width: 46px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-color, #1e3a8a);;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--link-color) 35%, transparent);
  border-radius: 6px;
  padding: 4px 6px;
}

/* Font size preset buttons */
.gc-font-presets {
  display: flex;
  gap: 6px;
  margin: 6px 0 14px;
}
/* Style buttons (B I align) */
.gc-a11y-style-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gc-a11y-content .gc-style-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid #dde3ef !important;
  background: #fff !important;
  color: #333 !important;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  box-shadow: none !important;
  outline: none;
  padding: 0;
}
.gc-a11y-content .gc-style-btn:hover { border-color: #1e3a8a !important; color: #1e3a8a !important; background: #f0f4fc !important; }
.gc-a11y-content .gc-style-btn.active {
  background: #1e3a8a !important;
  border-color: #1e3a8a !important;
  color: #fff !important;
}

/* Text case buttons */
.gc-a11y-case-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.gc-a11y-content .gc-case-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid #dde3ef !important;
  background: #fff !important;
  color: #333 !important;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  box-shadow: none !important;
  outline: none;
}
.gc-a11y-content .gc-case-btn:hover { border-color: #1e3a8a !important; color: #1e3a8a !important; }
.gc-a11y-content .gc-case-btn.active {
  background: #1e3a8a !important;
  border-color: #1e3a8a !important;
  color: #fff !important;
}

/* Theme mode buttons */
.gc-a11y-theme-btns { display: flex; gap: 8px; }
.gc-theme-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid #dde3ef;
  background: #f4f6fb;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gc-theme-btn i { font-size: 16px; }
.gc-theme-btn:hover { border-color: #1e3a8a; color: #1e3a8a; }
.gc-theme-btn.active {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #fff;
}

/* Toggle rows */
.gc-a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f4f6fb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  gap: 12px;
}
.gc-toggle-info { flex: 1; }
.gc-toggle-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color:var(--link-color, #1e3a8a);
}
.gc-toggle-desc {
  display: block;
  font-size: 12px;
  color: var(--text-color, #1e3a8a);;
  margin-top: 2px;
}
/* iOS-style toggle */
.gc-toggle-wrap { position: relative; flex-shrink: 0; }
.gc-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.gc-toggle-slider {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #ccc;
  transition: background .2s;
  position: relative;
}
.gc-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.gc-toggle-input:checked + .gc-toggle-slider { background: #1e3a8a; }
.gc-toggle-input:checked + .gc-toggle-slider::after { transform: translateX(20px); }
.gc-toggle-input:focus + .gc-toggle-slider {
  outline: 2px solid #1e3a8a;
  outline-offset: 2px;
}

/* Footer */
.gc-a11y-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #e5e5e5;
  /* background: #fff; */
  flex-shrink: 0;
}
.gc-a11y-btn-reset {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.gc-a11y-btn-done {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
} 
.gc-a11y-btn-done:disabled { opacity: .6; cursor: not-allowed; }

/* Body utility classes for style / text-case options */
body.gc-text-bold p, body.gc-text-bold li, body.gc-text-bold td, body.gc-text-bold th { font-weight: bold !important; }
body.gc-text-italic p, body.gc-text-italic li { font-style: italic !important; }
body.gc-align-left p, body.gc-align-left li { text-align: left !important; }
body.gc-align-center p, body.gc-align-center li { text-align: center !important; }
body.gc-align-right p, body.gc-align-right li { text-align: right !important; }
body.gc-case-uppercase p, body.gc-case-uppercase li { text-transform: uppercase !important; }
body.gc-case-lowercase p, body.gc-case-lowercase li { text-transform: lowercase !important; }

/* Display tab — Content toggles */
body.gc-highlight-titles h1,
body.gc-highlight-titles h2,
body.gc-highlight-titles h3,
body.gc-highlight-titles h4,
body.gc-highlight-titles h5,
body.gc-highlight-titles h6 {
  background-color: #ffff00 !important;
  color: #000 !important;
  padding: 0 4px !important;
}

body.gc-highlight-links a { background-color: #ffff00 !important; color: #000 !important; }

body.gc-hide-images img,
body.gc-hide-images figure,
body.gc-hide-images .wp-post-image { display: none !important; }

/* Display tab — Color filters (applied to html so everything is affected) */
html.theme-filter-monochrome   { filter: grayscale(100%) !important; }
html.theme-filter-high-contrast { filter: contrast(175%) brightness(1.1) !important; }
html.theme-filter-low-contrast  { filter: contrast(60%) !important; }



