/* ==============================================
   ACCESSIBILITY WIDGET STYLES
   ============================================== */

/* Floating Button */
.a11y-floating-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border: 3px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.a11y-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.4);
}

.a11y-floating-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Panel */
.a11y-panel {
    position: fixed;
    bottom: 90px;
    left: 24px;
    width: 320px;
    max-height: 70vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    overflow: hidden;
    transform-origin: bottom left;
}

.dark .a11y-panel {
    background: #1e293b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.a11y-panel-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.a11y-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.a11y-panel-header p {
    font-size: 12px;
    opacity: 0.9;
    margin: 4px 0 0 0;
}

.a11y-panel-body {
    padding: 12px;
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

/* Grid for buttons */
.a11y-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Feature Button */
.a11y-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 90px;
}

.dark .a11y-btn {
    background: #334155;
    border-color: #475569;
}

.a11y-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.dark .a11y-btn:hover {
    border-color: #60a5fa;
    background: #1e3a5f;
}

.a11y-btn.active {
    background: #dbeafe;
    border-color: #3b82f6;
}

.dark .a11y-btn.active {
    background: #1e3a8a;
    border-color: #60a5fa;
}

.a11y-btn-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: #374151;
}

.dark .a11y-btn-icon {
    color: #e2e8f0;
}

.a11y-btn-label {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.3;
}

.dark .a11y-btn-label {
    color: #e2e8f0;
}

/* Reset Button Special */
.a11y-btn-reset {
    background: #fef2f2;
    border-color: #fecaca;
}

.dark .a11y-btn-reset {
    background: #450a0a;
    border-color: #7f1d1d;
}

.a11y-btn-reset:hover {
    background: #fee2e2;
    border-color: #f87171;
}

.dark .a11y-btn-reset:hover {
    background: #7f1d1d;
    border-color: #f87171;
}

/* ==============================================
   ACCESSIBILITY MODE CLASSES
   ============================================== */

/* High Contrast Mode */
.a11y-high-contrast {
    filter: contrast(1.4) !important;
}

.a11y-high-contrast * {
    border-color: currentColor !important;
}

/* Grayscale/Saturation Mode */
.a11y-grayscale {
    filter: grayscale(100%) !important;
}

/* Dyslexia Friendly Font */
.a11y-dyslexia,
.a11y-dyslexia * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Arial', sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

/* Text Size Levels */
.a11y-text-1 {
    font-size: 110% !important;
}

.a11y-text-2 {
    font-size: 120% !important;
}

.a11y-text-3 {
    font-size: 130% !important;
}

.a11y-text-4 {
    font-size: 140% !important;
}

.a11y-text-5 {
    font-size: 150% !important;
}

/* Letter Spacing Levels */
.a11y-letter-1 * {
    letter-spacing: 0.05em !important;
}

.a11y-letter-2 * {
    letter-spacing: 0.1em !important;
}

.a11y-letter-3 * {
    letter-spacing: 0.15em !important;
}

.a11y-letter-4 * {
    letter-spacing: 0.2em !important;
}

/* Line Spacing Levels */
.a11y-line-1 * {
    line-height: 1.6 !important;
}

.a11y-line-2 * {
    line-height: 1.8 !important;
}

.a11y-line-3 * {
    line-height: 2.0 !important;
}

.a11y-line-4 * {
    line-height: 2.2 !important;
}

/* Text Alignment */
.a11y-align-left * {
    text-align: left !important;
}

.a11y-align-center * {
    text-align: center !important;
}

.a11y-align-justify * {
    text-align: justify !important;
}

/* Highlight Links */
.a11y-highlight-links a {
    background-color: #fef08a !important;
    color: #1e40af !important;
    text-decoration: underline !important;
    padding: 2px 4px !important;
    border-radius: 2px !important;
}

.dark .a11y-highlight-links a {
    background-color: #854d0e !important;
    color: #fef08a !important;
}

/* Stop Animations */
.a11y-no-animations,
.a11y-no-animations *,
.a11y-no-animations *::before,
.a11y-no-animations *::after {
    animation: none !important;
    transition: none !important;
}

/* Fix visibility for initially hidden animated elements when animations are paused */
.a11y-no-animations .glass-animate,
.a11y-no-animations [class*='animate-']:not(.animate-spin):not(.animate-ping):not(.animate-pulse):not(.animate-bounce) {
    opacity: 1 !important;
    transform: translate(0) !important;
}

/* Cursor Mode 1: Big Cursor */
.a11y-cursor-1,
.a11y-cursor-1 * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 0l16 12.279-6.78 1.138 4.256 8.676-3.902 1.907-4.256-8.676-5.318 4.676z'/%3E%3C/svg%3E"), auto !important;
}

/* Cursor Mode 2: Reading Focus (Spotlight Effect) */
.a11y-reading-focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99990;
    background: rgba(0, 0, 0, 0.7);
    mask-image: radial-gradient(circle 150px at var(--mouse-x, 50%) var(--mouse-y, 50%), transparent 0%, transparent 100px, black 150px);
    -webkit-mask-image: radial-gradient(circle 150px at var(--mouse-x, 50%) var(--mouse-y, 50%), transparent 0%, transparent 100px, black 150px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.a11y-cursor-2 .a11y-reading-focus-overlay {
    opacity: 1;
}

/* Cursor Mode 3: Reading Guide (Ruler Line) */
.a11y-reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 0, 0.25);
    border-top: 2px solid rgba(255, 200, 0, 0.8);
    border-bottom: 2px solid rgba(255, 200, 0, 0.8);
    pointer-events: none;
    z-index: 99990;
    display: none;
    transform: translateY(-50%);
}

.a11y-cursor-3 .a11y-reading-guide {
    display: block;
}

.dark .a11y-reading-guide {
    background: rgba(59, 130, 246, 0.2);
    border-top-color: rgba(96, 165, 250, 0.8);
    border-bottom-color: rgba(96, 165, 250, 0.8);
}

/* Screen Reader Text (Visually Hidden) */
.a11y-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Screen Reader Mode - Enhanced Focus */
.a11y-screen-reader *:focus {
    outline: 3px solid #2563eb !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.3) !important;
}

.a11y-screen-reader a:focus,
.a11y-screen-reader button:focus,
.a11y-screen-reader input:focus,
.a11y-screen-reader select:focus,
.a11y-screen-reader textarea:focus {
    background-color: #dbeafe !important;
}

.dark .a11y-screen-reader a:focus,
.dark .a11y-screen-reader button:focus,
.dark .a11y-screen-reader input:focus,
.dark .a11y-screen-reader select:focus,
.dark .a11y-screen-reader textarea:focus {
    background-color: #1e3a8a !important;
}

/* Skip Link for Screen Reader */
.a11y-skip-link {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: white !important;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    z-index: 99999;
    text-decoration: none !important;
    transition: top 0.3s ease;
}

.a11y-skip-link:focus {
    top: 0;
    outline: 3px solid #facc15;
    outline-offset: 2px;
}

/* Scrollbar for Panel */
.a11y-panel-body::-webkit-scrollbar {
    width: 6px;
}

.a11y-panel-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.a11y-panel-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dark .a11y-panel-body::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark .a11y-panel-body::-webkit-scrollbar-thumb {
    background: #475569;
}