/* Cloudn Accessibility Panel */

:root {
    --acw-font-scale: 1;
    --acw-letter-spacing: 0px;
    --acw-line-height: 1.6;
    --acw-text-color: inherit;
    --acw-heading-color: inherit;
    --acw-background-color: inherit;
}

#acw-toolbar-toggle {
    position: fixed;
    left: 24px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #0a74ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(15, 75, 190, 0.25);
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#acw-toolbar-toggle:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

#acw-toolbar-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 75, 190, 0.35);
}

#acw-toolbar {
    position: fixed;
    left: 24px;
    bottom: 80px;
    width: min(360px, calc(100vw - 56px));
    max-height: calc(100vh - 140px);
    background: #ffffff;
    color: #0a1a33;
    border-radius: 14px;
    box-shadow: 0 18px 52px rgba(15, 34, 74, 0.22);
    z-index: 9997;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: "Red Hat Display", "Segoe UI", Arial, sans-serif;
    touch-action: pan-y;
}

body.acw-panel-open #acw-toolbar {
    display: flex;
}

.acw-toolbar__header {
    background: linear-gradient(135deg, #0a74ff, #29c2ff);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.acw-toolbar__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.acw-toolbar__close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

.acw-toolbar__body {
    overflow-y: auto;
    padding: 16px 20px 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
    -webkit-overflow-scrolling: touch;
}

.acw-section {
    margin-bottom: 20px;
}

.acw-section:last-child {
    margin-bottom: 0;
}

.acw-section h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.acw-section h3 span {
    font-size: 22px;
}

.acw-grid {
    display: grid;
    gap: 10px;
}

.acw-grid--profiles {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.acw-grid--controls {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
}

.acw-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #dde3f1;
    box-shadow: 0 4px 12px rgba(10, 40, 80, 0.06);
    transition: box-shadow 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

.acw-card button {
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0;
    color: inherit;
    cursor: pointer;
}

.acw-card__title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.acw-card__desc {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.4;
}

.acw-card[data-active="true"] {
    border-color: #0a74ff;
    box-shadow: 0 12px 32px rgba(10, 116, 255, 0.18);
}

.acw-card[data-active="true"] .acw-card__title {
    color: #0a74ff;
}

.acw-pill-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dde3f1;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(10, 116, 255, 0.04);
}

.acw-pill-group button {
    border: none;
    background: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0a74ff;
    box-shadow: 0 8px 16px rgba(10, 116, 255, 0.15);
}

.acw-pill-value {
    min-width: 36px;
    text-align: center;
    font-weight: 600;
    color: #0a1a33;
}

.acw-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.acw-palette__option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    padding: 10px 6px;
    background: #fff;
    border: 1px solid #dbe3f5;
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.acw-palette__option:focus-visible {
    outline: 3px solid #0a74ff;
    outline-offset: 3px;
}

.acw-palette__option[data-active="true"] {
    border-color: #0a74ff;
    box-shadow: 0 10px 22px rgba(10, 116, 255, 0.18);
    transform: translateY(-2px);
}

.acw-palette__option[data-active="true"] .acw-palette__color {
    box-shadow: 0 0 0 3px rgba(10, 116, 255, 0.6), 0 6px 14px rgba(10, 116, 255, 0.25);
}

.acw-palette__color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(10, 34, 64, 0.18);
}

.acw-palette__label {
    font-size: 11px;
    font-weight: 600;
    color: #0a1a33;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acw-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #dde3f1;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.acw-toggle__label {
    font-weight: 600;
    font-size: 14px;
}

.acw-toggle__desc {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.acw-toggle__control {
    position: relative;
    width: 46px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5f5;
    transition: background 0.3s ease;
}

.acw-toggle__control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}

.acw-toggle[data-active="true"] {
    border-color: #0a74ff;
    box-shadow: 0 12px 24px rgba(10, 116, 255, 0.18);
}

.acw-toggle[data-active="true"] .acw-toggle__control {
    background: #0a74ff;
}

.acw-toggle[data-active="true"] .acw-toggle__control::after {
    transform: translateX(22px);
}

.acw-toolbar__footer {
    padding: 12px 20px 18px;
    background: #eff3fb;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.acw-footer-button {
    flex: 1 1 auto;
    min-width: 130px;
    background: #fff;
    border: 1px solid #cdd9ef;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    color: #0a1a33;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.acw-footer-button--primary {
    background: linear-gradient(135deg, #0a74ff, #29c2ff);
    color: #fff;
    border: none;
}

.acw-footer-button:hover {
    box-shadow: 0 10px 24px rgba(10, 34, 80, 0.16);
}

/* Accessibility adjustments */

html {
    font-size: calc(100% * var(--acw-font-scale));
}

body.acw-letter-spacing,
body.acw-letter-spacing *:not(i):not(svg):not(path) {
    letter-spacing: var(--acw-letter-spacing) !important;
}

body.acw-line-height p,
body.acw-line-height li,
body.acw-line-height span,
body.acw-line-height a,
body.acw-line-height div {
    line-height: var(--acw-line-height) !important;
}

body.acw-readable-font,
body.acw-readable-font * {
    font-family: "Arial", "Helvetica Neue", Helvetica, sans-serif !important;
}

body.acw-highlight-headings h1,
body.acw-highlight-headings h2,
body.acw-highlight-headings h3,
body.acw-highlight-headings h4,
body.acw-highlight-headings h5,
body.acw-highlight-headings h6 {
    background: linear-gradient(120deg, rgba(10, 116, 255, 0.12), rgba(41, 194, 255, 0.12));
    padding: 4px 8px;
    border-radius: 6px;
}

body.acw-highlight-links a {
    background: rgba(255, 246, 0, 0.4);
    box-shadow: inset 0 -4px 0 rgba(255, 211, 0, 0.9);
    color: #000 !important;
}

body.acw-text-align-left * {
    text-align: left !important;
}

body.acw-text-align-center * {
    text-align: center !important;
}

body.acw-text-align-right * {
    text-align: right !important;
}

body.acw-dark-mode {
    background: #101522 !important;
    color: #f2f5ff !important;
}

body.acw-dark-mode *,
body.acw-dark-mode *::before,
body.acw-dark-mode *::after {
    background-color: transparent;
    color: #f2f5ff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

body.acw-light-mode {
    background: #ffffff !important;
    color: #0a0f1f !important;
}

body.acw-text-magnifier .acw-magnifier-target {
    transition: transform 0.15s ease, background 0.15s ease;
}

body.acw-text-magnifier .acw-magnifier-target:hover {
    transform: scale(1.15);
    background: rgba(255, 250, 200, 0.9);
    box-shadow: 0 12px 24px rgba(10, 34, 60, 0.25);
}

body.acw-high-contrast {
    filter: contrast(1.4);
}

body.acw-low-saturation {
    filter: saturate(0.3);
}

body.acw-high-saturation {
    filter: saturate(1.8);
}

body.acw-monochrome {
    filter: grayscale(1);
}

body.acw-text-color,
body.acw-text-color * {
    color: var(--acw-text-color) !important;
}

body.acw-heading-color h1,
body.acw-heading-color h2,
body.acw-heading-color h3,
body.acw-heading-color h4,
body.acw-heading-color h5,
body.acw-heading-color h6 {
    color: var(--acw-heading-color) !important;
}

body.acw-background-color {
    background: var(--acw-background-color) !important;
}

body.acw-hide-images img,
body.acw-hide-images svg {
    opacity: 0 !important;
    visibility: hidden !important;
}

body.acw-reading-mode main,
body.acw-reading-mode #main-body,
body.acw-reading-mode .container,
body.acw-reading-mode .wrap {
    max-width: 820px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.92);
    padding: 24px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(10, 25, 52, 0.12);
}

body.acw-reading-mode {
    background: #eef2f7 !important;
}

body.acw-stop-animations *,
body.acw-seizure-safe * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

body.acw-hover-highlight *:hover {
    box-shadow: 0 0 0 3px rgba(10, 116, 255, 0.45) !important;
    background: rgba(10, 116, 255, 0.08) !important;
}

body.acw-focus-outline *:focus {
    outline: 3px solid #ffde59 !important;
    outline-offset: 3px !important;
}

body.acw-big-cursor-black {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23000'/%3E%3C/svg%3E") 12 12, auto !important;
}

body.acw-big-cursor-white {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Ccircle cx='12' cy='12' r='12' fill='%23ffffff' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") 12 12, auto !important;
}

body.acw-vision-profile {
    filter: contrast(1.4) saturate(1.2);
    font-size: 110%;
}

body.acw-adhd-profile * {
    outline: none !important;
}

body.acw-adhd-profile .acw-focus-target,
body.acw-adhd-profile :focus {
    background: rgba(255, 225, 0, 0.4) !important;
    outline: 3px solid rgba(10, 116, 255, 0.6) !important;
}

body.acw-cognitive-profile {
    letter-spacing: 0.04em !important;
    font-size: 105%;
}

body.acw-keyboard-profile *:focus-visible {
    outline: 4px solid rgba(255, 165, 0, 0.8) !important;
}

body.acw-screenreader-profile a,
body.acw-screenreader-profile button,
body.acw-screenreader-profile input,
body.acw-screenreader-profile select,
body.acw-screenreader-profile textarea {
    border-bottom: 2px dashed #0a74ff !important;
}

#acw-reading-guide,
#acw-reading-mask {
    position: fixed;
    pointer-events: none;
    left: 0;
    width: 100vw;
    z-index: 9996;
    display: none;
}

#acw-reading-guide {
    height: 120px;
    background: rgba(10, 116, 255, 0.12);
    border-top: 2px solid rgba(10, 116, 255, 0.4);
    border-bottom: 2px solid rgba(10, 116, 255, 0.4);
}

#acw-reading-mask {
    top: 0;
    bottom: 0;
    right: 0;
    background: rgba(10, 15, 30, 0.82);
    backdrop-filter: blur(1px);
    clip-path: circle(0 at 50% 50%);
    transition: clip-path 0.1s ease;
}

body.acw-reading-guide-active #acw-reading-guide {
    display: block;
}

body.acw-reading-mask-active #acw-reading-mask {
    display: block;
}

body.acw-panel-open #acw-reading-guide,
body.acw-panel-open #acw-reading-mask {
    display: none;
}

@media (max-width: 768px) {
    #acw-toolbar {
        left: 10px;
        right: 10px;
        width: auto;
        bottom: 74px;
        max-height: calc(100vh - 110px);
    }

    #acw-toolbar-toggle {
        left: 14px;
        bottom: 14px;
    }

    .acw-grid--profiles {
        grid-template-columns: 1fr;
    }

    .acw-grid--controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .acw-palette__option {
        flex: 1 1 calc(50% - 8px);
        max-width: calc(50% - 8px);
        width: 100%;
    }
}

@media (max-width: 480px) {
    #acw-toolbar-toggle {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    #acw-toolbar {
        bottom: 68px;
        max-height: calc(100vh - 96px);
    }

    .acw-toolbar__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .acw-toolbar__close {
        align-self: flex-end;
    }

    .acw-grid--controls {
        grid-template-columns: 1fr;
    }

    .acw-palette__option {
        flex: 1 1 48%;
        max-width: 100%;
    }
}

