/**
 * CashFlow 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-width: 0;
}

/* Accessibility Widget */
#accessibility-widget {
    position: fixed;
    bottom: 180px;
    left: 20px;
    z-index: 99998;
    direction: rtl;
}

/* Toggle Button */
.accessibility-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.accessibility-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.6);
}

.accessibility-btn:focus {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

.accessibility-btn svg {
    width: 30px;
    height: 30px;
}

/* Menu */
.accessibility-menu {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 350px;
    max-height: 600px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.accessibility-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.accessibility-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
}

.accessibility-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.accessibility-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.accessibility-close:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.accessibility-close svg {
    width: 20px;
    height: 20px;
}

/* Content */
.accessibility-content {
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.accessibility-content::-webkit-scrollbar {
    width: 8px;
}

.accessibility-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.accessibility-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

/* Section */
.accessibility-section {
    margin-bottom: 2rem;
}

.accessibility-section:last-child {
    margin-bottom: 0;
}

.accessibility-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

/* Font Size Controls */
.accessibility-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.control-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.8);
}

.control-btn:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.control-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 4px;
}

#font-size-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: #8b5cf6;
    min-width: 60px;
    text-align: center;
}

/* Options */
.accessibility-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: right;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(139, 92, 246, 0.5);
}

.option-btn:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.option-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    font-weight: 500;
}

.option-toggle {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.option-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.option-btn.active .option-toggle {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.option-btn.active .option-toggle::before {
    transform: translateX(-20px);
}

/* Reset Button */
.reset-btn {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    color: #f87171;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
}

.reset-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.8);
}

.reset-btn:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.reset-btn svg {
    width: 20px;
    height: 20px;
}

/* ======================
   ACCESSIBILITY MODES
   ====================== */

/* High Contrast Mode */
html.high-contrast {
    filter: contrast(1.5);
}

html.high-contrast body {
    background: #000 !important;
}

html.high-contrast * {
    border-color: #fff !important;
}

/* Highlight Links */
html.highlight-links a {
    background: rgba(251, 191, 36, 0.3) !important;
    border-bottom: 3px solid #fbbf24 !important;
    padding: 2px 4px;
    text-decoration: underline !important;
}

/* Readable Font */
html.readable-font,
html.readable-font * {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
    letter-spacing: 0.5px !important;
}

/* Highlight Headings */
html.highlight-headings h1,
html.highlight-headings h2,
html.highlight-headings h3,
html.highlight-headings h4,
html.highlight-headings h5,
html.highlight-headings h6 {
    background: rgba(139, 92, 246, 0.3) !important;
    padding: 0.5rem !important;
    border-right: 4px solid #8b5cf6 !important;
}

/* Stop Animations */
html.stop-animations * {
    animation: none !important;
    transition: none !important;
}

/* Screen Reader Mode */
html.screen-reader-mode * {
    animation: none !important;
    transition: none !important;
}

html.screen-reader-mode *:focus {
    outline: 4px solid #fbbf24 !important;
    outline-offset: 4px !important;
}

/* Responsive */
@media (max-width: 480px) {
    #accessibility-widget {
        bottom: 240px;
        left: 10px;
    }

    .accessibility-btn {
        width: 50px;
        height: 50px;
    }

    .accessibility-btn svg {
        width: 24px;
        height: 24px;
    }

    .accessibility-menu {
        width: calc(100vw - 20px);
        max-width: 350px;
    }
}

/* Focus Visible Enhancement */
*:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: #8b5cf6;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 100000;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

