/* Accessibility Widget Styles */
#accessibility-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#accessibility-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #24d3ff);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124, 92, 255, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#accessibility-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(124, 92, 255, 0.5);
}

#accessibility-toggle:focus {
  outline: 3px solid rgba(124, 92, 255, 0.5);
  outline-offset: 2px;
}

#accessibility-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 320px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  display: none;
  animation: slideUp 0.3s ease-out;
}

#accessibility-panel.active {
  display: block;
}

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

.accessibility-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.accessibility-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
}

.accessibility-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #718096;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.accessibility-close:hover {
  background: #f0f0f0;
  color: #2d3748;
}

.accessibility-control {
  margin-bottom: 1rem;
}

.accessibility-control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.accessibility-control .control-buttons {
  display: flex;
  gap: 0.5rem;
}

.accessibility-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  color: #2d3748;
}

.accessibility-btn:hover {
  border-color: #7c5cff;
  background: rgba(124, 92, 255, 0.05);
  color: #7c5cff;
}

.accessibility-btn.active {
  background: linear-gradient(135deg, #7c5cff, #24d3ff);
  border-color: #7c5cff;
  color: white;
}

.accessibility-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.accessibility-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.accessibility-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e0;
  transition: 0.3s;
  border-radius: 26px;
}

.accessibility-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.accessibility-toggle-switch input:checked + .accessibility-slider {
  background: linear-gradient(135deg, #7c5cff, #24d3ff);
}

.accessibility-toggle-switch input:checked + .accessibility-slider:before {
  transform: translateX(24px);
}

.accessibility-reset {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #f0f0f0;
}

.accessibility-reset-btn {
  width: 100%;
  padding: 0.75rem;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  color: #2d3748;
  cursor: pointer;
  transition: all 0.2s ease;
}

.accessibility-reset-btn:hover {
  background: #e2e8f0;
}

/* Accessibility Effects */
body.text-large {
  font-size: 1.25rem;
}

body.text-larger {
  font-size: 1.5rem;
}

body.text-largest {
  font-size: 1.75rem;
}

body.high-contrast {
  background: #000 !important;
  color: #fff !important;
}

body.high-contrast .glass,
body.high-contrast .card,
body.high-contrast .bg-white {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.links-highlighted a {
  background: yellow !important;
  color: #000 !important;
  padding: 2px 4px !important;
  font-weight: bold !important;
  text-decoration: underline !important;
}

body.reading-guide::before {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100vh;
  background: rgba(124, 92, 255, 0.5);
  z-index: 9999;
  pointer-events: none;
}

body.no-animations * {
  animation: none !important;
  transition: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  #accessibility-widget {
    bottom: 15px;
    right: 15px;
  }

  #accessibility-toggle {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  #accessibility-panel {
    width: calc(100vw - 30px);
    right: 0;
    bottom: 75px;
  }
}
