/**
 * Professional Accessibility Widget CSS
 * Mobile-responsive, professional styling for the accessibility widget
 */

/* Accessibility Toolbar */
.a11y-toolbar {
    position: fixed;
    left: 0;
    top: 120px;
    background: #389C7F;
    border-radius: 0 5px 5px 0;
    z-index: 9999;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.a11y-toggle {
    background: #389C7F;
    color: white;
    border: none;
    padding: 15px 12px;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    font-size: 20px;
    line-height: 1;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.a11y-toggle:hover {
    background: #2d7d66;
    transform: scale(1.05);
}

.a11y-toggle:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.a11y-toggle:active {
    transform: scale(0.95);
}

.a11y-menu {
    display: none;
    background: white;
    border: 2px solid #389C7F;
    border-left: none;
    border-radius: 0 5px 5px 0;
    padding: 20px;
    min-width: 250px;
    max-width: 90vw;
    position: absolute;
    left: 100%;
    top: 0;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    overflow-x: visible;
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.15);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.a11y-menu::-webkit-scrollbar {
    width: 8px;
}

.a11y-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.a11y-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.a11y-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.a11y-menu.active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.a11y-menu-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #389C7F;
    text-align: center;
}

.a11y-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: left;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: #333;
    font-family: inherit;
    min-height: 44px;
}

.a11y-menu button:last-of-type {
    margin-bottom: 0;
}

.a11y-menu button span.icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.a11y-menu button:hover {
    background: #e8e8e8;
    border-color: #389C7F;
    transform: translateX(3px);
}

.a11y-menu button:focus {
    outline: 2px solid #389C7F;
    outline-offset: 2px;
}

.a11y-menu button:active {
    transform: translateX(3px) scale(0.98);
}

.a11y-menu button.active {
    background: #389C7F;
    color: white;
    border-color: #389C7F;
}

.a11y-menu button.active:hover {
    background: #2d7d66;
    border-color: #2d7d66;
}

.a11y-reset-btn {
    margin-top: 10px !important;
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
}

.a11y-reset-btn:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

.a11y-reset-btn.active {
    background: #dc2626 !important;
}

/* Accessibility States */
body.a11y-readable-font,
body.a11y-readable-font * {
    font-family: 'Arial', sans-serif !important;
}

body.a11y-bigger-cursor,
body.a11y-bigger-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M4 4 L4 24 L10 18 L14 28 L18 26 L14 16 L22 16 Z" fill="black" stroke="white" stroke-width="2"/></svg>') 4 4, auto !important;
}

body.a11y-reading-guide {
    position: relative;
}

.reading-guide {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff0000;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    transition: top 0.1s ease;
}

body.a11y-reading-guide .reading-guide {
    display: block;
}

body.a11y-hide-images img {
    opacity: 0 !important;
}

body.a11y-high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.a11y-high-contrast * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.a11y-high-contrast a {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

body.a11y-high-contrast .a11y-toolbar {
    background: #000 !important;
    border-color: #fff !important;
}

body.a11y-high-contrast .a11y-menu {
    background: #000 !important;
    border-color: #fff !important;
    color: #fff !important;
}

body.a11y-high-contrast .a11y-menu button {
    background: #333 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.a11y-high-contrast .a11y-menu button.active {
    background: #fff !important;
    color: #000 !important;
}

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

body.a11y-negative-contrast {
    filter: invert(1) hue-rotate(180deg);
}

body.a11y-light-background {
    background: #fff !important;
}

body.a11y-underline-links a {
    text-decoration: underline !important;
}

body.a11y-stop-animations *,
body.a11y-stop-animations *::before,
body.a11y-stop-animations *::after {
    animation: none !important;
    transition: none !important;
    animation-duration: 0s !important;
    transition-duration: 0s !important;
}

/* Notification */
.a11y-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: #389C7F;
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    font-size: 14px;
    max-width: 90vw;
    text-align: center;
}

.a11y-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .a11y-toolbar {
        top: 80px;
    }

    .a11y-toggle {
        padding: 12px 10px;
        font-size: 18px;
        min-width: 44px;
        min-height: 44px;
    }

    .a11y-menu {
        min-width: 220px;
        max-width: calc(100vw - 20px);
        padding: 15px;
        max-height: calc(100vh - 20px);
    }

    .a11y-menu-title {
        font-size: 1rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .a11y-menu button {
        padding: 10px 12px;
        font-size: 0.9rem;
        margin-bottom: 6px;
        min-height: 44px;
    }

    .a11y-menu button span.icon {
        font-size: 1rem;
        width: 18px;
    }

    .a11y-notification {
        top: 10px;
        padding: 12px 20px;
        font-size: 13px;
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 480px) {
    .a11y-toolbar {
        top: 60px;
    }

    .a11y-menu {
        min-width: 200px;
        padding: 12px;
        max-height: calc(100vh - 20px);
    }

    .a11y-menu button {
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* Right position support */
.a11y-toolbar[data-position="right"] {
    left: auto;
    right: 0;
    border-radius: 5px 0 0 5px;
}

.a11y-toolbar[data-position="right"] .a11y-toggle {
    border-radius: 5px 0 0 5px;
}

.a11y-toolbar[data-position="right"] .a11y-menu {
    left: auto;
    right: 100%;
    border-left: 2px solid #389C7F;
    border-right: none;
    border-radius: 5px 0 0 5px;
}

.a11y-toolbar[data-position="right"] .a11y-menu button:hover {
    transform: translateX(-3px);
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    .a11y-toolbar {
        border: 2px solid #000;
    }

    .a11y-menu {
        border-width: 3px;
    }

    .a11y-menu button {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .a11y-menu,
    .a11y-toggle,
    .a11y-menu button,
    .a11y-notification,
    .reading-guide {
        transition: none !important;
        animation: none !important;
    }

    .a11y-menu.active {
        animation: none;
    }
}

/* Print styles - hide widget when printing */
@media print {
    .a11y-toolbar,
    .a11y-menu,
    .reading-guide,
    .a11y-notification {
        display: none !important;
    }
}

