/**
 * أنماط إمكانية الوصول
 * Accessibility Styles
 */

/* ========================================
   Screen Reader Only
   ======================================== */

.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;
}

/* ========================================
   Skip Links
   ======================================== */

.skip-link {
    position: fixed;
    top: -100px;
    right: 50%;
    transform: translateX(50%);
    padding: 12px 24px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: white;
    text-decoration: none;
    border-radius: 0 0 12px 12px;
    z-index: 100001;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   Focus Indicators
   ======================================== */

.keyboard-nav *:focus {
    outline: 3px solid #8b5cf6 !important;
    outline-offset: 2px !important;
}

.a11y-focus-visible *:focus-visible {
    outline: 3px solid #8b5cf6 !important;
    outline-offset: 2px !important;
}

/* ========================================
   Reduced Motion
   ======================================== */

.a11y-reduced-motion *,
.a11y-reduced-motion *::before,
.a11y-reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* ========================================
   High Contrast
   ======================================== */

.a11y-high-contrast {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --border-color: #ffffff;
}

.a11y-high-contrast .glass-card {
    background: #1a1a1a;
    border: 2px solid #ffffff;
}

.a11y-high-contrast a {
    color: #00ffff !important;
    text-decoration: underline;
}

.a11y-high-contrast button:not(.btn-loading) {
    border: 2px solid currentColor !important;
}

/* ========================================
   Large Text
   ======================================== */

.a11y-large-text {
    font-size: 120%;
}

.a11y-large-text .text-xs { font-size: 0.875rem; }
.a11y-large-text .text-sm { font-size: 1rem; }
.a11y-large-text .text-base { font-size: 1.125rem; }
.a11y-large-text .text-lg { font-size: 1.25rem; }
.a11y-large-text .text-xl { font-size: 1.5rem; }
.a11y-large-text .text-2xl { font-size: 1.875rem; }
.a11y-large-text .text-3xl { font-size: 2.25rem; }

/* ========================================
   Accessibility Panel
   ======================================== */

.a11y-panel {
    position: fixed;
    bottom: 90px;
    left: 20px;
    z-index: 9999;
}

.a11y-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1b4b, #0f172a);
    border: 2px solid rgba(139, 92, 246, 0.5);
    color: #8b5cf6;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.a11y-toggle:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: white;
}

.a11y-menu {
    position: absolute;
    bottom: 60px;
    left: 0;
    min-width: 220px;
    background: linear-gradient(135deg, #1e1b4b, #0f172a);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 16px;
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.a11y-panel.active .a11y-menu {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.a11y-menu h4 {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.a11y-menu h4 i {
    margin-left: 8px;
    color: #8b5cf6;
}

.a11y-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.a11y-option:hover {
    color: white;
}

.a11y-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    accent-color: #8b5cf6;
}

.a11y-option span {
    font-size: 14px;
}

/* ========================================
   Touch Targets (WCAG 2.5.5)
   ======================================== */

@media (pointer: coarse) {
    button,
    a,
    input,
    select,
    .touchable {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========================================
   Color Blind Friendly
   ======================================== */

/* Add patterns/icons alongside colors */
.status-success::before { content: "✓ "; }
.status-error::before { content: "✗ "; }
.status-warning::before { content: "⚠ "; }
.status-info::before { content: "ℹ "; }

/* ========================================
   Responsive Text Spacing
   ======================================== */

.a11y-large-text p,
.a11y-large-text li {
    line-height: 1.8;
    letter-spacing: 0.02em;
    word-spacing: 0.1em;
}
