/* ==============================================
   ADA / WCAG 2.1 AA Compliance Styles
   ============================================== */

/* =============================================
   SKIP NAVIGATION LINK
   ============================================= */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  background: #005fcc;
  color: #ffffff;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: top 0.2s ease;
  white-space: nowrap;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
  color: #ffffff;
  text-decoration: none;
}

/* =============================================
   FOCUS VISIBLE — Global
   All interactive elements get visible focus ring
   ============================================= */
:focus-visible {
  outline: 3px solid #4fc3f7 !important;
  outline-offset: 2px !important;
}

/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Links */
a:focus-visible {
  outline: 3px solid #4fc3f7 !important;
  outline-offset: 2px !important;
  border-radius: 2px;
}

/* Buttons */
button:focus-visible,
.btn:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible {
  outline: 3px solid #4fc3f7 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.3) !important;
}

/* Form inputs */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #4fc3f7 !important;
  outline-offset: 0 !important;
  border-color: #4fc3f7 !important;
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.25) !important;
}

/* Checkboxes & radios */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 3px solid #4fc3f7 !important;
  outline-offset: 3px !important;
}

/* Dropdown items */
.dropdown-item:focus-visible {
  background: rgba(79, 195, 247, 0.15) !important;
  outline: 2px solid #4fc3f7 !important;
  outline-offset: -2px !important;
}

/* Nav links */
.nav-link:focus-visible,
.navbar-nav .nav-link:focus-visible {
  outline: 3px solid #4fc3f7 !important;
  outline-offset: 2px !important;
}

/* Cards */
.card:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #4fc3f7 !important;
  outline-offset: 2px !important;
}

/* Video player */
.video-js *:focus-visible {
  outline: 2px solid #4fc3f7 !important;
  outline-offset: 1px !important;
}

/* =============================================
   SCREEN READER ONLY (sr-only)
   ============================================= */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sr-only-focusable:focus,
.visually-hidden-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: inherit !important;
  margin: inherit !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* =============================================
   COLOR CONTRAST ENHANCEMENTS
   Ensure min 4.5:1 for normal text, 3:1 for large
   ============================================= */

/* Light text on dark background — minimum contrast */
body,
.main-wrapper,
.movie-card,
.video-card {
  color: #e0e0e0; /* contrast: 12.6:1 on dark bg */
}

/* Secondary/muted text — ensure readable */
.text-muted,
.text-secondary,
small,
.small {
  color: #9e9e9e !important; /* 4.6:1 on dark bg */
}

/* Links — ensure visible */
a {
  text-decoration-skip-ink: auto;
}

/* Placeholder text — accessible */
::placeholder {
  color: #8a8a8a !important; /* 4.5:1 minimum */
  opacity: 1;
}

/* =============================================
   REDUCED MOTION — Accessibility
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .slick-slider .slick-track,
  .owl-carousel .owl-stage {
    transition: none !important;
  }
}

/* =============================================
   ARIA LANDMARKS — Visual Indicators (Dev mode)
   ============================================= */

/* Ensure main content is identifiable */
[role="main"],
main {
  display: block;
}

/* =============================================
   IMAGES — Ensure non-decorative have alt
   ============================================= */
img:not([alt]) {
  outline: 3px solid #ff0000;
  outline-offset: 2px;
}

/* Decorative images */
img[alt=""],
img[role="presentation"] {
  outline: none;
}

/* =============================================
   FORM ACCESSIBILITY
   ============================================= */

/* Required field indicator */
.required::after,
label.required::after {
  content: " *";
  color: #ff5252;
  font-weight: bold;
  aria-hidden: true;
}

/* Error state — visible and announced */
.is-invalid,
.has-error .form-control,
.form-control.error {
  border-color: #ff5252 !important;
  box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.25) !important;
}

.invalid-feedback,
.error-message,
.help-block.with-errors {
  color: #ff8a80;
  font-size: 13px;
  margin-top: 4px;
}

/* Success state */
.is-valid,
.has-success .form-control {
  border-color: #69f0ae !important;
}

/* =============================================
   KEYBOARD NAVIGATION — Modal trap
   ============================================= */
.modal.show {
  overflow-y: auto;
}

/* Ensure modal content is reachable by tab */
.modal-content {
  position: relative;
}

/* =============================================
   LIVE REGIONS
   ============================================= */
[aria-live] {
  position: relative;
}

/* Status messages */
.alert[role="alert"] {
  padding: 12px 16px;
  border-radius: 6px;
}

/* =============================================
   HIGH CONTRAST MODE SUPPORT
   ============================================= */
@media (forced-colors: active) {
  .btn {
    border: 2px solid ButtonText;
  }

  a {
    color: LinkText;
  }

  :focus-visible {
    outline: 3px solid Highlight !important;
  }

  .form-control {
    border: 1px solid ButtonText;
  }
}

/* =============================================
   TOUCH TARGETS — WCAG 2.5.5 (AAA) / 2.5.8 (AA)
   Minimum 44x44px for touch targets
   ============================================= */
@media (pointer: coarse) {
  a, button, .btn,
  input[type="submit"],
  input[type="button"],
  input[type="checkbox"],
  input[type="radio"],
  .nav-link,
  .dropdown-toggle,
  .pagination .page-link {
    min-height: 44px;
    min-width: 44px;
  }

  /* Ensure adequate spacing between interactive items */
  .nav-link,
  .dropdown-item,
  .list-group-item {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* =============================================
   TEXT SIZING — Support browser zoom
   ============================================= */
html {
  font-size: 100%; /* Respect user browser settings */
}

/* Don't use px for body font-size, use rem */
body {
  font-size: 1rem;
  line-height: 1.5;
}

/* Ensure text can be resized up to 200% */
@media (min-resolution: 1dppx) {
  body {
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
  }
}
