/* ==========================================================================
   Accessibility Widget & Global Engine Styles
   ========================================================================== */

/* Floating Action Button */
#acc-fab {
    position: fixed;
    bottom: 20px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: transparent;
    cursor: pointer;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    padding: 0;
    outline: none;
    box-shadow: none;
}

#acc-fab:hover {
    transform: scale(1.1);
}

#acc-fab img {
    width: 5rem;
    height: 5rem;
    object-fit: contain;
}

/* Accessibility Menu */
#acc-menu {
    position: fixed;
    width: 340px;
    max-height: 85vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#acc-menu.show {
    display: flex;
}

/* Header */
.acc-header {
    background: linear-gradient(135deg, #EE5A36, #FFA18B);
    padding: 1.25rem 1.5rem;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.acc-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.acc-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.acc-close:hover {
    color: #ffffff;
    transform: scale(1.1);
}

/* Body & Grid */
.acc-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.acc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Access Button */
.acc-btn {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 0.85rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    color: #374151;
    text-decoration: none;
}

.acc-btn:hover {
    background: rgba(238, 90, 54, 0.04);
    border-color: rgba(238, 90, 54, 0.3);
    transform: translateY(-2px);
    color: #EE5A36;
}

.acc-btn.active {
    background: linear-gradient(135deg, #EE5A36 0%, #FFA18B 100%);
    border-color: #EE5A36;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(238, 90, 54, 0.25);
}

.acc-btn.active svg {
    color: #ffffff !important;
}

.acc-btn svg {
    width: 24px;
    height: 24px;
    color: #4b5563;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.acc-btn-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.25;
}

.acc-btn.active .acc-btn-label {
    color: #ffffff;
}

/* Reset Button */
.acc-reset-btn {
    width: 100%;
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.acc-reset-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* --- Accessibility Engine States (applied globally via html class) --- */

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

/* High Contrast */
.acc-high-contrast {
    filter: contrast(130%) brightness(100%) !important;
}

.acc-high-contrast body,
.acc-high-contrast section,
.acc-high-contrast div:not(#acc-menu):not(.acc-header):not(.acc-body):not(.acc-btn) {
    background-color: #000000 !important;
    color: #ffff00 !important;
}

.acc-high-contrast a,
.acc-high-contrast button:not(.acc-reset-btn):not(.acc-btn) {
    color: #00ffff !important;
    border-color: #00ffff !important;
}

/* Hide Images */
.acc-hide-images img:not(#acc-fab img),
.acc-hide-images svg:not(#acc-fab svg):not(#acc-menu svg),
.acc-hide-images video {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Readable Font */
.acc-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Pause Animations */
.acc-pause-animations * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

/* Big Cursor */
.acc-cursor-big,
.acc-cursor-big * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 512 512'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='20' d='M96 64l288 176-112 32 128 208-64 32-128-208-112 96z'/%3E%3C/svg%3E"), auto !important;
}

/* Highlight Links */
.acc-highlight-links a {
    text-decoration: underline !important;
    font-weight: bold !important;
    background-color: #ffff00 !important;
    color: #000000 !important;
    padding: 0 4px !important;
    border-radius: 4px !important;
}

/* Text Alignments */
.acc-align-left * {
    text-align: left !important;
}

.acc-align-center * {
    text-align: center !important;
}

.acc-align-right * {
    text-align: right !important;
}

.acc-align-justify * {
    text-align: justify !important;
}

/* Line Heights */
.acc-line-height-1 * {
    line-height: 1.8 !important;
}

.acc-line-height-2 * {
    line-height: 2.2 !important;
}

/* Text Spacing */
.acc-spacing-1 * {
    letter-spacing: 0.12em !important;
}

.acc-spacing-2 * {
    letter-spacing: 0.24em !important;
}
