/*
 * Fresh Accessibility Widget Styles
 * Built from scratch - June 2024
 */

/* Main container - fixed to left side */
#acc-widget {
    position: fixed;
    left: 0;
    top: 150px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

/* The round button that opens the panel */
#acc-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 0 8px 8px 0;
    background: #0066cc;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

#acc-btn:hover {
    background: #0052a3;
}

#acc-btn:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

/* The panel that slides out */
#acc-panel {
    display: none;
    position: absolute;
    left: 52px;
    top: 0;
    background: #fff;
    border: 2px solid #0066cc;
    border-radius: 8px;
    box-shadow: 4px 4px 16px rgba(0,0,0,0.2);
    width: 280px;
    max-height: 80vh;
    overflow-y: auto;
}

#acc-panel.open {
    display: block;
}

/* Panel header */
#acc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
}

#acc-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

#acc-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

#acc-close:hover {
    background: #e0e0e0;
    color: #333;
}

#acc-close:focus {
    outline: 2px solid #0066cc;
}

/* Panel content */
#acc-content {
    padding: 8px;
}

/* Feature buttons */
.acc-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: #333;
    transition: background 0.15s, border-color 0.15s;
}

.acc-feature:hover {
    background: #e8f4ff;
    border-color: #0066cc;
}

.acc-feature:focus {
    outline: 2px solid #0066cc;
    outline-offset: 1px;
}

.acc-feature.on {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.acc-feature .acc-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

/* Reset button */
#acc-reset {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: #cc0000;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

#acc-reset:hover {
    background: #a30000;
}

#acc-reset:focus {
    outline: 2px solid #ffcc00;
    outline-offset: 2px;
}

/* Backdrop overlay */
#acc-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 999998;
}

#acc-backdrop.open {
    display: block;
}

/* Toast notification */
#acc-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999999;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

#acc-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Reading line */
#acc-reading-line {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(255, 255, 0, 0.3);
    border-top: 2px solid #cc0000;
    border-bottom: 2px solid #cc0000;
    pointer-events: none;
    z-index: 999997;
}

#acc-reading-line.on {
    display: block;
}

/* ========== ACCESSIBILITY EFFECTS ========== */

/* Text size is controlled via inline style on html element */

/* High contrast */
body.acc-high-contrast {
    background: #000 !important;
    color: #fff !important;
}

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

body.acc-high-contrast a {
    color: #ff0 !important;
}

body.acc-high-contrast #acc-widget,
body.acc-high-contrast #acc-widget * {
    background-color: revert !important;
    color: revert !important;
    border-color: revert !important;
}

/* Grayscale */
body.acc-grayscale {
    filter: grayscale(100%);
}

/* Invert colors */
body.acc-invert {
    filter: invert(1) hue-rotate(180deg);
}

body.acc-invert img,
body.acc-invert video {
    filter: invert(1) hue-rotate(180deg);
}

/* Underline links */
body.acc-underline-links a {
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

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

/* Big cursor */
body.acc-big-cursor,
body.acc-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M5 2 L5 28 L12 21 L18 32 L22 30 L16 19 L26 19 Z' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 5 2, auto !important;
}

/* Hide images */
body.acc-hide-images img,
body.acc-hide-images svg,
body.acc-hide-images video,
body.acc-hide-images picture {
    visibility: hidden !important;
}

/* Stop animations */
body.acc-stop-motion,
body.acc-stop-motion * {
    animation: none !important;
    transition: none !important;
}

/* Line height */
body.acc-line-height,
body.acc-line-height * {
    line-height: 2 !important;
}

/* Letter spacing */
body.acc-letter-spacing,
body.acc-letter-spacing * {
    letter-spacing: 2px !important;
    word-spacing: 4px !important;
}

