/**
 * Accessibility Widget CSS
 * Complete styles for ADA compliance features
 */

/* ============================================
   WIDGET BUTTON & PANEL
   ============================================ */

.a11y-widget-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.a11y-widget-button:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.a11y-widget-button:focus {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.a11y-widget-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 99998;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid #e5e7eb;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Panel Header */
.a11y-panel-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.a11y-panel-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
}

.a11y-panel-title svg {
  flex-shrink: 0;
}

.a11y-panel-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* Panel Content */
.a11y-panel-content {
  padding: 20px;
}

/* Setting Group */
.a11y-setting-group {
  margin-bottom: 20px;
}

.a11y-setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  color: #374151;
}

/* Font Size Buttons */
.a11y-button-group {
  display: flex;
  gap: 8px;
}

.a11y-size-btn {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
}

.a11y-size-btn:hover {
  background: #f3f4f6;
}

.a11y-size-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.a11y-size-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Toggle Option */
.a11y-toggle-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.a11y-toggle-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.a11y-toggle-info > svg {
  color: #6b7280;
  flex-shrink: 0;
}

.a11y-toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  display: block;
  margin-bottom: 2px;
}

.a11y-toggle-description {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

/* Toggle Switch */
.a11y-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.a11y-toggle-switch:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.a11y-toggle-switch.active {
  background: #3b82f6;
}

.a11y-toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.a11y-toggle-switch.active .a11y-toggle-slider {
  transform: translateX(20px);
}

/* Reset Button */
.a11y-reset-btn {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.a11y-reset-btn:hover {
  background: #f3f4f6;
}

.a11y-reset-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ============================================
   ACCESSIBILITY MODES
   ============================================ */

/* Font Size Adjustments */
.a11y-font-large {
  font-size: 112.5% !important;
}

.a11y-font-larger {
  font-size: 125% !important;
}

.a11y-font-large *,
.a11y-font-larger * {
  font-size: inherit;
}

/* High Contrast Mode */
.a11y-high-contrast {
  background: #000 !important;
  color: #fff !important;
}

.a11y-high-contrast * {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

.a11y-high-contrast img {
  filter: contrast(1.2);
  border: 2px solid #fff !important;
}

.a11y-high-contrast a,
.a11y-high-contrast button {
  background-color: #000 !important;
  color: #ffff00 !important;
  outline: 2px solid #ffff00 !important;
  outline-offset: 2px;
}

.a11y-high-contrast .a11y-widget-button,
.a11y-high-contrast .a11y-widget-panel {
  background: #000 !important;
  border-color: #fff !important;
}

.a11y-high-contrast .a11y-size-btn.active,
.a11y-high-contrast .a11y-toggle-switch.active {
  background: #ffff00 !important;
  color: #000 !important;
}

/* Text Spacing */
.a11y-text-spacing * {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
  line-height: 1.8 !important;
}

/* Highlight Links */
.a11y-highlight-links a {
  background-color: #ffff00 !important;
  color: #000 !important;
  padding: 2px 6px !important;
  text-decoration: underline !important;
  font-weight: bold !important;
  border-radius: 2px;
}

/* Big Cursor */
.a11y-big-cursor,
.a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath fill='black' stroke='white' stroke-width='1' d='M5.5 3.21V20.8l4.86-4.86h6.78L5.5 3.21z'/%3E%3C/svg%3E"), auto !important;
}

.a11y-big-cursor a,
.a11y-big-cursor button,
.a11y-big-cursor [role="button"],
.a11y-big-cursor input,
.a11y-big-cursor select,
.a11y-big-cursor textarea {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath fill='black' stroke='white' stroke-width='1' d='M12 4C8.5 4 5.6 6.1 4.3 9.2c-.2.5.1 1 .6 1.2.5.2 1-.1 1.2-.6C7.1 7.1 9.3 5.5 12 5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.7-1.6 4.9-4.3 5.9-.5.2-.8.7-.6 1.2.2.5.7.8 1.2.6C17.9 18.4 20 15.5 20 12c0-4.4-3.6-8-8-8z'/%3E%3Ccircle fill='black' stroke='white' stroke-width='1' cx='12' cy='12' r='3'/%3E%3C/svg%3E"), pointer !important;
}

/* Reading Guide */
.a11y-reading-guide-line {
  position: fixed;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 0, 0.3) 45%,
    rgba(255, 255, 0, 0.3) 55%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 99999;
  transition: top 0.05s ease-out;
}

/* Dyslexia-Friendly Font */
.a11y-dyslexia-font,
.a11y-dyslexia-font * {
  font-family: 'Comic Sans MS', 'Arial', sans-serif !important;
}

/* Pause Animations */
.a11y-pause-animations *,
.a11y-pause-animations *::before,
.a11y-pause-animations *::after {
  animation-play-state: paused !important;
  animation-duration: 0s !important;
  transition: none !important;
}

/* ============================================
   ENHANCED FOCUS INDICATORS
   ============================================ */

*:focus-visible {
  outline: 3px solid #3b82f6 !important;
  outline-offset: 2px !important;
}

/* ============================================
   SKIP TO CONTENT LINK
   ============================================ */

.a11y-skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #3b82f6;
  color: white;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  z-index: 100000;
  transition: top 0.2s ease;
  text-decoration: none;
}

.a11y-skip-link:focus {
  top: 0;
  outline: 3px solid #ffff00;
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 640px) {
  .a11y-widget-panel {
    width: calc(100vw - 40px);
    right: 20px;
    left: 20px;
    max-height: 70vh;
  }

  .a11y-widget-button {
    bottom: 16px;
    right: 16px;
  }
}

/* ============================================
   RESPECT USER PREFERENCES
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .a11y-widget-panel {
    animation: none;
  }
}

@media (prefers-contrast: high) {
  .a11y-widget-button,
  .a11y-widget-panel,
  .a11y-size-btn,
  .a11y-toggle-option {
    border-width: 2px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .a11y-widget-button,
  .a11y-widget-panel,
  .a11y-reading-guide-line {
    display: none !important;
  }
}