/* Accessibility Controls Styles for Offcanvas */

/* Accessibility button styles within offcanvas */
/* This class only handles layout and effects, not colors (Bootstrap handles colors) */
.accessibility-btn {
    transition: all 0.2s ease;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px;
}

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

.accessibility-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Active state - enhance Bootstrap's active state with better visual feedback */
.accessibility-btn.active {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    border-width: 2px;
}

.accessibility-btn.active:hover {
    transform: scale(0.95) translateY(-1px);
}

/* Highlight Links - Improved visibility */
body.highlight-links a {
    background-color: #ffff00 !important;
    color: #000 !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

body.highlight-links .sidebar .nav-link,
body.highlight-links .sidebar .nav-link:hover,
body.highlight-links .sidebar .nav-link:focus,
body.highlight-links .sidebar .nav-link:active,
body.highlight-links .sidebar .nav-link:visited,
body.highlight-links .sidebar .nav-link.active,
body.highlight-links .sidebar .nav-link[aria-current="page"] {
    background-color: transparent !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    padding: 0 !important;
    border-radius: inherit !important;
}

/* Big Cursor */
body.big-cursor,
body.big-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><circle cx="24" cy="24" r="22" fill="%23007bff" stroke="%23fff" stroke-width="3"/></svg>') 24 24, auto !important;
}

body.big-cursor a,
body.big-cursor button,
body.big-cursor input,
body.big-cursor select,
body.big-cursor textarea {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><circle cx="24" cy="24" r="22" fill="%23dc3545" stroke="%23fff" stroke-width="3"/></svg>') 24 24, pointer !important;
}

/* Text Size Adjustments - Applied to html root to prevent compounding */
html.text-size-smallest {
    font-size: 80% !important;
}

html.text-size-small {
    font-size: 90% !important;
}

html.text-size-large {
    font-size: 110% !important;
}

html.text-size-largest {
    font-size: 120% !important;
}

/* Line Height Adjustments */
body.line-height-tight * {
    line-height: 1.2 !important;
}

body.line-height-normal * {
    line-height: 1.5 !important;
}

body.line-height-loose * {
    line-height: 1.8 !important;
}

/* Screen Reader Only - Bootstrap 5 compatible */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Responsive Design for Offcanvas */
@media (max-width: 768px) {
    .accessibility-btn {
        min-width: 80px;
        padding: 10px 12px;
        font-size: 0.875rem;
    }
}

/* Print Styles */
@media print {
    .offcanvas {
        display: none !important;
    }
    
    /* Reset accessibility modifications for print */
    body.high-contrast-mode,
    body.high-contrast-mode * {
        background-color: white !important;
        color: black !important;
    }
    
    body.highlight-links a {
        background-color: transparent !important;
        color: black !important;
    }
}

/* Ensure accessibility panel content is scrollable when content overflows */
#accessibility .offcanvas-body {
    overflow-y: auto;
}

/* Badge styling for display indicators */
#textSizeDisplay,
#textSpacingDisplay {
    font-size: 0.75rem;
    padding: 4px 8px;
    min-width: 50px;
}

/* Accessibility panel button group spacing */
#accessibility .d-flex.gap-2 {
    gap: 0.5rem !important;
}

#accessibility .d-flex.justify-content-center {
    justify-content: center !important;
}

/* Accessibility offcanvas specific styles */
#accessibility .offcanvas-body {
    padding: 1rem;
}

#accessibility .offcanvas-header {
    padding: 0.75rem 1rem;
}

#accessibility hr {
    margin: 0.75rem 0;
    opacity: 0.2;
}

/* Active state for toggle buttons */
.accessibility-btn.active svg,
.accessibility-btn.active i {
    filter: brightness(1.2);
}
