/* ==============================================================================
   Դր. Լուսինե Սարգսյան | Ակնաբուժական Կենտրոն
   Custom Styles, Accessibility Modes, and Typography
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Armenian:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --font-base-scale: 100%;
  --primary-brand: #0284c7;
  --primary-dark: #0369a1;
  --accent-gold: #f59e0b;
}

html {
  font-size: var(--font-base-scale);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Noto Sans Armenian', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease, font-size 0.2s ease;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

/* Accessibility: Font Scaling */
html.font-scale-sm {
  --font-base-scale: 90%;
}
html.font-scale-md {
  --font-base-scale: 100%;
}
html.font-scale-lg {
  --font-base-scale: 112.5%;
}
html.font-scale-xl {
  --font-base-scale: 125%;
}

/* Accessibility: Dyslexia Friendly Mode */
body.dyslexia-mode {
  letter-spacing: 0.06em !important;
  word-spacing: 0.16em !important;
  line-height: 1.85 !important;
}

body.dyslexia-mode p,
body.dyslexia-mode h1,
body.dyslexia-mode h2,
body.dyslexia-mode h3,
body.dyslexia-mode h4,
body.dyslexia-mode span,
body.dyslexia-mode a,
body.dyslexia-mode button,
body.dyslexia-mode li {
  line-height: 1.85 !important;
  letter-spacing: 0.05em !important;
}

/* ==============================================================================
   Accessibility: High-Contrast Mode (Aesthetic, High Legibility, WCAG AAA)
   Preserves visual hierarchy and layout integrity without breaking DOM structure.
   ============================================================================== */

/* 1. Global Reset of Background Gradients in High-Contrast Mode */
body.high-contrast [class*="bg-gradient-"],
body.high-contrast .bg-gradient-to-b,
body.high-contrast .bg-gradient-to-r,
body.high-contrast .bg-gradient-to-t,
body.high-contrast .bg-gradient-to-tr,
body.high-contrast .from-sky-50\/70,
body.high-contrast .via-white,
body.high-contrast .to-slate-50,
body.high-contrast .from-white,
body.high-contrast .to-sky-50\/50,
body.high-contrast .from-sky-50,
body.high-contrast .to-white {
  background-image: none !important;
}

/* 2. Global Canvas & Sections */
body.high-contrast {
  background-color: #070b14 !important;
  color: #f8fafc !important;
}

body.high-contrast main,
body.high-contrast section {
  background-color: #070b14 !important;
  border-color: #1e293b !important;
}

body.high-contrast section:nth-of-type(even) {
  background-color: #0b111e !important;
}

/* 3. Header, Navigation & Mobile Menu */
body.high-contrast header {
  background-color: rgba(7, 11, 20, 0.98) !important;
  border-bottom-color: #1e293b !important;
}

body.high-contrast header .text-slate-900 {
  color: #ffffff !important;
}

body.high-contrast header .text-slate-500 {
  color: #94a3b8 !important;
}

body.high-contrast nav a {
  color: #f1f5f9 !important;
}

body.high-contrast nav a:hover {
  color: #38bdf8 !important;
}

body.high-contrast #mobile-menu {
  background-color: #0b111e !important;
  border-top-color: #1e293b !important;
}

body.high-contrast #mobile-menu a {
  color: #f8fafc !important;
}

body.high-contrast #mobile-menu a:hover {
  background-color: #162238 !important;
  color: #38bdf8 !important;
}

body.high-contrast #mobile-menu-toggle,
body.high-contrast .btn-high-contrast-toggle {
  background-color: #162238 !important;
  border-color: #2b3e5f !important;
  color: #38bdf8 !important;
}

/* 4. Background Replacements for Cards & Panels */
body.high-contrast .bg-white {
  background-color: #111a2c !important;
  border-color: #243552 !important;
  color: #f8fafc !important;
}

body.high-contrast .bg-slate-50 {
  background-color: #0b111e !important;
  border-color: #243552 !important;
  color: #f8fafc !important;
}

body.high-contrast .bg-slate-100 {
  background-color: #162238 !important;
  border-color: #2b3e5f !important;
  color: #f8fafc !important;
}

body.high-contrast .bg-sky-50,
body.high-contrast .bg-sky-50\/70,
body.high-contrast .bg-sky-50\/80,
body.high-contrast .bg-sky-50\/50 {
  background-color: #0f1d33 !important;
  border-color: #1e385e !important;
}

body.high-contrast .bg-sky-100,
body.high-contrast .bg-sky-100\/80 {
  background-color: #143257 !important;
  color: #38bdf8 !important;
}

body.high-contrast .bg-slate-900 {
  background-color: #050810 !important;
  border-color: #1e293b !important;
}

body.high-contrast .border-slate-100,
body.high-contrast .border-slate-200,
body.high-contrast .border-slate-200\/80,
body.high-contrast .border-slate-300 {
  border-color: #243552 !important;
}

/* 5. Typography & High Legibility Text Colors */
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6,
body.high-contrast .text-slate-900,
body.high-contrast strong,
body.high-contrast b {
  color: #ffffff !important;
}

body.high-contrast .text-transparent.bg-clip-text {
  -webkit-text-fill-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

body.high-contrast p,
body.high-contrast li,
body.high-contrast span.text-slate-800,
body.high-contrast .text-slate-800,
body.high-contrast .text-slate-700,
body.high-contrast .text-slate-600 {
  color: #f1f5f9 !important;
}

/* Secondary & Muted Labels */
body.high-contrast .text-slate-500,
body.high-contrast .text-slate-400 {
  color: #cbd5e1 !important;
}

/* Cyan / Sky Highlights */
body.high-contrast .text-sky-600,
body.high-contrast .text-sky-700,
body.high-contrast .text-sky-800,
body.high-contrast .text-sky-500,
body.high-contrast .text-sky-400 {
  color: #38bdf8 !important;
}

/* Breadcrumbs */
body.high-contrast nav[aria-label="Breadcrumb"] a {
  color: #cbd5e1 !important;
}
body.high-contrast nav[aria-label="Breadcrumb"] span {
  color: #94a3b8 !important;
}
body.high-contrast nav[aria-label="Breadcrumb"] li.text-sky-700 {
  color: #38bdf8 !important;
}

/* Badges */
body.high-contrast .bg-emerald-50 {
  background-color: #064e3b !important;
  border-color: #059669 !important;
}
body.high-contrast .text-emerald-500,
body.high-contrast .text-emerald-600,
body.high-contrast .text-emerald-700,
body.high-contrast .text-emerald-800 {
  color: #4ade80 !important;
}

body.high-contrast .bg-amber-50 {
  background-color: #451a03 !important;
  border-color: #d97706 !important;
}
body.high-contrast .text-amber-400,
body.high-contrast .text-amber-500,
body.high-contrast .text-amber-600,
body.high-contrast .text-amber-700,
body.high-contrast .text-amber-800 {
  color: #fbbf24 !important;
}

body.high-contrast .bg-rose-50 {
  background-color: #4c0519 !important;
  border-color: #9f1239 !important;
}
body.high-contrast .text-rose-500,
body.high-contrast .text-rose-600,
body.high-contrast .text-rose-700,
body.high-contrast .text-rose-800 {
  color: #fb7185 !important;
}

/* 6. Interactive Cards & FAQ */
body.high-contrast .interactive-card,
body.high-contrast .faq-item {
  background-color: #111a2c !important;
  border-color: #243552 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

body.high-contrast .interactive-card:hover {
  border-color: #38bdf8 !important;
}

body.high-contrast .faq-trigger {
  color: #ffffff !important;
}

body.high-contrast .faq-trigger:hover {
  color: #38bdf8 !important;
}

body.high-contrast .faq-answer {
  color: #e2e8f0 !important;
}

body.high-contrast .faq-answer p {
  color: #e2e8f0 !important;
}

body.high-contrast .faq-chevron {
  color: #38bdf8 !important;
}

/* 7. Comparison Table */
body.high-contrast table {
  background-color: #111a2c !important;
  border-color: #243552 !important;
}

body.high-contrast thead tr {
  background-color: #162238 !important;
}

body.high-contrast th {
  color: #ffffff !important;
  border-color: #243552 !important;
}

body.high-contrast td {
  border-color: #1e2c45 !important;
  color: #e2e8f0 !important;
}

body.high-contrast td.font-semibold {
  color: #ffffff !important;
}

body.high-contrast td.bg-sky-50\/30,
body.high-contrast th.bg-sky-50\/50 {
  background-color: #122846 !important;
  color: #38bdf8 !important;
}

body.high-contrast td.bg-slate-50\/30,
body.high-contrast tr.bg-slate-50\/70 {
  background-color: #152238 !important;
}

/* 8. Pricing Section */
body.high-contrast #pricing .bg-white {
  background-color: #142137 !important;
  border-color: #38bdf8 !important;
}

body.high-contrast #pricing .text-slate-900 {
  color: #ffffff !important;
}

body.high-contrast #pricing .text-slate-500 {
  color: #cbd5e1 !important;
}

/* 9. Forms & Inputs */
body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea {
  background-color: #070b14 !important;
  color: #ffffff !important;
  border: 1.5px solid #2e4468 !important;
}

body.high-contrast input:focus,
body.high-contrast select:focus,
body.high-contrast textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
  outline: none !important;
}

body.high-contrast input::placeholder,
body.high-contrast textarea::placeholder {
  color: #94a3b8 !important;
}

body.high-contrast label {
  color: #e2e8f0 !important;
}

/* 10. Quiz Widget in High Contrast */
body.high-contrast #quiz-widget-container .bg-white {
  background-color: #111a2c !important;
  border-color: #243552 !important;
}

body.high-contrast #quiz-widget-container h3 {
  color: #ffffff !important;
}

body.high-contrast #quiz-widget-container p {
  color: #e2e8f0 !important;
}

body.high-contrast #quiz-widget-container .text-slate-500 {
  color: #cbd5e1 !important;
}

body.high-contrast #quiz-widget-container .bg-slate-100 {
  background-color: #1b2840 !important;
}

body.high-contrast #quiz-widget-container .bg-slate-50 {
  background-color: #0b111e !important;
  border-color: #243552 !important;
}

body.high-contrast .quiz-opt-btn {
  background-color: #0b111e !important;
  border-color: #243552 !important;
  color: #ffffff !important;
}

body.high-contrast .quiz-opt-btn span {
  color: #ffffff !important;
}

body.high-contrast .quiz-opt-btn:hover {
  border-color: #38bdf8 !important;
  background-color: #13243d !important;
}

body.high-contrast .quiz-opt-btn.border-sky-600 {
  border-color: #38bdf8 !important;
  background-color: #10294a !important;
}

/* 11. Buttons & Modals */
body.high-contrast .bg-sky-600 {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  border: 1.5px solid #38bdf8 !important;
}

body.high-contrast .bg-sky-600:hover {
  background-color: #0369a1 !important;
}

body.high-contrast a.border-2,
body.high-contrast button.border-2 {
  background-color: #111a2c !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

body.high-contrast .modal-content-box {
  background-color: #111a2c !important;
  border: 1px solid #2b3e5f !important;
  color: #ffffff !important;
}

body.high-contrast .modal-content-box p {
  color: #e2e8f0 !important;
}

body.high-contrast .border-4.border-white {
  border-color: #243552 !important;
}

body.high-contrast .bg-white\/95 {
  background-color: rgba(17, 26, 44, 0.96) !important;
}

/* Active State for High Contrast Button */
.btn-high-contrast-toggle[aria-pressed="true"],
#btn-high-contrast[aria-pressed="true"] {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

body.high-contrast::-webkit-scrollbar-track {
  background: #070b14;
}
body.high-contrast::-webkit-scrollbar-thumb {
  background: #2b3e5f;
}
body.high-contrast::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

/* Accordion Smooth Transitions */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

.faq-item.active .faq-answer {
  opacity: 1;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}

.faq-chevron {
  transition: transform 0.25s ease;
}

/* Modal Animations */
.modal-backdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-content-box {
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-content-box {
  transform: scale(1) translateY(0);
}

/* Accessibility Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 2px;
}

body.high-contrast a:focus-visible,
body.high-contrast button:focus-visible,
body.high-contrast input:focus-visible,
body.high-contrast select:focus-visible,
body.high-contrast textarea:focus-visible {
  outline: 3px solid #38bdf8 !important;
  outline-offset: 2px !important;
}

/* Card hover soft elevation */
.interactive-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.interactive-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -6px rgba(2, 132, 199, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}
