/* ============================================================
   Mess Management System – Custom Styles
   Colors:
   --bg:      #F9FAFB
   --fg:      #0F172A
   --accent:  #1E3A8A
   --gold:    #C6A75E
   --success: #16A34A
   --warning: #FACC15
   --danger:  #DC2626
   ============================================================ */

:root {
  --bg:      #F9FAFB;
  --fg:      #0F172A;
  --accent:  #1E3A8A;
  --gold:    #C6A75E;
  --success: #16A34A;
  --warning: #FACC15;
  --danger:  #DC2626;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
}

/* ── Hero Gradient ───────────────────────────────────────── */
.hero-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, #1e40af 50%, #1d4ed8 100%);
}

/* ── Gold text ────────────────────────────────────────────── */
.text-gold { color: var(--gold); }
.bg-gold   { background-color: var(--gold); }

/* ── Feature Cards ───────────────────────────────────────── */
.feature-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.12);
}

/* ── Stat Card hover ─────────────────────────────────────── */
.stat-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ── Quick Action Cards ──────────────────────────────────── */
.quick-action {
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.quick-action:hover {
  transform: translateY(-2px);
}

/* ── Tables ──────────────────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Forms ───────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* ── Buttons ─────────────────────────────────────────────── */
button,
a.btn {
  transition: all 0.15s ease;
  cursor: pointer;
}

/* ── Flash Messages ──────────────────────────────────────── */
.flash-success {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}

.flash-error {
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  backdrop-filter: blur(2px);
}

/* ── Navigation Active ───────────────────────────────────── */
.nav-active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
}

/* ── Scrollbar Styling ───────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── Print Styles ────────────────────────────────────────── */
@media print {
  header, footer, nav, button, .no-print { display: none !important; }
  body { background: white; color: black; }
  table { border: 1px solid #ccc; }
  th, td { border: 1px solid #ddd; padding: 4px 8px; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .hero-gradient h1 {
    font-size: 1.75rem;
  }
}

/* ── FAQ details/summary ─────────────────────────────────── */
details > summary::-webkit-details-marker {
  display: none;
}
details > summary {
  user-select: none;
}
details[open] > summary .faq-arrow {
  transform: rotate(180deg);
}

/* ── Loading Spinner ─────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Utility ─────────────────────────────────────────────── */
.truncate-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
