/**
 * ReuniteNow.org - Production Emergency Design System & Stylesheet
 * Vanilla CSS - Mobile First, Accessible, High Contrast
 */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Emergency Color Palette */
  --color-emergency-red: #DC2626;
  --color-emergency-dark: #991B1B;
  --color-emergency-light: #FEE2E2;

  --color-safe-green: #059669;
  --color-safe-light: #D1FAE5;

  --color-injured-amber: #D97706;
  --color-injured-light: #FEF3C7;

  --color-airlift-purple: #7C3AED;
  --color-airlift-light: #EDE9FE;

  --color-dead-slate: #334155;
  --color-dead-light: #E2E8F0;

  --color-slate-900: #0F172A;
  --color-slate-800: #1E293B;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748B;
  --color-slate-400: #94A3B8;
  --color-slate-200: #E2E8F0;
  --color-slate-100: #F1F5F9;
  --color-slate-50:  #F8FAFC;
  --color-white:     #FFFFFF;

  --color-primary:   #DC2626;
  --color-primary-hover: #B91C1C;
  --color-secondary: #0F172A;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-slate-50);
  color: var(--color-slate-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--color-emergency-red);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--color-emergency-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Accessibility: Focus visible outline */
:focus-visible {
  outline: 3px solid #3B82F6;
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Emergency Alert Bar */
.emergency-topbar {
  background-color: var(--color-emergency-red);
  color: var(--color-white);
  padding: 8px 0;
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid var(--color-emergency-dark);
}
.emergency-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.emergency-hotlines {
  display: flex;
  gap: 16px;
  align-items: center;
}
.hotline-badge {
  background-color: rgba(0, 0, 0, 0.25);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #4ADE80;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Crisis Broadcast Banner */
.crisis-banner {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: #F8FAFC;
  padding: 12px 0;
  border-bottom: 2px solid var(--color-emergency-red);
  font-size: 0.9375rem;
}
.crisis-banner .container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.crisis-tag {
  background-color: var(--color-emergency-red);
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Public Header */
.site-header {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-slate-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 76px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
}
.site-brand img {
  height: 48px;
  width: auto;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.nav-link {
  color: var(--color-slate-700);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all 0.15s;
  text-decoration: none !important;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-emergency-red);
  background-color: var(--color-emergency-light);
}
.nav-cta {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none !important;
  text-align: center;
  line-height: 1.25;
}
.btn-primary {
  background-color: var(--color-emergency-red);
  color: var(--color-white);
}
.btn-primary:hover {
  background-color: var(--color-emergency-dark);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background-color: var(--color-slate-800);
  color: var(--color-white);
}
.btn-secondary:hover {
  background-color: var(--color-slate-900);
  color: var(--color-white);
}
.btn-outline {
  background-color: transparent;
  color: var(--color-slate-800);
  border-color: var(--color-slate-300, #CBD5E1);
}
.btn-outline:hover {
  background-color: var(--color-slate-100);
  border-color: var(--color-slate-400);
}
.btn-success {
  background-color: var(--color-safe-green);
  color: var(--color-white);
}
.btn-success:hover {
  background-color: #047857;
  color: var(--color-white);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 14px 24px;
  font-size: 1.0625rem;
  border-radius: var(--radius-lg);
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 100%);
  padding: 48px 0 36px 0;
  border-bottom: 1px solid var(--color-slate-200);
}
.hero-content {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 36px auto;
}
.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-slate-900);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero-title span {
  color: var(--color-emergency-red);
}
.hero-subtitle {
  font-size: 1.125rem;
  color: var(--color-slate-600);
  margin-bottom: 28px;
}

/* Prominent Search Bar */
.search-hero-box {
  background-color: var(--color-white);
  padding: 8px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--color-slate-200);
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.search-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.search-input-group input {
  width: 100%;
  border: none;
  font-size: 1.125rem;
  padding: 10px 0;
  color: var(--color-slate-900);
  background: transparent;
}
.search-input-group input:focus {
  outline: none;
}

/* Live Crisis Counters */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.stat-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--color-slate-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card.stat-missing { border-top: 4px solid var(--color-emergency-red); }
.stat-card.stat-safe { border-top: 4px solid var(--color-safe-green); }
.stat-card.stat-injured { border-top: 4px solid var(--color-injured-amber); }
.stat-card.stat-airlifted { border-top: 4px solid var(--color-airlift-purple); }
.stat-card.stat-dead { border-top: 4px solid var(--color-dead-slate); }

.stat-label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-slate-500);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-slate-900);
  line-height: 1;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.badge-missing {
  background-color: var(--color-emergency-light);
  color: var(--color-emergency-dark);
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.badge-found_safe {
  background-color: var(--color-safe-light);
  color: #065F46;
  border: 1px solid rgba(5, 150, 105, 0.2);
}
.badge-injured {
  background-color: var(--color-injured-light);
  color: #92400E;
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.badge-airlifted {
  background-color: var(--color-airlift-light);
  color: #5B21B6;
  border: 1px solid rgba(124, 58, 237, 0.2);
}
.badge-dead {
  background-color: var(--color-dead-light);
  color: #1E293B;
  border: 1px solid rgba(51, 65, 85, 0.2);
}
.badge-pending {
  background-color: #FEF3C7;
  color: #B45309;
}

/* Quick Filter Chips */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.chip {
  padding: 8px 16px;
  background-color: var(--color-white);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-slate-700);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none !important;
}
.chip:hover, .chip.active {
  background-color: var(--color-slate-900);
  color: var(--color-white);
  border-color: var(--color-slate-900);
}

/* Listings Cards Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}
.person-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-slate-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.person-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-slate-300);
}
.card-photo-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  background-color: var(--color-slate-100);
  overflow: hidden;
}
.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.person-card:hover .card-photo {
  transform: scale(1.03);
}
.card-floating-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.card-tracking {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #FFF;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-slate-900);
  margin-bottom: 4px;
  line-height: 1.2;
}
.card-meta-row {
  display: flex;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--color-slate-500);
  margin-bottom: 12px;
}
.card-details {
  list-style: none;
  font-size: 0.875rem;
  margin-bottom: 16px;
  flex: 1;
}
.card-details li {
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--color-slate-700);
}
.card-details strong {
  color: var(--color-slate-900);
  font-weight: 600;
  min-width: 75px;
}
.card-footer {
  padding-top: 14px;
  border-top: 1px solid var(--color-slate-100);
  display: flex;
  gap: 8px;
}

/* Detail Profile View */
.profile-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  margin: 36px 0;
}
.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.profile-photo-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-slate-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.profile-main-photo {
  width: 100%;
  height: 380px;
  object-fit: cover;
}
.profile-actions {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-main {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-slate-200);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-slate-200);
  padding-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.profile-title-block h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-slate-900);
  margin-bottom: 6px;
}

.details-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.detail-item {
  background-color: var(--color-slate-50);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-slate-200);
}
.detail-item .label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-slate-500);
  margin-bottom: 4px;
}
.detail-item .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-slate-900);
}

.profile-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-slate-900);
  margin: 28px 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Forms & Inputs */
.form-card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-slate-200);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto 48px auto;
}
.form-section {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-slate-100);
}
.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.form-section-header {
  margin-bottom: 18px;
}
.form-section-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-slate-900);
}
.form-section-header p {
  font-size: 0.875rem;
  color: var(--color-slate-500);
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-slate-700);
  margin-bottom: 6px;
}
.form-group label .required {
  color: var(--color-emergency-red);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--color-slate-900);
  background-color: var(--color-white);
  border: 1px solid var(--color-slate-300);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}
.modal-backdrop.open {
  display: flex;
}
.modal-content {
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-slate-200);
  position: relative;
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-slate-400);
  cursor: pointer;
}
.modal-close:hover {
  color: var(--color-slate-700);
}

/* Public Footer */
.site-footer {
  background-color: var(--color-slate-900);
  color: var(--color-slate-400);
  padding: 48px 0 24px 0;
  margin-top: auto;
  border-top: 4px solid var(--color-emergency-red);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 32px;
  margin-bottom: 36px;
}
.footer-col h4 {
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 8px;
}
.footer-links a {
  color: var(--color-slate-400);
  font-size: 0.875rem;
}
.footer-links a:hover {
  color: var(--color-white);
}
.footer-bottom {
  border-top: 1px solid var(--color-slate-800);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  flex-wrap: wrap;
  gap: 12px;
}

/* Alerts & Notifications */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.alert-success { background-color: var(--color-safe-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background-color: var(--color-emergency-light); color: var(--color-emergency-dark); border: 1px solid #FECACA; }
.alert-warning { background-color: var(--color-injured-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-info    { background-color: #E0F2FE; color: #0369A1; border: 1px solid #BAE6FD; }

/* Responsive Media Queries */
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-menu { display: none; }
  .mobile-toggle { display: block; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.875rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .search-hero-box { flex-direction: column; }
}
