/* ========================================
   ACCESSIBILITY PANEL - Styles
   ======================================== */

/* Panel Container */
#accessibility-panel {
    position: fixed;
    top: 90px;
    right: 16px;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    overflow: hidden;
}

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

/* Panel Header */
.a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    color: white;
}

.a11y-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-panel-header h3 svg {
    width: 20px;
    height: 20px;
}

.a11y-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.a11y-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Panel Body */
.a11y-panel-body {
    padding: 20px;
}

/* Section */
.a11y-section {
    margin-bottom: 20px;
}

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

.a11y-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Font Size Buttons */
.a11y-font-buttons {
    display: flex;
    gap: 8px;
}

.a11y-font-btn {
    flex: 1;
    padding: 10px 8px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #4b5563;
    transition: all 0.2s;
    font-size: 12px;
}

.a11y-font-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.a11y-font-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.a11y-font-btn span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 2px;
    opacity: 0.8;
}

/* Toggle Switches */
.a11y-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.a11y-toggle-row:last-child {
    border-bottom: none;
}

.a11y-toggle-label {
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-toggle-label svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

/* Toggle Switch */
.a11y-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: #e5e7eb;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.a11y-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.a11y-toggle.active {
    background: #3b82f6;
}

.a11y-toggle.active::after {
    transform: translateX(22px);
}

/* Reset Button */
.a11y-reset-btn {
    width: 100%;
    padding: 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.a11y-reset-btn:hover {
    background: #e5e7eb;
}

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

/* ========================================
   GLOBAL ACCESSIBILITY CLASSES
   ======================================== */

/* Font Size Classes */
html.a11y-font-small {
    font-size: 14px !important;
}

html.a11y-font-normal {
    font-size: 16px !important;
}

html.a11y-font-large {
    font-size: 20px !important;
}

html.a11y-font-xlarge {
    font-size: 24px !important;
}

/* Scale text proportionally */
html.a11y-font-large body,
html.a11y-font-xlarge body {
    line-height: 1.6;
}

html.a11y-font-large h1,
html.a11y-font-large h2,
html.a11y-font-large h3,
html.a11y-font-xlarge h1,
html.a11y-font-xlarge h2,
html.a11y-font-xlarge h3 {
    line-height: 1.3;
}



/* Hide Videos */
html.a11y-hide-videos video:not(.a11y-ignore),
html.a11y-hide-videos iframe[src*="youtube"]:not(.a11y-ignore),
html.a11y-hide-videos iframe[src*="vimeo"]:not(.a11y-ignore),
html.a11y-hide-videos .video-container:not(.a11y-ignore) {
    visibility: hidden !important;
}

/* Grayscale Mode */
html.a11y-grayscale {
    filter: grayscale(100%) !important;
}

html.a11y-grayscale #accessibility-panel {
    filter: grayscale(0) !important;
}

/* ========================================
   RESPONSIVE - Mobile adjustments
   ======================================== */

@media (max-width: 1023px) {
    #accessibility-panel {
        top: 60px;
        right: 8px;
        width: 300px;
    }
}

@media (max-width: 400px) {
    #accessibility-panel {
        right: 4px;
        left: 4px;
        width: auto;
    }

    .a11y-font-btn {
        padding: 8px 4px;
        font-size: 11px;
    }

    .a11y-font-btn span {
        font-size: 10px;
    }
}