/* Demo page styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #ffffff;
    color: #333333;
    transition: all 0.3s ease;
}

.demo-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.demo-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Professional Accessibility Widget Styles */
.asw-container * {
    box-sizing: border-box !important;
}

.asw-widget {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

.asw-menu-btn {
    position: fixed;
    z-index: 500000;
    left: 20px;
    bottom: 20px;
    box-shadow: 0 5px 15px rgba(37, 44, 97, 0.15), 0 2px 4px rgba(93, 100, 148, 0.2);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    display: flex;
    cursor: pointer;
    border: 3px solid white !important;
    outline: 5px solid #0048ff !important;
    text-decoration: none !important;
    background: linear-gradient(96deg, #326cff, #0048ff) !important;
}

.asw-menu-btn svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.asw-menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 44, 97, 0.25), 0 4px 8px rgba(93, 100, 148, 0.3);
}

.asw-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 499999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.asw-overlay.active {
    opacity: 1;
    visibility: visible;
}

.asw-menu {
    position: fixed;
    display: flex;
    flex-direction: column;
    left: 0;
    top: 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.3s ease;
    z-index: 500000;
    overflow: hidden;
    background: #eff1f5;
    width: 420px;
    line-height: 1;
    font-size: 16px;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.asw-menu.active {
    opacity: 1;
    transform: translateX(0);
}

.asw-menu * {
    color: #000 !important;
    font-family: inherit;
    padding: 0;
    margin: 0;
    line-height: 1 !important;
}

.asw-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    height: 60px;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #0848ca, #326cff) !important;
}

.asw-menu-title {
    font-size: 18px !important;
    color: #fff !important;
    font-weight: 600 !important;
}

.asw-menu-header > div {
    display: flex;
    gap: 15px;
}

.asw-menu-close, .asw-menu-reset {
    padding: 8px !important;
    background: #fff !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asw-menu-close:hover, .asw-menu-reset:hover,
.asw-menu-close:focus, .asw-menu-reset:focus {
    background: #f0f0f0 !important;
    transform: scale(1.05);
}

.asw-menu-close svg, .asw-menu-reset svg {
    width: 20px !important;
    height: 20px !important;
    fill: #0848ca !important;
}

.asw-menu-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 25px 0 20px;
}

.asw-card {
    margin: 0 20px 25px;
}

.asw-card-title {
    font-size: 15px !important;
    padding: 0 0 15px 0;
    font-weight: 600 !important;
    color: #333 !important;
    opacity: 0.8;
}

.asw-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.asw-btn {
    aspect-ratio: 1;
    border-radius: 12px;
    padding: 15px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    color: #333 !important;
    font-size: 13px !important;
    background: #fff !important;
    border: 2px solid transparent !important;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 8px;
    position: relative;
    font-weight: 500 !important;
}

.asw-btn svg {
    width: 28px !important;
    height: 28px !important;
    fill: #666 !important;
    transition: fill 0.2s ease;
}

.asw-btn:hover {
    border-color: #0848ca !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8, 72, 202, 0.15);
}

.asw-btn.active {
    border-color: #0848ca !important;
    background: #f0f6ff !important;
}

.asw-btn.active svg,
.asw-btn.active span {
    fill: #0848ca !important;
    color: #0848ca !important;
}

.asw-btn.active::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background: #0848ca;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='12' viewBox='0 -960 960 960' width='12' fill='white'%3E%3Cpath d='M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z'/%3E%3C/svg%3E");
    background-size: 8px;
    background-repeat: no-repeat;
    background-position: center;
}

.asw-adjust-font {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.asw-adjust-font .asw-label {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.asw-adjust-font .asw-label svg {
    width: 24px !important;
    height: 24px !important;
    fill: #666 !important;
    margin-right: 12px;
}

.asw-adjust-font .asw-label div {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.asw-adjust-font > div:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asw-plus, .asw-minus {
    background: #f5f7fa !important;
    border: 2px solid transparent !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.asw-plus:hover, .asw-minus:hover {
    border-color: #0848ca !important;
    background: #f0f6ff !important;
}

.asw-plus svg, .asw-minus svg {
    width: 20px !important;
    height: 20px !important;
    fill: #666 !important;
}

.asw-amount {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #0848ca !important;
    min-width: 60px;
    text-align: center;
}

.asw-tts-section {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.asw-slider-container {
    margin: 15px 0;
}

.asw-slider-container label {
    display: block;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #666 !important;
    margin-bottom: 8px;
}

.asw-slider {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.asw-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #0848ca;
    border-radius: 50%;
    cursor: pointer;
}

.asw-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #0848ca;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.asw-tts-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.asw-tts-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.asw-tts-play {
    background: #10b981 !important;
    color: white !important;
}

.asw-tts-stop {
    background: #ef4444 !important;
    color: white !important;
}

.asw-tts-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.asw-footer {
    background: #fff;
    padding: 20px;
    text-align: center;
    border-top: 2px solid #eff1f5;
    margin-top: auto;
}

.asw-footer a {
    font-size: 14px !important;
    text-decoration: none !important;
    color: #666 !important;
    font-weight: 500 !important;
}

.asw-footer span {
    font-weight: 700 !important;
    color: #0848ca !important;
}

.asw-reset-footer {
    background: #0848ca !important;
    color: white !important;
    border: none !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.2s ease !important;
}

.asw-reset-footer:hover {
    background: #0637a3 !important;
    transform: translateY(-1px);
}

/* TTS Highlighting */
.tts-highlight {
    background: linear-gradient(120deg, #fef3cd 0%, #fde68a 100%) !important;
    color: #92400e !important;
    padding: 2px 4px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.3);
}

.tts-hover-highlight {
    background: linear-gradient(120deg, #dbeafe 0%, #bfdbfe 100%) !important;
    color: #1e40af !important;
    padding: 1px 3px;
    border-radius: 3px;
    border: 1px solid #3b82f6;
}

.hover-reading-enabled {
    cursor: crosshair !important;
}

.hover-reading-enabled * {
    cursor: crosshair !important;
}

/* Reading Aids */
.reading-guide {
    position: fixed;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f87171);
    z-index: 9999;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.reading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 9998;
    display: none;
}

.reading-window {
    position: absolute;
    width: 100%;
    height: 120px;
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    transition: top 0.1s ease;
}

/* Responsive */
@media only screen and (max-width: 768px) {
    .asw-menu {
        width: 100%;
    }

    .asw-menu-btn {
        width: 48px;
        height: 48px;
    }

    .asw-menu-btn svg {
        width: 24px;
        height: 24px;
    }
}

@media only screen and (max-width: 480px) {
    .asw-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .asw-card {
        margin: 0 15px 20px;
    }
}

/* Accessibility modifications */
.high-contrast {
    background: #000000 !important;
    color: #ffffff !important;
}

.high-contrast * {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.dyslexia-friendly {
    font-family: 'OpenDyslexic', Arial, sans-serif !important;
}

.large-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="M2 2l10 28 6-8 8-6z" fill="black"/></svg>'), auto !important;
}

.large-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="M2 2l10 28 6-8 8-6z" fill="black"/></svg>'), auto !important;
}