/* Accessibility toolbar stylesheet for Rivvo */

/* Focus Styles - highly visible red outline for keyboard navigation */
html.keyboard-focus :focus {
  outline: 3px solid #ef4444 !important;
  outline-offset: 3px !important;
}

/* 1. Text Resizing */
html.text-size-90 {
  font-size: 90% !important;
}
html.text-size-120 {
  font-size: 120% !important;
}
html.text-size-140 {
  font-size: 140% !important;
}
html.text-size-160 {
  font-size: 160% !important;
}

/* 2. Grayscale */
html.grayscale {
  filter: grayscale(100%) !important;
}

/* 3. High Contrast */
html.high-contrast {
  filter: contrast(160%) brightness(110%) !important;
}
html.high-contrast body {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* 4. Highlight Links */
html.highlight-links a {
  background-color: #ffff00 !important;
  color: #000000 !important;
  text-decoration: underline !important;
  font-weight: bold !important;
  outline: 2px solid #000000 !important;
}

/* 5. Highlight Headings */
html.highlight-headings h1,
html.highlight-headings h2,
html.highlight-headings h3,
html.highlight-headings h4,
html.highlight-headings h5,
html.highlight-headings h6 {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  padding: 4px 8px !important;
  width: fit-content !important;
}

/* 6. Stop Animations */
html.stop-animations *,
html.stop-animations *::before,
html.stop-animations *::after {
  animation: none !important;
  transition: none !important;
}

/* --- UI/UX Toolbar Styling --- */

/* Access Toggle Button */
.acc-toggle-btn {
  position: fixed;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #0b2d4d;
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.acc-toggle-btn:hover {
  background-color: #09223a;
  transform: scale(1.05);
}
.acc-toggle-btn:focus-visible {
  outline: 3px solid #ef4444;
  outline-offset: 3px;
}

.acc-toggle-btn.acc-ltr {
  right: 20px;
}
.acc-toggle-btn.acc-rtl {
  left: 20px;
}

/* Hide floating button on mobile — it's integrated into the bottom nav bar instead */
@media (max-width: 1023px) {
  .acc-toggle-btn {
    display: none !important;
  }
}

/* Overlay Backdrop */
.acc-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}
.acc-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Accessibility Panel Container */
.acc-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 320px;
  background-color: #ffffff;
  color: #0f172a;
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

.acc-panel.acc-ltr {
  right: 0;
  transform: translateX(100%);
  border-radius: 16px 0 0 16px;
}
.acc-panel.acc-ltr.open {
  transform: translateX(0);
}

.acc-panel.acc-rtl {
  left: 0;
  transform: translateX(-100%);
  border-radius: 0 16px 16px 0;
}
.acc-panel.acc-rtl.open {
  transform: translateX(0);
}

/* Panel Header */
.acc-header {
  padding: 16px 20px;
  background-color: #0b2d4d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.acc-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.acc-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}
.acc-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* Panel Content Scroll Area */
.acc-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Group Title */
.acc-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

/* Toggle controls grid */
.acc-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Button & Controls Row styling */
.acc-control-row {
  display: flex;
  gap: 8px;
}

.acc-btn {
  flex: 1;
  min-height: 44px; /* WCAG recommended size */
  padding: 8px 12px;
  border-radius: 8px;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.acc-btn:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}
.acc-btn.active {
  background-color: #0b2d4d;
  color: #ffffff;
  border-color: #0b2d4d;
}

/* Toggle Option Button styling */
.acc-toggle-item {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 10px;
  background-color: #f8fafc;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.acc-toggle-item:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}
.acc-toggle-item.active {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}
.acc-indicator {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.acc-toggle-item.active .acc-indicator {
  background-color: #3b82f6;
  border-color: #3b82f6;
}
.acc-toggle-item.active .acc-indicator::after {
  content: "✓";
  color: #ffffff;
  font-size: 11px;
  font-weight: bold;
}

/* Footer Section */
.acc-footer {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acc-btn-reset {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.acc-btn-reset:hover {
  background-color: #dc2626;
}

.acc-statement-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 12px;
  font-weight: 600;
  color: #0b2d4d;
  text-decoration: none;
  border: 1px dashed #0b2d4d;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}
.acc-statement-link:hover {
  background-color: #0b2d4d;
  color: #ffffff;
}

/* Mobile responsive full-width bottom drawer */
@media (max-width: 640px) {
  .acc-panel {
    width: 100% !important;
    height: 75vh !important;
    top: auto !important;
    bottom: 0 !important;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
  }
  
  .acc-panel.acc-ltr {
    right: 0 !important;
    left: 0 !important;
    transform: translateY(100%);
    border-radius: 20px 20px 0 0 !important;
  }
  .acc-panel.acc-ltr.open {
    transform: translateY(0) !important;
  }
  
  .acc-panel.acc-rtl {
    right: 0 !important;
    left: 0 !important;
    transform: translateY(100%);
    border-radius: 20px 20px 0 0 !important;
  }
  .acc-panel.acc-rtl.open {
    transform: translateY(0) !important;
  }
}
