/* Diagram Studio - Accessibility Widget */

/* ── State classes ── */
html.a11y-font-scale { font-size: var(--a11y-font-size, 100%) !important; }
.a11y-contrast-high { filter: contrast(1.6) !important; }
.a11y-bold-text * { font-weight: 700 !important; }
.a11y-readable-font, .a11y-readable-font * { font-family: Arial, 'Helvetica Neue', sans-serif !important; word-spacing: 0.1em; }
.a11y-highlight-links a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important; outline: 2px solid #7c3aed !important; outline-offset: 1px; border-radius: 2px; }
.a11y-stop-animations *, .a11y-stop-animations *::before, .a11y-stop-animations *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
.a11y-big-cursor, .a11y-big-cursor * { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><path d='M4 2 L4 34 L13 24 L18 36 L23 33 L18 21 L32 21 Z' fill='%23000' stroke='%23FFF' stroke-width='2'/></svg>"), auto !important; }
.a11y-focus-highlight *:focus { outline: 3px solid #7c3aed !important; outline-offset: 3px !important; box-shadow: 0 0 0 6px rgba(124,58,237,0.25) !important; }

/* ── Widget button ── */
#a11y-toggle-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(124,58,237,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 0;
  line-height: 1;
}
#a11y-toggle-btn i {
  font-size: 24px;
  line-height: 1;
  display: block;
}
#a11y-toggle-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(124,58,237,0.6); }
#a11y-toggle-btn:focus { outline: 3px solid #06b6d4; outline-offset: 3px; }

/* ── Panel ── */
#a11y-panel {
  position: fixed;
  bottom: 84px;
  left: 24px;
  z-index: 9999;
  width: 300px;
  background: rgba(6, 14, 32, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 16px;
  padding: 20px;
  color: #e2e8f0;
  font-family: 'NarkissBlock', Arial, sans-serif;
  direction: rtl;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform-origin: bottom left;
  transition: opacity 0.2s, transform 0.2s;
}
#a11y-panel.a11y-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92) translateY(8px);
}

#a11y-panel h2 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#a11y-panel .a11y-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 16px;
}

/* ── Section label ── */
.a11y-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c3aed;
  margin: 14px 0 8px;
  font-weight: 700;
}

/* ── Font size slider ── */
.a11y-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.a11y-slider-row span {
  font-size: 12px;
  color: #94a3b8;
  min-width: 36px;
  text-align: center;
}
.a11y-range {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #1e293b;
  outline: none;
  cursor: pointer;
}
.a11y-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #7c3aed;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(124,58,237,0.4);
  border: 2px solid #fff;
}
.a11y-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #7c3aed;
  cursor: pointer;
  border: 2px solid #fff;
}

/* ── Toggle grid ── */
.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.a11y-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #cbd5e1;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
  text-align: center;
  line-height: 1.3;
}
.a11y-btn i { font-size: 20px; }
.a11y-btn:hover { background: rgba(124,58,237,0.15); border-color: rgba(124,58,237,0.4); }
.a11y-btn.active { background: rgba(124,58,237,0.25); border-color: #7c3aed; color: #fff; }

/* ── Reset & close row ── */
.a11y-footer {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.a11y-reset-btn, .a11y-close-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.a11y-reset-btn:hover, .a11y-close-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
