/* ==========================================================================
   Airlife Care — UI Components (Header, Buttons, Rounded Cards, Forms, Footer)
   ========================================================================== */

/* Top Emergency Dispatch Bar */
.emergency-topbar {
  background: var(--red-700);
  color: var(--text-on-red);
  font-size: 0.875rem;
  font-weight: 500;
  padding-block: 9px;
}

.emergency-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.emergency-topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
  flex-shrink: 0;
}

.emergency-topbar__call {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.14);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast);
}

.emergency-topbar__call:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Sticky Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-default);
  transition: box-shadow var(--transition-fast);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-header);
}

.site-header__inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-link img {
  height: 44px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.main-nav__link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.main-nav__link:hover,
.main-nav__link.is-active {
  color: var(--red-600);
  background: var(--red-50);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.menu-toggle:hover {
  background: var(--bg-subtle);
}

/* Mobile Slide-Over Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.mobile-drawer.is-open {
  visibility: visible;
  opacity: 1;
}

.mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.mobile-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--bg-surface);
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.16);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  transform: translateX(100%);
  transition: transform var(--transition-base);
}

.mobile-drawer.is-open .mobile-drawer__panel {
  transform: translateX(0);
}

.mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-drawer__nav a {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-primary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mobile-drawer__nav a:hover,
.mobile-drawer__nav a.is-active {
  background: var(--red-50);
  color: var(--red-700);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  min-height: 46px;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--red-600);
  color: var(--text-on-red);
  box-shadow: var(--shadow-red);
}

.btn--primary:hover {
  background: var(--red-700);
  box-shadow: 0 10px 26px -4px rgba(185, 28, 28, 0.42);
}

.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn--secondary:hover {
  border-color: var(--red-600);
  color: var(--red-700);
  background: var(--red-50);
}

.btn--white {
  background: var(--bg-surface);
  color: var(--red-700);
  box-shadow: var(--shadow-card);
}

.btn--white:hover {
  background: var(--red-50);
}

.btn--sm {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn--lg {
  min-height: 54px;
  padding: 15px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn--full {
  width: 100%;
}

/* Rounded Card System with Soft Shadows */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-red);
}

.card--red-accent {
  border-top: 4px solid var(--red-600);
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--red-50);
  border: 1px solid var(--border-red);
  color: var(--red-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--red {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid var(--border-red);
}

.badge--neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.badge--live {
  background: var(--status-live-bg);
  color: var(--status-live);
  border: 1px solid #bbf7d0;
}

/* Segmented Controls / Filter Pills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--red-700);
  background: var(--red-50);
}

.filter-tab.is-active {
  background: var(--red-600);
  color: var(--text-on-red);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}

.search-box__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box__input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  font-size: 0.9375rem;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box__input:focus {
  outline: none;
  border-color: var(--red-600);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

textarea.form-control {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.form-control:focus {
  outline: none;
  border-color: var(--red-600);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-control.is-invalid {
  border-color: var(--red-600);
  background: var(--red-50);
}

.form-error {
  font-size: 0.8rem;
  color: var(--red-700);
  font-weight: 500;
  min-height: 18px;
}

.form-feedback {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  display: none;
}

.form-feedback.is-visible {
  display: block;
}

.form-feedback--success {
  background: var(--status-live-bg);
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.faq-item.is-open {
  border-color: var(--border-red);
  box-shadow: var(--shadow-card);
}

.faq-trigger {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-primary);
}

.faq-trigger svg {
  flex-shrink: 0;
  color: var(--red-600);
  transition: transform var(--transition-fast);
}

.faq-item.is-open .faq-trigger svg {
  transform: rotate(180deg);
}

.faq-panel {
  display: none;
  padding: 0 var(--space-6) var(--space-5);
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
}

.faq-item.is-open .faq-panel {
  display: block;
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  padding-top: var(--space-16);
  padding-bottom: var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--space-8);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--border-default);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.93rem;
  margin-top: var(--space-4);
  max-width: 340px;
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.92rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--red-600);
}

.footer-emergency-box {
  background: var(--red-50);
  border: 1px solid var(--border-red);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}

.footer-emergency-box__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red-700);
  margin-bottom: 6px;
}

.footer-emergency-box__phone {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--red-700);
  margin-bottom: var(--space-3);
}

.footer-bottom {
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-legal-links {
  display: flex;
  gap: var(--space-5);
}

.footer-legal-links a:hover {
  color: var(--red-600);
}

/* Persistent Call Controls (Desktop Floating Pill + Mobile Sticky Bottom Bar) */
.floating-call-pill {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--red-600);
  color: var(--text-on-red);
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.42);
  border: 2px solid #ffffff;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.floating-call-pill:hover {
  background: var(--red-700);
  transform: translateY(-2px);
}

.floating-call-pill__num {
  font-family: var(--font-mono);
  font-size: 0.98rem;
}

.mobile-call-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 160;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-red);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
  padding: 10px 14px;
}

.mobile-call-bar__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--red-600);
  color: var(--text-on-red);
  font-weight: 800;
  font-size: 1rem;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-red);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
  grid-column: 1 / -1;
}

.empty-state h3 {
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .main-nav,
  .header-actions .btn--header-call {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .emergency-topbar__status span:nth-child(2) {
    font-size: 0.8rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .floating-call-pill {
    display: none;
  }
  .mobile-call-bar {
    display: block;
  }
}

/* WhatsApp Direct Chat Controls (Official Brand Green + Crisp SVG) */
.btn--whatsapp {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(37, 211, 102, 0.38);
}

.btn--whatsapp:hover {
  background: #1ebe5d;
  color: #ffffff;
  box-shadow: 0 10px 24px -4px rgba(30, 190, 93, 0.45);
}

.floating-actions-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.floating-actions-stack .floating-call-pill {
  position: static;
}

.floating-wa-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #25d366;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.94rem;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.38);
  border: 2px solid #ffffff;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.floating-wa-pill:hover {
  background: #1ebe5d;
  transform: translateY(-2px);
}

.mobile-call-bar--dual {
  display: none;
}

.mobile-call-bar__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mobile-wa-bar__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 13px 12px;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.32);
}

@media (max-width: 768px) {
  .floating-actions-stack {
    display: none;
  }
  .mobile-call-bar--dual {
    display: block;
  }
}
