@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

:root {
  --red: #C8102E;
  --red-dark: #9B0D22;
  --red-light: #F9E5E8;
  --charcoal: #1A1A2E;
  --gray: #6B7280;
  --light: #F8F9FA;
  --white: #FFFFFF;
  --success: #10B981;
  --warning: #F59E0B;
  --border: #E5E7EB;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: #FAFAFA;
  color: var(--charcoal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAVBAR ── */
.navbar {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--red);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 0.25rem; list-style: none; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--gray);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--red); background: var(--red-light); }
.nav-links .btn-nav {
  background: var(--red);
  color: white !important;
  padding: 0.4rem 1rem;
  border-radius: 20px;
}
.nav-links .btn-nav:hover { background: var(--red-dark) !important; }

.hamburger { display: none; background: none; border: none; cursor: pointer; font-size: 1.5rem; color: var(--red); }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--charcoal) 0%, #2D1B2E 50%, #3D0A1A 100%);
  color: white;
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(200,16,46,0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(200,16,46,0.1) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.hero h1 span { color: var(--red); }
.hero p { font-size: 1.125rem; color: rgba(255,255,255,0.75); margin-bottom: 2rem; line-height: 1.7; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(200,16,46,0.3); }
.btn-outline { background: transparent; border-color: white; color: white; }
.btn-outline:hover { background: white; color: var(--red); }
.btn-outline-red { background: transparent; border-color: var(--red); color: var(--red); }
.btn-outline-red:hover { background: var(--red); color: white; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-danger { background: #EF4444; color: white; border-color: #EF4444; }

/* ── CARDS ── */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.card-body { padding: 1.5rem; }

/* ── DONOR CARD ── */
.donor-card { cursor: pointer; }
.donor-card .blood-badge {
  width: 56px; height: 56px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.donor-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.donor-card .meta { font-size: 0.8rem; color: var(--gray); line-height: 1.6; }

/* ── BADGE ── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-available { background: #D1FAE5; color: #065F46; }
.badge-wait { background: #FEF3C7; color: #92400E; }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-blue { background: #EFF6FF; color: #1D4ED8; }

/* ── SECTION ── */
.section { padding: 4rem 2rem; }
.section-title { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--charcoal); margin-bottom: 0.5rem; }
.section-sub { color: var(--gray); margin-bottom: 2.5rem; font-size: 0.95rem; }

.container { max-width: 1100px; margin: 0 auto; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* ── FORM ── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--charcoal); }
.form-control, .form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--charcoal);
  background: white;
  transition: border-color 0.2s;
  outline: none;
}
.form-control:focus, .form-select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,0.1); }

/* ── STAT CARD ── */
.stat-card { text-align: center; padding: 2rem 1.5rem; border-top: 4px solid var(--red); }
.stat-card .stat-num { font-family: 'Playfair Display', serif; font-size: 3rem; color: var(--red); font-weight: 700; }
.stat-card .stat-label { color: var(--gray); font-size: 0.85rem; margin-top: 0.25rem; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: 0 1px 8px rgba(0,0,0,0.07); }
table { width: 100%; border-collapse: collapse; background: white; }
thead tr { background: var(--charcoal); color: white; }
th, td { padding: 0.85rem 1rem; text-align: left; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--light); }
tbody tr:last-child td { border-bottom: none; }

/* ── ALERT ── */
.alert { padding: 1rem 1.25rem; border-radius: 8px; font-size: 0.9rem; margin-bottom: 1rem; }
.alert-success { background: #D1FAE5; color: #065F46; border-left: 4px solid var(--success); }
.alert-danger { background: #FEE2E2; color: #991B1B; border-left: 4px solid #EF4444; }
.alert-warning { background: #FEF3C7; color: #92400E; border-left: 4px solid var(--warning); }
.alert-info { background: #EFF6FF; color: #1E40AF; border-left: 4px solid #3B82F6; }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--light); border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--charcoal); }

/* ── FOOTER ── */
footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  margin-top: auto;
}
footer span { color: var(--red); }

/* ── PAGE HEADER ── */
.page-header {
  background: linear-gradient(to right, var(--red-light), white);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 2rem;
}
.page-header h2 { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--charcoal); }
.page-header p { color: var(--gray); margin-top: 0.35rem; font-size: 0.95rem; }

/* ── ADMIN SIDEBAR ── */
.admin-layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 220px;
  background: var(--charcoal);
  color: white;
  padding: 1.5rem 0;
  flex-shrink: 0;
}
.sidebar a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.sidebar a:hover, .sidebar a.active { background: rgba(200,16,46,0.2); color: white; border-left: 3px solid var(--red); }
.sidebar-title { padding: 0.5rem 1.5rem 1rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.35); }
.admin-content { flex: 1; padding: 2rem; overflow-x: auto; }

/* ── SEARCH BOX ── */
.search-bar { position: relative; }
.search-bar input { padding-left: 2.5rem; }
.search-bar::before { content: '🔍'; position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 0.9rem; }

/* ── PROFILE ── */
.profile-avatar {
  width: 80px; height: 80px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: white;
  margin: 0 auto 1rem;
}

/* ── ANIMATIONS ── */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: white; padding: 1rem; box-shadow: 0 8px 20px rgba(0,0,0,0.1); border-top: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 3rem 1.5rem; }
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 0; }
  .sidebar a { white-space: nowrap; border-left: none !important; border-bottom: 3px solid transparent; }
  .sidebar a.active { border-bottom-color: var(--red) !important; }
  .sidebar-title { display: none; }
}
