/* Accessible & Mobile-First Styles for EdUro C# Blazor Frontend */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&family=Lexend:wght@300;400;500;600;700&display=swap');

:root {
  --font-family-lexend: 'Lexend', sans-serif;
  --font-family-atkinson: 'Atkinson Hyperlegible', sans-serif;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  font-family: var(--font-family-lexend);
  background-color: #f8fafc;
  color: #1e293b;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

.font-lexend {
  font-family: var(--font-family-lexend);
}

.font-atkinson {
  font-family: var(--font-family-atkinson) !important;
}

/* Hide scrollbars on horizontal swipe strips while keeping touch scroll active */
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* Safe area padding for mobile bottom bars & modals */
.pb-safe {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0.75rem));
}

/* Prevent iOS Safari auto-zoom on form fields & enforce comfortable touch targets on mobile */
@media (max-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 44px;
  }

  .touch-target {
    min-height: 44px;
    min-width: 44px;
  }
}

/* High Contrast Mode (WCAG AAA) */
.high-contrast {
  background-color: #000000 !important;
  color: #ffffff !important;
}

.high-contrast header,
.high-contrast footer,
.high-contrast .bg-white,
.high-contrast .bg-slate-50,
.high-contrast .bg-slate-50\/50,
.high-contrast .bg-slate-100,
.high-contrast .bg-indigo-50,
.high-contrast .bg-indigo-50\/50,
.high-contrast .bg-indigo-50\/30,
.high-contrast .bg-emerald-50,
.high-contrast .bg-green-50,
.high-contrast .bg-green-50\/50,
.high-contrast .bg-blue-50\/50 {
  background-color: #0a0a0a !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

.high-contrast .text-slate-400,
.high-contrast .text-slate-500,
.high-contrast .text-slate-600,
.high-contrast .text-slate-700,
.high-contrast .text-slate-800,
.high-contrast .text-slate-900,
.high-contrast .text-indigo-900,
.high-contrast .text-emerald-900,
.high-contrast .text-blue-900 {
  color: #f8fafc !important;
}

.high-contrast input,
.high-contrast select,
.high-contrast textarea {
  background-color: #000000 !important;
  color: #fde047 !important;
  border: 2px solid #ffffff !important;
}

.high-contrast button,
.high-contrast a.rounded-xl,
.high-contrast a.rounded-lg {
  border: 2px solid #ffffff !important;
}

.high-contrast :focus-visible {
  outline: 3px solid #fde047 !important;
  outline-offset: 2px;
}

/* Dyslexia Friendly Spacing */
.dyslexia-friendly {
  letter-spacing: 0.04em;
  word-spacing: 0.1em;
  line-height: 1.75;
}

/* Custom Scrollbar for Desktop */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: #f1f5f9;
  }
  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
}

/* EdUro visual system */
:root {
  --edu-ink: #172554;
  --edu-primary: #4f46e5;
  --edu-primary-dark: #3730a3;
  --edu-accent: #047857;
  --edu-canvas: #f5f7ff;
  --edu-border: #dce5f2;
  --edu-focus: #f59e0b;
}

.edu-shell {
  background:
    radial-gradient(ellipse at 12% 0, rgba(224, 231, 255, 0.62), transparent 38rem),
    linear-gradient(180deg, #f8faff 0%, var(--edu-canvas) 100%);
}

.edu-header {
  background-color: rgba(255, 255, 255, 0.94) !important;
  border-color: var(--edu-border) !important;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.06);
  backdrop-filter: blur(14px);
}

.edu-header button,
.edu-header a.rounded-xl {
  min-height: 44px;
}

.edu-brand img {
  display: block;
  border-radius: 0.75rem;
}

.edu-main {
  padding-block: clamp(1.25rem, 3vw, 2.5rem);
}

.edu-footer {
  border-color: var(--edu-border) !important;
  background-color: rgba(255, 255, 255, 0.78) !important;
}

.edu-landing h1 {
  color: var(--edu-ink);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  text-wrap: balance;
}

.edu-landing-mark {
  background: linear-gradient(135deg, #eef2ff, #d1fae5) !important;
}

.edu-primary-action,
.edu-secondary-action {
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.edu-primary-action {
  background-color: var(--edu-primary) !important;
  box-shadow: 0 12px 24px -14px rgba(79, 70, 229, 0.8);
}

.edu-primary-action:hover {
  background-color: var(--edu-primary-dark) !important;
  box-shadow: 0 16px 28px -14px rgba(55, 48, 163, 0.65);
}

.edu-secondary-action {
  border-color: #cbd5e1 !important;
}

.edu-feature-card {
  position: relative;
  overflow: hidden;
  border-color: var(--edu-border) !important;
  background: linear-gradient(145deg, #fff 60%, #f5f7ff) !important;
  box-shadow: 0 12px 30px -24px rgba(30, 41, 59, 0.45);
}

.edu-feature-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--edu-primary), #34d399);
  content: "";
}

.edu-auth-card {
  border-color: var(--edu-border) !important;
  box-shadow: 0 28px 64px -42px rgba(30, 41, 59, 0.42);
}

.edu-auth-card input,
.edu-auth-card select {
  border-color: #cbd5e1;
}

.edu-page h1,
.edu-page h2,
.edu-page h3 {
  text-wrap: pretty;
}

.edu-page .bg-white.rounded-2xl {
  border-color: var(--edu-border) !important;
  box-shadow: 0 12px 28px -24px rgba(30, 41, 59, 0.45);
}

.edu-page button {
  min-width: 44px;
  min-height: 44px;
}

.edu-welcome {
  background: linear-gradient(115deg, #4338ca 0%, #4f46e5 56%, #2563eb 100%) !important;
  box-shadow: 0 20px 36px -24px rgba(67, 56, 202, 0.75);
}

.edu-goal-banner {
  border-color: #a7f3d0 !important;
}

.edu-mobile-switcher {
  background-color: #e8edf7 !important;
}

.edu-day-strip [role="tab"] {
  min-width: 4rem;
}

.edu-tabs {
  border-color: var(--edu-border) !important;
}

.edu-tabs [role="tab"][aria-selected="true"] {
  background-color: var(--edu-primary) !important;
  box-shadow: 0 8px 18px -12px rgba(79, 70, 229, 0.85);
}

.edu-tabs [role="tab"]:focus-visible,
.edu-day-strip [role="tab"]:focus-visible {
  outline: 3px solid var(--edu-focus);
  outline-offset: 2px;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--edu-focus);
  outline-offset: 3px;
}

.high-contrast .edu-shell,
.high-contrast .edu-header,
.high-contrast .edu-footer,
.high-contrast .edu-feature-card {
  background: #000 !important;
}

.high-contrast .edu-primary-action,
.high-contrast .edu-tabs [role="tab"][aria-selected="true"] {
  background: #000 !important;
  color: #ff0 !important;
}

.high-contrast .edu-page .bg-white.rounded-2xl {
  border-color: #fff !important;
  box-shadow: none !important;
}

.high-contrast .edu-feature-card::before {
  background: #fff;
}

@media (max-width: 640px) {
  .edu-main {
    padding-block: 1rem;
  }

  .edu-landing > div:first-child {
    max-width: 100%;
  }

  .edu-feature-card {
    padding-inline: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
