/* ===========================================================
   Food For Needy — Charity Management System
   Custom Stylesheet (Tailwind-compatible)
   Primary: #1B5E20  |  Accent : #F9A825
   Fonts  : Inter (body) · Playfair Display (headings)
   =========================================================== */

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

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  --clr-primary-900: #0d3311;
  --clr-primary-800: #124416;
  --clr-primary-700: #16551c;
  --clr-primary-600: #1B5E20;   /* base */
  --clr-primary-500: #1f6b26;
  --clr-primary-400: #2a8a33;
  --clr-primary-300: #3da848;
  --clr-primary-200: #6bc474;
  --clr-primary-100: #c8e6c9;

  --clr-accent-600: #c6881a;
  --clr-accent-500: #e0971f;
  --clr-accent-400: #F9A825;    /* base */
  --clr-accent-300: #fbba4f;
  --clr-accent-200: #fccf7a;
  --clr-accent-100: #fde8b0;

  --clr-gray-900: #1a1a2e;
  --clr-gray-800: #2d2d44;
  --clr-gray-700: #4a4a5e;
  --clr-gray-600: #6b6b80;
  --clr-gray-500: #8e8ea0;
  --clr-gray-400: #b0b0be;
  --clr-gray-300: #d1d1db;
  --clr-gray-200: #e8e8ee;
  --clr-gray-100: #f5f5f7;
  --clr-white:    #ffffff;

  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:  0 12px 48px rgba(0,0,0,0.18);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--clr-gray-900);
  background: var(--clr-gray-100);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--clr-primary-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
  color: var(--clr-primary-600);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--clr-primary-400); }

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

/* ── Glassmorphism Cards ──────────────────────────────── */
.card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card--solid {
  background: var(--clr-white);
  backdrop-filter: none;
}

/* ── Dashboard Stat Cards ─────────────────────────────── */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--clr-primary-600), var(--clr-primary-800));
  color: var(--clr-white);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.stat-card__icon {
  font-size: 2.25rem;
  opacity: 0.85;
  flex-shrink: 0;
}
.stat-card__body { flex: 1; }
.stat-card__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}
.stat-card__value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-card--accent {
  background: linear-gradient(135deg, var(--clr-accent-400), var(--clr-accent-600));
  color: var(--clr-gray-900);
}
.stat-card--info {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
}

/* ── Status Badges ────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: capitalize;
  line-height: 1.5;
}
.badge--pending   { background: #fef3cd; color: #856404; border: 1px solid #ffc107; }
.badge--confirmed { background: #cce5ff; color: #004085; border: 1px solid #007bff; }
.badge--rejected  { background: #f8d7da; color: #721c24; border: 1px solid #dc3545; }
.badge--used      { background: #d4edda; color: #155724; border: 1px solid #28a745; }

/* ── Tables ────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead {
  background: var(--clr-primary-600);
  color: var(--clr-white);
}
th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--clr-gray-200);
  vertical-align: middle;
}
tbody tr:hover {
  background: rgba(27, 94, 32, 0.04);
}
tbody tr:last-child td {
  border-bottom: none;
}

/* ── Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-gray-700);
  margin-bottom: 0.35rem;
}
.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--clr-gray-900);
  background: var(--clr-white);
  border: 1.5px solid var(--clr-gray-300);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--clr-primary-400);
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.15);
}
.form-control::placeholder {
  color: var(--clr-gray-500);
}
textarea.form-control {
  min-height: 100px;
  resize: vertical;
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%236b6b80' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--clr-primary-600);
  color: var(--clr-white);
}
.btn--primary:hover {
  background: var(--clr-primary-500);
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.3);
}

.btn--accent {
  background: var(--clr-accent-400);
  color: var(--clr-gray-900);
}
.btn--accent:hover {
  background: var(--clr-accent-500);
  box-shadow: 0 4px 12px rgba(249, 168, 37, 0.3);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--clr-primary-600);
  color: var(--clr-primary-600);
}
.btn--outline:hover {
  background: var(--clr-primary-600);
  color: var(--clr-white);
}

.btn--danger {
  background: #dc3545;
  color: var(--clr-white);
}
.btn--danger:hover {
  background: #c82333;
}

.btn--sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn--lg { padding: 0.8rem 2rem;   font-size: 1rem; }

/* ── Donor / Admin Sidebar Layout ─────────────────────── */
.sidebar-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--clr-primary-900);
  color: var(--clr-gray-200);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 300ms ease;
  z-index: 100;
}

.sidebar__header {
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar__header h3 {
  font-family: var(--font-heading);
  color: var(--clr-white);
  font-size: 1.2rem;
  margin: 0;
}
.sidebar__header small {
  color: var(--clr-gray-500);
  font-size: 0.75rem;
}

.sidebar__nav {
  flex: 1;
  padding: 0.75rem 0;
}
.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.25rem;
  color: var(--clr-gray-400);
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.sidebar__nav a:hover,
.sidebar__nav a.active {
  background: rgba(255,255,255,0.06);
  color: var(--clr-white);
  border-left-color: var(--clr-accent-400);
}

.sidebar__footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar__footer a {
  color: var(--clr-gray-500);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar__footer a:hover { color: #f8d7da; }

.main-content {
  flex: 1;
  padding: 2rem;
  min-width: 0;
}

/* ── Mobile Hamburger Menu ────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 200;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--clr-primary-600);
  border-radius: 2px;
  transition: transform 300ms ease, opacity 300ms ease;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ── Modal Overlay (for video playback) ───────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 250ms ease;
}
.modal-overlay.open {
  display: flex;
}
.modal-overlay__content {
  position: relative;
  max-width: 900px;
  width: 100%;
  background: var(--clr-gray-900);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: slideUp 300ms ease;
}
.modal-overlay__content video,
.modal-overlay__content iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}
.modal-overlay__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: var(--clr-white);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 10;
}
.modal-overlay__close:hover {
  background: rgba(0,0,0,0.85);
}

/* ── Responsive Grid Layouts ──────────────────────────── */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ── Utility Classes ──────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--clr-gray-500); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-full { width: 100%; }

/* ── Page Hero / Header ───────────────────────────────── */
.page-header {
  padding: 2.5rem 0 1.5rem;
}
.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}
.page-header p {
  color: var(--clr-gray-600);
  font-size: 1rem;
}

/* ── Login / Auth Pages ───────────────────────────────── */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: linear-gradient(135deg, var(--clr-gray-100) 0%, var(--clr-primary-100) 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
}

/* ── Custom Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--clr-gray-200);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--clr-gray-400);
  border-radius: 4px;
  transition: background var(--transition);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--clr-gray-600);
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in  { animation: fadeIn 400ms ease forwards; }
.slide-up { animation: slideUp 400ms ease forwards; }

/* ── Flash / Alert Messages ───────────────────────────── */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border-left: 4px solid transparent;
}
.alert--success { background: #d4edda; border-color: #28a745; color: #155724; }
.alert--error   { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.alert--info    { background: #cce5ff; border-color: #007bff; color: #004085; }

/* ── Page Loader / Spinner ────────────────────────────── */
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--clr-gray-300);
  border-top-color: var(--clr-primary-600);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    padding: 1.25rem;
    padding-top: 3.5rem; /* room for a mobile top-bar with hamburger */
  }

  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }

  .stat-card__value { font-size: 1.4rem; }

  .auth-wrapper { padding: 1rem; }
}

@media (max-width: 480px) {
  .main-content { padding: 1rem; }
  .card  { padding: 1rem; }
  .stat-card { padding: 1rem; }
}
