﻿html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    transition: all 0.3s ease;
    overflow-x: hidden;
    /* Remove all these flexbox and positioning properties */
}

/* Demo content styles */
.demo-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

    .demo-content h1 {
        margin-bottom: 20px;
        color: #333;
    }

    .demo-content p {
        margin-bottom: 15px;
        color: #666;
    }

/* Accessibility Widget Button */
.a11y-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #4CAF50;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .a11y-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    }

    .a11y-toggle svg {
        width: 30px;
        height: 30px;
        fill: white;
    }

/* Accessibility Panel - Desktop */
.a11y-panel {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
    overflow-y: auto;
    overflow-x: hidden; /* Add this */
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

    .a11y-panel.active {
        display: block;
        transform: translateX(0);
    }

/* Mobile Responsive - Fullscreen */
@media (max-width: 768px) {
    .a11y-panel {
        width: 100%;
        height: 100vh;
        left: 0;
        top: 0;
        border-radius: 0;
        transform: translateY(100%);
    }

        .a11y-panel.active {
            transform: translateY(0);
        }

    .a11y-toggle {
        bottom: 15px;
        left: 15px;
        width: 50px;
        height: 50px;
    }

        .a11y-toggle svg {
            width: 24px;
            height: 24px;
        }
}

/* Panel overlay for mobile */
.a11y-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

    .a11y-overlay.active {
        display: block;
    }

@media (max-width: 768px) {
    .a11y-overlay {
        display: none !important;
    }
}

.a11y-panel-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

    .a11y-panel-header h3 {
        font-size: 18px;
        color: #333;
    }

.a11y-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

    .a11y-close:hover {
        color: #333;
    }

.a11y-panel-content {
    padding: 20px;
}

.a11y-section {
    margin-bottom: 24px;
}

.a11y-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.a11y-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.a11y-btn {
    flex: 1;
    min-width: calc(50% - 5px);
    padding: 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

    .a11y-btn:hover {
        border-color: #4CAF50;
        background: #f5f5f5;
    }

    .a11y-btn.active {
        background: #4CAF50;
        color: white;
        border-color: #4CAF50;
    }

.a11y-btn-icon {
    font-size: 20px;
}

.a11y-slider-group {
    margin-top: 10px;
}

.a11y-slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.a11y-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

    .a11y-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #4CAF50;
        cursor: pointer;
    }

    .a11y-slider::-moz-range-thumb {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #4CAF50;
        cursor: pointer;
        border: none;
    }

.a11y-reset {
    width: 100%;
    padding: 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.2s ease;
}

    .a11y-reset:hover {
        background: #d32f2f;
    }

/* Language Selector */
.a11y-language-selector {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.a11y-language-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: border-color 0.2s;
}

    .a11y-language-select:hover,
    .a11y-language-select:focus {
        border-color: #4CAF50;
        outline: none;
    }

/* Accessibility States */
body.high-contrast {
    background: #000;
    color: #fff;
}

    body.high-contrast .demo-content h1,
    body.high-contrast .demo-content p {
        color: #fff;
    }

    body.high-contrast .a11y-panel {
        background: #000;
        border: 2px solid #fff;
    }

    body.high-contrast .a11y-panel-header {
        background: #000;
        border-bottom-color: #fff;
    }

body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

    body.dark-mode .demo-content h1 {
        color: #fff;
    }

    body.dark-mode .demo-content p {
        color: #ccc;
    }

    body.dark-mode .a11y-panel {
        background: #2a2a2a;
        color: #e0e0e0;
    }

    body.dark-mode .a11y-panel-header {
        background: #2a2a2a;
        border-bottom-color: #444;
    }

    body.dark-mode .a11y-btn {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }

        body.dark-mode .a11y-btn:hover {
            background: #444;
            border-color: #4CAF50;
        }

body.dyslexia-font {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
}

body.readable-font {
    font-family: Georgia, 'Times New Roman', serif;
}

body.hide-images img {
    display: none;
}

body.highlight-links a {
    background: yellow;
    color: #000;
    padding: 2px 4px;
    text-decoration: underline;
}

body.increased-spacing {
    letter-spacing: 0.12em;
    word-spacing: 0.16em;
}

    body.increased-spacing p {
        line-height: 2;
    }

/* Keyboard focus indicators */
body.keyboard-nav *:focus {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .a11y-panel-content {
        padding: 15px;
        padding-bottom: 80px; /* Space for mobile navigation */
    }

    .a11y-section {
        margin-bottom: 20px;
    }

    .a11y-btn {
        min-width: 100%;
        padding: 14px;
    }

    .a11y-panel-header h3 {
        font-size: 16px;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9997;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: scale(1.1) translateY(0);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
    background: #0056b3;
}

.back-to-top:focus {
    outline: 3px solid #4CAF50;
    outline-offset: 2px;
}

.back-to-top svg {
    width: 28px;
    height: 28px;
}

/* Mobile adjustments for both buttons */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }

    .back-to-top svg {
        width: 24px;
        height: 24px;
    }
}

