/* --- Accessibility Styles --- */

/* Skip to Main Content */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: #004a8c;
    color: white;
    padding: 8px 16px;
    z-index: 9999999;
    transition: top 0.3s;
    text-decoration: none;
    border-radius: 0 0 5px 5px;
    font-weight: bold;
}

.skip-to-main:focus {
    top: 0;
    background: #ffcc00 !important;
    color: #000 !important;
    border: 2px solid #000;
    outline: 3px solid #ffcc00;
}

/* Color Contrast Modes */
body.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

body.high-contrast *,
body.high-contrast a,
body.high-contrast p,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6,
body.high-contrast span,
body.high-contrast i,
body.high-contrast div:not(.accessibility-menu) {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
}

body.high-contrast .national-logo,
body.high-contrast .national-flag {
    filter: contrast(200%) brightness(120%);
}

body.dark-contrast {
    background-color: #000 !important;
    color: #ffff00 !important;
}

body.dark-contrast *,
body.dark-contrast a,
body.dark-contrast p,
body.dark-contrast h1,
body.dark-contrast h2,
body.dark-contrast h3,
body.dark-contrast h4,
body.dark-contrast h5,
body.dark-contrast h6,
body.dark-contrast span,
body.dark-contrast i,
body.dark-contrast div:not(.accessibility-menu) {
    background-color: #000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
    box-shadow: none !important;
}

body.dark-contrast .national-logo,
body.dark-contrast .national-flag {
    filter: sepia(100%) saturate(500%) hue-rotate(10deg);
}

/* Highlight Links */
body.highlight-links a {
    text-decoration: underline !important;
    background-color: #ffff00 !important;
    color: #000 !important;
    outline: 2px solid #004a8c !important;
}

/* Big Cursor */
body.big-cursor {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='black' stroke='white' stroke-width='1'%3E%3Cpath d='M7 2l12 11.2-5.8.8 3.5 6-1.7 1-3.5-6-4.5 4.5z'/%3E%3C/svg%3E"), auto !important;
}

body.big-cursor a,
body.big-cursor button {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='black' stroke='white' stroke-width='1'%3E%3Cpath d='M7 2l12 11.2-5.8.8 3.5 6-1.7 1-3.5-6-4.5 4.5z'/%3E%3C/svg%3E"), pointer !important;
}

/* Hide Images */
body.hide-images img {
    visibility: hidden !important;
    background: #ccc !important;
}

/* Text Enhancements */
body.add-letter-spacing, 
body.add-letter-spacing * {
    letter-spacing: 0.15em !important;
}

body.add-line-height, 
body.add-line-height * {
    line-height: 2.2 !important;
}

/* Dyslexia Friendly Font */
body.acc-dyslexia-font,
body.acc-dyslexia-font * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', cursive, sans-serif !important;
}

/* Header Highlighting */
body.acc-highlight-headers h1:not(.accessibility-panel-offcanvas *),
body.acc-highlight-headers h2:not(.accessibility-panel-offcanvas *),
body.acc-highlight-headers h3:not(.accessibility-panel-offcanvas *),
body.acc-highlight-headers h4:not(.accessibility-panel-offcanvas *),
body.acc-highlight-headers h5:not(.accessibility-panel-offcanvas *),
body.acc-highlight-headers h6:not(.accessibility-panel-offcanvas *) {
    background-color: #f0f8ff !important;
    color: #000 !important;
    outline: 2px solid #004a8c !important;
    outline-offset: 4px;
    box-sizing: border-box !important;
}

/* Saturation Modes */
body.acc-low-sat { filter: saturate(50%) !important; }
body.acc-high-sat { filter: saturate(200%) !important; }
body.acc-grayscale { filter: grayscale(100%) !important; }

/* Text Alignment */
body.acc-align-left * { text-align: left !important; }
body.acc-align-center * { text-align: center !important; }
body.acc-align-right * { text-align: right !important; }
body.acc-align-justify * { text-align: justify !important; }

/* Pause Animations (Refined to not break dropdowns) */
body.acc-pause-animations *:not(.accessibility-panel):not(.dropdown-menu):not(.navbar-collapse) {
    animation: none !important;
    transition: none !important;
}

/* Reading Guide Line */
#acc-reading-guide {
    position: fixed;
    height: 4px;
    background: #ffff00;
    left: 0;
    right: 0;
    z-index: 1000000;
    pointer-events: none;
    display: none;
    left: 0;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
body.acc-reading-guide #acc-reading-guide {
    display: block;
}

/* Low Bandwidth Mode */
body.acc-low-bandwidth .national-logo,
body.acc-low-bandwidth .national-flag,
body.acc-low-bandwidth .banner-image,
body.acc-low-bandwidth .hero-section {
    display: none !important;
}
body.acc-low-bandwidth * {
    background-image: none !important;
}

/* Screen Reader Only (Standard) */
.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;
}

/* Enhanced Keyboard Focus — only active when keyboard-nav profile is enabled */
.keyboard-nav-active *:focus {
    outline: 3px solid #ffcc00 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px rgba(255, 204, 0, 0.5) !important;
}

.modern-top-bar {
    position: relative;
    z-index: 9999 !important;
}

.accessibility-dropdown {
    position: relative;
    display: inline-block;
}

.accessibility-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white !important;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 999999 !important;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-top: 10px;
}

.accessibility-dropdown:hover .accessibility-panel,
.accessibility-panel.show {
    display: block;
}

.accessibility-panel h5 {
    font-size: 14px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.accessibility-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

/* Accessibility Profiles Active State */
.acc-profile-card.active {
    border-color: #1a4282 !important;
    background-color: #f0f7ff !important;
    box-shadow: 0 0 0 2px rgba(26,66,130,0.2);
}
.acc-profile-card.active .form-check-input {
    background-color: #1a4282;
    border-color: #1a4282;
}

/* Cognitive Mode - reading mask */
body.acc-cognitive-mode::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.05); /* very soft dimming */
    z-index: 10;
    pointer-events: none;
}
body.acc-cognitive-mode .gpa-access-trigger,
body.acc-cognitive-mode header {
    z-index: 11 !important;
}

/* Keyboard Nav Visuals */
.keyboard-nav-active *:focus {
    outline: 4px solid #ffcc00 !important;
    outline-offset: 2px !important;
    transition: outline 0.1s ease-in-out;
}

.acc-btn {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155 !important;
    cursor: pointer;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s;
}

.acc-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.acc-btn.active {
    background: #004a8c;
    color: white !important;
    border-color: #004a8c;
}

/* Explicit Button Styling for visibility */
#acc-font-increase, #acc-font-reset, #acc-font-decrease {
    color: #004a8c !important;
    font-weight: 800 !important;
    font-size: 14px;
}

.acc-contrast-btn {
    font-weight: 700 !important;
}

/* Font resizing is controlled via html element font-size in JS — no body override needed */

/* Floating Accessibility Button Style */
.gpa-access-trigger {
    position: fixed;
    top: 50%;
    right: 0;
    left: auto !important;
    transform: translateY(-50%);
    width: 55px;
    height: 60px;
    border-radius: 50% 0 0 50%;
    background-color: #1a4282;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999998 !important;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: -2px 0 10px rgba(0,0,0,0.15);
}

.gpa-access-trigger:hover {
    background-color: #0d2c5e;
    box-shadow: -4px 0 15px rgba(0,0,0,0.3) !important;
}

.gpa-access-trigger:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 4px;
}

@media (max-width: 768px) {
    .accessibility-panel-offcanvas {
        width: 100% !important;
        border-radius: 0 !important;
    }
    .gpa-access-trigger {
        top: 50%;
        right: 0;
        left: auto;
        transform: translateY(-50%);
        width: 45px;
        height: 50px;
        border-radius: 50% 0 0 50%;
    }
}
