:root {
  --font-size: 100%;
  --letter-spacing: normal;
  --word-spacing: normal;
  --line-height: 1.5;
}

html {
  font-size: var(--font-size);
}

body {
  font-size: 1rem;
  letter-spacing: var(--letter-spacing);
  word-spacing: var(--word-spacing);
  line-height: var(--line-height);
}

.hide-images img {
  filter: brightness(0) invert(1);
}

/* Force inheritance for most elements */
body * {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
}

/* Exceptions for form elements */
input,
button,
textarea,
select {
  font-size: initial;
  line-height: normal;
}

/* Dyslexia Font */
.dyslexia-font {
  font-family: 'Comic Sans MS', 'OpenDyslexic', Arial, sans-serif;
}

/* Night Mode */
.night-mode {
  background-color: #1a1a1a !important;
  color: #e0e0e0 !important;
}

/* Desaturate Theme */
.desaturate-theme {
  filter: saturate(0.3);
}

/* Blue Filter */
.blue-filter {
  filter: hue-rotate(180deg) brightness(1.1) contrast(1.1);
}

/* Big Cursor */
.big-cursor * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path d="M4 4 L28 4 L4 28 Z" fill="%23000"/></svg>') 16 16, pointer !important;
}

/* Tall Links */
.tall-links a {
  padding: 4px 8px;
  margin: 2px 0;
  display: inline-block;
  border-radius: 4px;
  background-color: rgb(37 99 235 / 23%);
  transition: all 0.2s ease;
}

.tall-links a:hover {
  background-color: rgba(37, 99, 235, 0.2);
  text-decoration: none;
}

/* Help Button */
#helpButton {
  position: fixed;
  bottom: 145px;
  right: 9px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
    background:linear-gradient(90deg, #4d4d4e 0%, #ff9800 100%);
  color: white;
  font-size: 24px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  z-index: 100;
  /* animation: pulse 2s infinite; */
}

#helpButton:hover::before {
    content: "";
    position: absolute;
    right:49px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
     border-color: transparent #ff9800 transparent transparent;
    transition: opacity 0.4s ease;
}

#helpButton:hover .tooltip-accessibility {
    opacity: 1;
    transform: translateY(-50%) translateX(-8px);
}

#helpButton::focus-visible {
  border:0!important;
}

#helpButton .tooltip-accessibility {
    position: absolute;
    right: 90%;
    top: 50%;
    transform: translateY(-50%);
    background:linear-gradient(90deg, #4d4d4e 0%, #ff9800 100%);
    color: #fff;
    padding: 12px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Modal Backdrop */
#modalBackdrop {
  position: fixed;
  inset: 0;
  background: none !important;
  display: none;
  align-items: center;
  justify-content: end;
  z-index: 10000;
  right: 12px;
}

/* Modal Box */
#accessibilityModal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  animation: fadeIn 0.3s ease;
  margin-top: 14%;
}

.modal-normal {
  width: 90vw;
  max-width: 330px;
  min-height: 70vh;
}

.modal-xl {
  width: 95vw !important;
  max-width: 800px !important;
 /*  min-height: 90vh;
  max-height: 95vh; */
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(30px);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.modal-header {
    background: rgb(245 153 34);
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header .icon-circle {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-size: 18px;
}

.modal-header .title {
  font-size: 18px;
  font-weight: bold;
}

.modal-header .subtitle {
  font-size: 13px;
  opacity: 0.9;
}

.modal-header .actions button {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  margin-left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-header .actions button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Modal Content */
.modal-content {
  padding: 24px;
  overflow-y: auto;
  height: 52vh;
  overflow-x: hidden;
}

/* Active Features Section */
.active-features {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: none;
  animation: slideUp 0.3s ease;
}

.active-features-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.active-features-header span {
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
}

.reset-button {
  background: linear-gradient(to right, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}

.reset-button:hover {
  transform: scale(1.05);
}

.active-features-list {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.active-feature-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #4b5563;
}

.active-feature-item:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

.active-feature-item .feature-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-feature-item .feature-name i {
  color: #10b981;
}

.remove-feature {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.remove-feature:hover {
  color: #ef4444;
  background-color: #f9fafb;
  transform: scale(1.1);
}

/* Quick Access Section */
.accessbility-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 480px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

.option-button {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-button:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.option-button.selected {
  box-shadow: 0 0 0 2px #3b82f6;
}

.option-icon {
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 16px;
}

.option-button.selected .option-icon {
  background-color: #dbeafe;
  color: #2563eb;
}

.option-label {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  transition: opacity 0.3s ease;
}

/* Range Sliders */
.range-container {
  padding: 12px;
  margin-top: 8px;
  display: none;
}

.range-slider {
  width: 100%;
  margin: 8px 0;
}

.slider-value {
  text-align: center;
  font-weight: bold;
}

.cursor-preview {
  text-align: center;
  margin-top: 8px;
  font-size: 24px;
}

/* More Options Section */
.more-options-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #2563eb;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.more-options-toggle:hover {
  color: #1d4ed8;
}

.more-options-toggle i {
  transition: transform 0.2s ease;
}

.more-options-toggle.expanded i {
  transform: rotate(180deg);
}

.more-options {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.more-options.expanded {
  max-height: 1000px;
}

/* Translation Modal */
#translationModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.translation-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
}

.language-option {
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-option:hover {
  background: #f5f5f5;
}

/* Modal Footer */
.modal-footer {
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 16px 24px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  justify-content: center;
}

/* Custom Scrollbar */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Test Content */
.test-content {
  max-width: 800px;
  margin: 0 auto;
}

h1 {
  margin: 20px 0;
  color: #1f2937;
}

button,
input {
  margin: 8px 0;
  padding: 8px 12px;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.night-mode-icon {
  transition: transform 0.3s ease;
}

.animate__flip {
  animation-name: flip;
  animation-duration: 0.6s;
}

@keyframes flip {
  from {
    transform: perspective(400px) rotateY(0);
  }

  50% {
    transform: perspective(400px) rotateY(90deg);
  }

  to {
    transform: perspective(400px) rotateY(0);
  }
}

[data-night-icon="true"] {
  transition: all 0.3s ease;
  display: inline-block;
}

.animate__flip {
  animation: flip 0.6s ease;
}

@keyframes flip {
  0% {
    transform: rotateY(0);
  }

  50% {
    transform: rotateY(90deg);
  }

  100% {
    transform: rotateY(0);
  }
}

.bi .bi-sun-fill {
  color: #dbbd60 !important;
}

.animate__fadeIn {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Text highlight style */
.text-speech-highlight {
  background-color: #ffeb3b;
  /* Yellow highlight */
  color: #000;
  padding: 2px 0;
  border-radius: 3px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

/* Speaker icon animation */
[data-speaker-icon="true"] {
  transition: all 0.3s ease;
}

.animate__pulse {
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}