/* Accessibility Widget UI */
#a11y-widget-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 10000;
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
}

#a11y-toggle-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 55px;
  height: 55px;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
}

#a11y-toggle-btn:hover {
  transform: scale(1.1);
  background: #2563eb;
}

#a11y-menu {
  position: absolute;
  bottom: 70px;
  left: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.2rem;
  width: 250px;
  display: none;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  animation: a11yFade 0.2s ease-out forwards;
  opacity: 0;
}

#a11y-menu.active {
  display: flex;
}

@keyframes a11yFade {
  to { opacity: 1; }
}

.a11y-menu-header {
  font-weight: 700;
  font-size: 1.1rem;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.8rem;
  margin-bottom: 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.a11y-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  line-height: 1;
}
.a11y-close-btn:hover { color: #ef4444; }

.a11y-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Toggle Switch UI */
.a11y-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.a11y-switch input { display: none; }
.a11y-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #475569;
  transition: .4s;
  border-radius: 34px;
}
.a11y-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .a11y-slider { background-color: #3b82f6; }
input:checked + .a11y-slider:before { transform: translateX(20px); }

/* =========================================
   GLOBAL OVERRIDES 
   ========================================= */

/* HIGH CONTRAST */
body.a11y-high-contrast {
  background: #000 !important;
  color: #ffcc00 !important;
}
body.a11y-high-contrast * {
  /* Force a stark yellow-on-black theme */
  background-color: #000 !important;
  color: #ffcc00 !important;
  border-color: #ffcc00 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  backdrop-filter: none !important;
}
body.a11y-high-contrast a {
  color: #fff !important;
  text-decoration: underline !important;
}
body.a11y-high-contrast img, 
body.a11y-high-contrast video,
body.a11y-high-contrast iframe {
  filter: contrast(120%) grayscale(100%) !important;
}

/* LARGE TEXT */
body.a11y-large-text {
  font-size: 125% !important;
}
body.a11y-large-text h1, 
body.a11y-large-text h2, 
body.a11y-large-text h3 {
  font-size: 135% !important;
}

/* REDUCED MOTION */
body.a11y-reduced-motion * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
