/**
 * Page Overrides CSS
 * Contains page-specific style overrides extracted from inline styles
 * Version: 20260124_02
 */

/* ============================================
   HERO SECTION ADJUSTMENTS
   ============================================ */
.hero {
  padding-top: 160px !important;
}

.hero h1 {
  line-height: 1.1 !important;
  margin-bottom: 16px !important;
}

.hero h1 .line {
  display: block;
  margin-bottom: 4px;
}

/* ============================================
   LIGHT THEME - FEATURE PREVIEW FIXES
   Better text contrast for light mode
   ============================================ */
.feature-preview[data-theme="light"] .flutter-sub-team,
.feature-preview[data-theme="light"] .flutter-pos-name,
.feature-preview[data-theme="light"] .flutter-pos-stat {
  color: #212121 !important;
}

.feature-preview[data-theme="light"] .flutter-sub-date,
.feature-preview[data-theme="light"] .flutter-sub-field-time,
.feature-preview[data-theme="light"] .flutter-sub-vs,
.feature-preview[data-theme="light"] .h-pos,
.feature-preview[data-theme="light"] .h-need,
.feature-preview[data-theme="light"] .h-filled {
  color: rgba(0, 0, 0, 0.65) !important;
}

.feature-preview[data-theme="light"] .flutter-pos-stat.filled {
  color: #757575 !important;
}

.feature-preview[data-theme="light"] .flutter-pos-stat.filled.nonzero {
  color: #00a142 !important;
}

/* ============================================
   FACILITIES TOOLBAR & SEARCH
   ============================================ */
.facilities-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  margin-top: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  width: 100%;
}

.facilities-toolbar::-webkit-scrollbar {
  display: none;
}

.facilities-toolbar::after {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  flex-shrink: 0;
}

.facility-search {
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box;
  position: relative;
}

.facility-search:hover:not(.is-expanded) {
  border-color: rgba(0, 200, 81, 0.4);
}

.facility-search:hover:not(.is-expanded) .facility-search-icon {
  color: rgba(0, 200, 81, 0.9);
}

.facility-search input {
  opacity: 0;
  width: 0;
  margin-left: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  font-weight: 500;
}

.facility-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.facility-search.is-expanded {
  width: clamp(300px, 35vw, 400px);
  padding: 0 18px 0 0;
  cursor: text;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.facility-search:focus-within {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.facility-search.is-expanded input {
  opacity: 1;
  width: calc(100% - 56px);
  margin-left: 8px;
  pointer-events: auto;
  transition: opacity 0.25s ease 0.1s, width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.facility-search-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.facilities-state-filters {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.state-filter-pill {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================
   NAVIGATION DROPDOWN STYLES
   ============================================ */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-chevron {
  font-size: 18px !important;
  transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 200px;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-dropdown-menu a:hover {
  background: rgba(0, 200, 81, 0.1);
  color: var(--text);
}

.nav-dropdown-menu a .material-icons-round {
  font-size: 20px;
  color: var(--green);
}

/* ============================================
   MOBILE MENU STYLES
   ============================================ */
.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.mobile-menu-close .material-icons-round {
  font-size: 24px;
}

.mobile-menu-section {
  width: 100%;
}

.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.mobile-menu-toggle:hover {
  color: var(--text);
}

.mobile-menu-toggle .material-icons-round {
  font-size: 24px;
  transition: transform 0.2s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .material-icons-round {
  transform: rotate(180deg);
}

.mobile-menu-submenu {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.mobile-menu-submenu.is-open {
  display: flex;
}

.mobile-menu-submenu a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.1rem !important;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.mobile-menu-submenu a:hover {
  color: var(--green);
  background: rgba(0, 200, 81, 0.1);
}

.mobile-menu-submenu a .material-icons-round {
  font-size: 20px;
  color: var(--green);
}

/* ============================================
   FOOTER STYLES
   ============================================ */
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--green);
}

.footer-main {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  justify-content: space-between;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.footer-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(0, 200, 81, 0.1);
  border: 1px solid rgba(0, 200, 81, 0.3);
  border-radius: 8px;
  color: var(--green);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}

.footer-email-btn:hover {
  background: rgba(0, 200, 81, 0.2);
  border-color: var(--green);
}

.footer-email-btn .material-icons-round {
  font-size: 18px;
}

.footer-email-address {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-social {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer-social a {
  color: var(--text-muted);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-social a:hover {
  color: var(--green);
}

/* ============================================
   SKIP TO CONTENT - ACCESSIBILITY
   ============================================ */
.skip-to-content {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #000;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 10000;
  transition: top 0.3s ease;
  text-decoration: none;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid rgba(105, 240, 174, 0.85);
  outline-offset: 2px;
}

/* ============================================
   BACK TO TOP BUTTON CLEARANCE
   Extra padding at bottom so button doesn't overlap footer
   ============================================ */
body {
  padding-bottom: 80px;
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-top:hover {
  background: var(--green);
  border-color: var(--green);
  color: #000;
  transform: translateY(-2px);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top .material-icons-round {
  font-size: 24px;
}

/* Adjust position when language picker is present */
.language-picker--floating ~ .back-to-top {
  bottom: 80px;
}

/* ============================================
   IMPROVED COLOR CONTRAST
   Better accessibility for muted text
   ============================================ */
/* Increase contrast for muted text elements */
.text-muted-accessible,
.footer-email-address,
.footer-copy,
.stat-label {
  color: #9e9e9e; /* WCAG AA compliant on dark backgrounds */
}

/* ============================================
   PREFERS-REDUCED-MOTION SUPPORT
   ============================================ */
@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;
  }

  .cursor-glow {
    display: none !important;
  }

  .gradient-orb {
    animation: none !important;
  }

  .btn-glow {
    animation: none !important;
  }

  .typed-text::after {
    animation: none !important;
    content: '' !important;
  }

  .back-to-top {
    transition: opacity 0.01ms !important;
  }
}

/* ============================================
   FORM VALIDATION STYLES
   Inline validation feedback
   ============================================ */
.form-field {
  position: relative;
}

.form-field input:invalid:not(:placeholder-shown),
.form-field input.is-invalid {
  border-color: var(--red) !important;
}

.form-field input:valid:not(:placeholder-shown),
.form-field input.is-valid {
  border-color: var(--green) !important;
}

.form-error {
  display: none;
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 6px;
  padding-left: 2px;
}

.form-field.has-error .form-error {
  display: block;
}

.form-field input:focus {
  border-color: var(--green) !important;
}

/* Email validation visual indicator */
.waitlist-field-row input[type="email"]:invalid:not(:placeholder-shown) {
  border-color: rgba(255, 82, 82, 0.5) !important;
  background: rgba(255, 82, 82, 0.05);
}

.waitlist-field-row input[type="email"]:valid:not(:placeholder-shown) {
  border-color: rgba(0, 200, 81, 0.5) !important;
  background: rgba(0, 200, 81, 0.05);
}

/* ============================================
   MOBILE RESPONSIVE OVERRIDES
   ============================================ */
@media (max-width: 768px) {
  .facilities-simple .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  #facilities .facilities-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 0px !important;
    column-gap: 0px !important;
    align-items: center !important;
    margin-top: 20px !important;
    padding: 0 !important;
  }

  .facilities-simple .facilities-toolbar {
    flex-direction: row !important;
    gap: 0px !important;
    column-gap: 0px !important;
  }

  .facilities-toolbar-left {
    display: none !important;
  }

  .facility-search {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    order: 0 !important;
    margin: 0 10px 0 0 !important;
    padding: 0 !important;
  }

  .facility-search-icon {
    width: 48px;
    height: 48px;
  }

  .facility-search.is-expanded {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
  }

  .facility-search.is-expanded input {
    width: calc(100% - 56px);
  }

  .facilities-state-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    order: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
  }

  .state-filter-pill {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    margin: 0 !important;
    padding: 8px 16px !important;
  }

  .state-filter-pill:first-child {
    margin-left: 0 !important;
  }

  /* Footer mobile */
  .footer-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
    text-align: left;
    align-items: start;
  }

  .footer-brand {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 8px;
  }

  .footer-brand .footer-logo {
    justify-content: center;
  }

  .footer-links {
    text-align: left;
    align-self: start;
  }

  .footer-links h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
  }

  .footer-links a {
    font-size: 0.95rem;
    padding: 4px 0;
    display: block;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
  }

  /* Back to top button mobile position */
  .back-to-top {
    bottom: 16px;
    right: 16px;
  }

  .language-picker--floating ~ .back-to-top {
    bottom: 72px;
  }

  /* Extra bottom padding on mobile for back-to-top button */
  body {
    padding-bottom: 72px;
  }
}
