/* AccessKit Pro - Frontend Widget Styles */

/* ── Floating Button ──────────────────────────────── */
#accessiq-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}
#accessiq-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
#accessiq-toggle-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ── Panel ────────────────────────────────────────── */
#accessiq-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 300px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: accessiq-slide-in 0.2s ease;
}
#accessiq-panel[hidden] { display: none; }

@keyframes accessiq-slide-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Position: bottom-left */
#accessiq-container[style*="left:"] #accessiq-panel,
#accessiq-container[style*="left: "] #accessiq-panel {
  right: auto;
  left: 24px;
}

/* ── Panel Header ─────────────────────────────────── */
.accessiq-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: #fff;
}
.accessiq-panel-title {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.accessiq-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}
.accessiq-close-btn:hover { background: rgba(255,255,255,0.2); }
.accessiq-close-btn:focus-visible { outline: 2px solid #fff; }

/* ── Feature List ─────────────────────────────────── */
.accessiq-features-list {
  padding: 8px 0;
  max-height: 380px;
  overflow-y: auto;
}

.accessiq-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  transition: background 0.1s;
  font-family: system-ui, -apple-system, sans-serif;
}
.accessiq-feature-item:hover {
  background: #f8f9fa;
}
.accessiq-feature-item.accessiq-locked {
  opacity: 0.55;
}

.accessiq-feature-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.accessiq-feature-label {
  font-size: 13.5px;
  color: #1a1a2e;
  font-weight: 500;
  flex: 1;
}

/* ── Toggle Switch ────────────────────────────────── */
.accessiq-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: none;
  background: #d1d5db;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.accessiq-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.accessiq-toggle.active .accessiq-toggle-thumb {
  transform: translateX(20px);
}
.accessiq-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ── Range Control ────────────────────────────────── */
.accessiq-range-item {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.accessiq-range-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.accessiq-range-value {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  font-family: monospace;
}
.accessiq-range-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.accessiq-range-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #d1d5db;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
  font-weight: 300;
  color: #374151;
}
.accessiq-range-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.accessiq-range-btn:focus-visible { outline: 2px solid #2563eb; }
.accessiq-range-track {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.accessiq-range-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.15s;
}

/* ── Pro Badge ────────────────────────────────────── */
.accessiq-pro-badge {
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Action Button ────────────────────────────────── */
.accessiq-action-btn {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  border: none;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.accessiq-action-btn:hover { opacity: 0.85; }

/* ── Footer ───────────────────────────────────────── */
.accessiq-panel-footer {
  border-top: 1px solid #f0f0f0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#accessiq-reset-btn {
  background: none;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: system-ui, sans-serif;
}
#accessiq-reset-btn:hover { border-color: #9ca3af; color: #374151; }
.accessiq-upgrade-link {
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  text-decoration: none;
  transition: color 0.15s;
}
.accessiq-upgrade-link:hover { color: #d97706; }

/* ── WCAG Report Modal ────────────────────────────── */
#accessiq-wcag-report {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.accessiq-report-inner {
  background: #fff;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  font-family: system-ui, sans-serif;
}
.accessiq-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.accessiq-report-header h2 {
  margin: 0;
  font-size: 18px;
}
.accessiq-report-header button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
}
#accessiq-wcag-report ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#accessiq-wcag-report li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  color: #374151;
}
#accessiq-wcag-report em { color: #6b7280; }

/* ──────────────────────────────────────────────────── */
/* Accessibility Feature Classes (applied to body)     */
/* ──────────────────────────────────────────────────── */

/* High Contrast */
body.accessiq-high-contrast {
  filter: contrast(1.5);
}

/* Dyslexia Font - uses a web-safe dyslexia-friendly font */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300..700&display=swap');
body.accessiq-dyslexia,
body.accessiq-dyslexia * {
  font-family: 'Lexend', 'Arial', sans-serif !important;
  letter-spacing: 0.05em !important;
  word-spacing: 0.1em !important;
  line-height: 1.75 !important;
}

/* Keyboard Navigation Highlights */
body.accessiq-keyboard-nav *:focus {
  outline: 3px solid #f59e0b !important;
  outline-offset: 3px !important;
  border-radius: 2px !important;
}

/* Screen Reader Mode */
body.accessiq-screen-reader .accessiq-sr-hidden {
  display: none !important;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 480px) {
  #accessiq-panel {
    width: calc(100vw - 48px);
    max-width: 300px;
  }
}
