/**
 * SAFEWebLK Accessibility Styles
 * Toolbar UI + High Contrast Mode
 */

/* ========================================
   SKIP LINK
   ======================================== */
.a11y-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #bb2a1d;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    z-index: 10000;
}

.a11y-skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ========================================
   TOOLBAR CONTAINER
   ======================================== */
.a11y-toolbar-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Toggle Button */
.a11y-toolbar-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #bb2a1d;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.a11y-toolbar-toggle:hover {
    background: #a01f15;
    box-shadow: 0 6px 16px rgba(187, 42, 29, 0.3);
    transform: scale(1.08);
}

.a11y-toolbar-toggle:active {
    transform: scale(0.96);
}

.a11y-toolbar-toggle:focus-visible {
    outline: 3px solid #4A90FF;
    outline-offset: 2px;
}

/* Panel */
.a11y-toolbar-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.a11y-toolbar-panel.a11y-panel-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Panel Header */
.a11y-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
}

.a11y-panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

.a11y-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.a11y-panel-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #222;
}

.a11y-panel-close:focus-visible {
    outline: 2px solid #4A90FF;
    outline-offset: -2px;
}

/* Panel Content */
.a11y-panel-section {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.a11y-panel-section:last-of-type {
    border-bottom: none;
}

.a11y-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.a11y-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Buttons */
.a11y-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #222;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
    min-height: 36px;
}

.a11y-btn:hover {
    background: #f8f8f8;
    border-color: #bbb;
}

.a11y-btn:active {
    transform: scale(0.96);
}

.a11y-btn:focus-visible {
    outline: 2px solid #4A90FF;
    outline-offset: -2px;
}

.a11y-btn-primary {
    background: #bb2a1d;
    color: white;
    border-color: #bb2a1d;
}

.a11y-btn-primary:hover {
    background: #a01f15;
    border-color: #a01f15;
}

.a11y-btn-primary.a11y-btn-active {
    background: #8a1810;
    animation: pulse 0.8s infinite;
}

.a11y-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border-color: #ddd;
}

.a11y-btn-secondary:hover {
    background: #efefef;
}

.a11y-btn-tertiary {
    background: white;
    color: #666;
    border: 1px solid #ddd;
    font-size: 11px;
}

.a11y-btn-tertiary:hover {
    background: #fafafa;
}

.a11y-btn-toggle {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.a11y-btn-toggle.a11y-active {
    background: #bb2a1d;
    color: white;
    border-color: #bb2a1d;
}

.a11y-font-display {
    min-width: 45px;
    text-align: center;
    font-weight: 600;
    color: #222;
    font-size: 12px;
}

/* Panel Footer */
.a11y-panel-footer {
    padding: 12px 16px;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.a11y-panel-footer small {
    color: #999;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   KEYBOARD NAVIGATION STYLES
   ======================================== */
.a11y-keyboard-nav *:focus-visible {
    outline: 4px solid #4A90FF !important;
    outline-offset: 2px !important;
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
.a11y-high-contrast {
    --text-primary: #000;
    --text-secondary: #000;
    --bg-primary: #fff;
    --bg-secondary: #f0f0f0;
    --border-color: #000;
    --accent-color: #bb2a1d;
}

.a11y-high-contrast,
.a11y-high-contrast body {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.a11y-high-contrast a {
    color: #0066ff !important;
    text-decoration: underline !important;
}

.a11y-high-contrast a:visited {
    color: #660099 !important;
}

.a11y-high-contrast button,
.a11y-high-contrast input[type="button"],
.a11y-high-contrast input[type="submit"],
.a11y-high-contrast input[type="reset"] {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
}

.a11y-high-contrast button:hover,
.a11y-high-contrast input[type="button"]:hover,
.a11y-high-contrast input[type="submit"]:hover,
.a11y-high-contrast input[type="reset"]:hover {
    background-color: #333333 !important;
    border-color: #000000 !important;
}

.a11y-high-contrast .header,
.a11y-high-contrast header {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-bottom: 3px solid #000000 !important;
}

.a11y-high-contrast .navbar {
    background-color: #000000 !important;
}

.a11y-high-contrast .navbar a {
    color: #ffffff !important;
}

.a11y-high-contrast .hero {
    background-color: #000000 !important;
    color: #ffffff !important;
}

.a11y-high-contrast .footer {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-top: 3px solid #000000 !important;
}

.a11y-high-contrast .footer a {
    color: #ffffff !important;
}

.a11y-high-contrast input,
.a11y-high-contrast textarea,
.a11y-high-contrast select {
    background-color: #f0f0f0 !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

.a11y-high-contrast input:focus,
.a11y-high-contrast textarea:focus,
.a11y-high-contrast select:focus {
    background-color: #ffffff !important;
    outline: 3px solid #0066ff !important;
    border: 2px solid #0066ff !important;
}

.a11y-high-contrast img {
    border: 1px solid #000000;
}

.a11y-high-contrast .section-title,
.a11y-high-contrast h1,
.a11y-high-contrast h2,
.a11y-high-contrast h3,
.a11y-high-contrast h4,
.a11y-high-contrast h5,
.a11y-high-contrast h6 {
    color: #000000 !important;
    font-weight: 700 !important;
}

.a11y-high-contrast .card,
.a11y-high-contrast .feature-card {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

.a11y-high-contrast .event-card {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

.a11y-high-contrast .navbar a:visited {
    color: #666666 !important;
}

/* ========================================
   ANIMATION
   ======================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .a11y-toolbar-container {
        bottom: 20px;
        right: 20px;
    }

    .a11y-toolbar-toggle {
        width: 56px;
        height: 56px;
        font-size: 20px;
    }

    .a11y-toolbar-panel {
        width: 300px;
        bottom: 70px;
        right: -10px;
    }

    .a11y-controls {
        flex-direction: column;
    }

    .a11y-btn {
        width: 100%;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .a11y-toolbar-panel,
    .a11y-btn,
    .a11y-toolbar-toggle {
        transition: none !important;
        animation: none !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .a11y-toolbar-container {
        display: none !important;
    }
}
