/* a11y.css - Accessibility Assistant Styles */

/* Floating Trigger */
#a11y-widget-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--blue, #1a3faa);
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
#a11y-widget-trigger:hover, #a11y-widget-trigger:focus {
    transform: scale(1.05);
    background-color: var(--blue-mid, #2452cc);
    outline: 2px solid #ffffff;
}

/* Side Panel */
#a11y-widget-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 100vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 99999;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out, visibility 0.3s;
    display: flex;
    flex-direction: column;
}

#a11y-widget-panel.translate-x-full {
    transform: translateX(100%);
    visibility: hidden;
}

#a11y-widget-panel.visible {
    transform: translateX(0);
    visibility: visible;
}

/* Panel Header */
.a11y-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--blue-light, #e8eeff);
    border-bottom: 1px solid #d1d5db;
}
.a11y-panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--steel, #3d4f70);
    display: flex;
    align-items: center;
    gap: 8px;
}
#a11y-panel-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--steel, #3d4f70);
    cursor: pointer;
    padding: 4px;
}

/* Panel Body */
.a11y-panel-body {
    padding: 20px;
    flex-grow: 1;
}

.a11y-section {
    margin-bottom: 24px;
}
.a11y-section h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #4b5563;
    font-weight: 600;
}

/* Buttons inside panel */
.a11y-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.a11y-btn-group button {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #1f2937;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    flex: 1;
    text-align: center;
    transition: all 0.2s;
}
.a11y-btn-group button:hover {
    background: #f3f4f6;
}
.a11y-btn-group button.bg-brand-blue {
    background: var(--blue, #1a3faa) !important;
    color: #ffffff !important;
    border-color: var(--blue, #1a3faa) !important;
}

/* TTS Player */
.a11y-tts-player {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}
.a11y-tts-player button {
    flex: 1;
    background: #e5e7eb;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}
.a11y-tts-player button:hover {
    background: #d1d5db;
}

/* Toggles */
.a11y-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}
.a11y-toggle-row label {
    font-size: 0.9rem;
    color: #1f2937;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Switch Input Styling */
.a11y-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.a11y-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.a11y-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}
.a11y-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.a11y-switch input:checked + .a11y-slider {
    background-color: var(--blue, #1a3faa);
}
.a11y-switch input:focus + .a11y-slider {
    box-shadow: 0 0 1px var(--blue, #1a3faa);
}
.a11y-switch input:checked + .a11y-slider:before {
    transform: translateX(20px);
}

/* State Classes Applied to Body/HTML */
.a11y-text-120 { font-size: 120% !important; }
.a11y-text-150 { font-size: 150% !important; }
.a11y-text-200 { font-size: 200% !important; }

body.a11y-high-contrast {
    background: #000000 !important;
    color: #ffffff !important;
}
body.a11y-high-contrast * {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffffff !important;
}
body.a11y-high-contrast a { color: #00ff00 !important; text-decoration: underline !important; }

body.a11y-grayscale {
    filter: grayscale(100%) !important;
}

body.a11y-dyslexia * {
    font-family: "Comic Sans MS", "Arial", sans-serif !important;
    letter-spacing: 1px !important;
}

body.a11y-highlight-links a {
    background-color: #ffff00 !important;
    color: #000000 !important;
    text-decoration: underline !important;
    font-weight: bold !important;
    padding: 2px !important;
}

.a11y-reading-ruler {
    position: fixed;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 999999;
    display: none;
    transform: translateY(-20px);
    border-top: 2px solid #ff0000;
    border-bottom: 2px solid #ff0000;
}

.a11y-speaking-highlight {
    background-color: #ffff99 !important;
    color: #000 !important;
    outline: 2px solid #ff9900 !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

#a11y-reset-all {
    width: 100%;
    padding: 10px;
    background: #f87171;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}
#a11y-reset-all:hover {
    background: #ef4444;
}
