/* =========================================
   Accessibility Widget Styles
   ========================================= */

:root {
    --a11y-primary: #007bff;
    --a11y-bg: #ffffff;
    --a11y-text: #333333;
    --a11y-border: #e9ecef;
    --a11y-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- Floating Button --- */
#a11y-widget-container {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
}

#a11y-toggle-btn {
    width: 50px;
    height: 50px;
    background-color: var(--a11y-primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--a11y-shadow);
    cursor: pointer;
    font-size: 24px;
    transition: transform 0.3s ease, background 0.3s;
}

#a11y-toggle-btn:hover {
    transform: scale(1.1);
}

#a11y-toggle-btn:focus {
    outline: 3px solid #ffc107;
    outline-offset: 2px;
}

/* --- Menu Sidebar/Tooltip --- */
#a11y-menu {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    background: var(--a11y-bg);
    border: 1px solid var(--a11y-border);
    border-radius: 12px;
    padding: 15px;
    width: 250px;
    box-shadow: var(--a11y-shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: right center;
}

#a11y-widget-container.active #a11y-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
    right: 70px;
    /* Slight offset */
}

.a11y-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--a11y-border);
    padding-bottom: 10px;
}

.a11y-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--a11y-text);
    font-weight: 700;
}

/* --- Option Items --- */
.a11y-option {
    margin-bottom: 12px;
}

.a11y-option label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.a11y-btn-group {
    display: flex;
    gap: 10px;
}

.a11y-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--a11y-border);
    background: #f8f9fa;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.a11y-btn:hover {
    background: #e2e6ea;
}

.a11y-btn.active {
    background: var(--a11y-primary);
    color: white;
    border-color: var(--a11y-primary);
}

.a11y-btn i {
    margin-right: 6px;
}

/* --- High Contrast Mode --- */
body.accessibility-high-contrast {
    background-color: #000000 !important;
    color: #ffffff !important;
}

body.accessibility-high-contrast * {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

body.accessibility-high-contrast a {
    color: #ffeb3b !important;
    text-decoration: underline !important;
}

body.accessibility-high-contrast button,
body.accessibility-high-contrast .btn,
body.accessibility-high-contrast .a11y-btn {
    background-color: #000 !important;
    border: 2px solid #ffeb3b !important;
    color: #ffeb3b !important;
}

body.accessibility-high-contrast .a11y-btn.active {
    background-color: #ffeb3b !important;
    color: #000 !important;
}

body.accessibility-high-contrast img {
    filter: invert(1);
    /* Invert images to match dark theme usually looks better */
}

/* --- Grayscale Mode --- */
html.accessibility-grayscale {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
}

/* --- Reset Text --- */
.a11y-reset {
    text-align: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--a11y-border);
}

.a11y-reset-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}