/* assets/css/app.css
   Custom styles layered on top of Tailwind CDN
   Brand: warm reds #B91C1C, golds #F5C842, navy #1E3A5F, black/white trims
*/

/* ── CSS Custom Properties ────────────────────────────── */
:root {
  --brand-red:      #B91C1C;
  --brand-red-d:    #7C0A02;
  --brand-red-l:    #EF4444;
  --brand-gold:     #F5C842;
  --brand-gold-d:   #92400E;
  --brand-gold-l:   #FDE68A;
  --brand-navy:     #1E3A5F;
  --brand-charcoal: #1F2937;
  --brand-gradient: linear-gradient(135deg, #7C0A02 0%, #B91C1C 50%, #92400E 100%);
  --radius-card:    14px;
  --shadow-card:    0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  background: #0d0d0d;
  color: #F3F4F6;
  font-family: 'Source Sans 3', system-ui, sans-serif;
}

::selection {
  background: var(--brand-gold);
  color: var(--brand-red-d);
}

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: var(--brand-red-d); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-red); }

/* ── Nav helpers ──────────────────────────────────────── */
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  transition: all 0.15s ease;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-1px);
}
.nav-active {
  background: rgba(255,255,255,0.22) !important;
  border-color: var(--brand-gold) !important;
  color: var(--brand-gold) !important;
  box-shadow: 0 0 12px rgba(245,200,66,0.2);
}
.mobile-link {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 4px;
  transition: all 0.15s;
  text-decoration: none;
}
.mobile-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
}

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: #161616;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover {
  border-color: rgba(245, 200, 66, 0.25);
}
.card-elevated {
  background: #1c1c1c;
  border: 1px solid rgba(185, 28, 28, 0.3);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(185,28,28,0.5);
}
.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 20px rgba(185,28,28,0.7);
  transform: translateY(-1px);
}
.btn-gold {
  background: var(--brand-gold);
  color: var(--brand-red-d);
  font-weight: 700;
}
.btn-gold:hover {
  background: var(--brand-gold-l);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.25);
  color: #D1D5DB;
}
.btn-outline:hover {
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}
.btn-danger {
  background: #450a0a;
  color: #FCA5A5;
  border: 1.5px solid #7f1d1d;
}
.btn-danger:hover {
  background: #7f1d1d;
  color: #fff;
}

/* ── Forms ────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #9CA3AF;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.form-input {
  width: 100%;
  background: #0d0d0d;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 10px 14px;
  color: #F3F4F6;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(185,28,28,0.2);
}
.form-input::placeholder { color: #4B5563; }
select.form-input option { background: #111; }
textarea.form-input { resize: vertical; min-height: 90px; }

.form-group { margin-bottom: 20px; }

.form-error {
  font-size: 12px;
  color: #F87171;
  margin-top: 4px;
}

/* ── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-gold    { background: rgba(245,200,66,0.15); color: var(--brand-gold); border: 1px solid rgba(245,200,66,0.3); }
.badge-red     { background: rgba(185,28,28,0.2);   color: #F87171;            border: 1px solid rgba(185,28,28,0.4); }
.badge-navy    { background: rgba(30,58,95,0.4);    color: #93C5FD;            border: 1px solid rgba(37,99,235,0.3); }
.badge-green   { background: rgba(6,78,59,0.3);     color: #6EE7B7;            border: 1px solid rgba(16,185,129,0.3); }
.badge-gray    { background: rgba(75,85,99,0.3);    color: #9CA3AF;            border: 1px solid rgba(107,114,128,0.3); }

/* ── Section headings ─────────────────────────────────── */
.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.section-subtitle {
  color: #6B7280;
  font-size: 14px;
  margin-top: 4px;
}

/* ── Gold divider line ────────────────────────────────── */
.gold-rule {
  height: 2px;
  background: linear-gradient(90deg, var(--brand-red-d), var(--brand-gold), transparent);
  border: none;
  margin: 0;
}

/* ── Page hero band ───────────────────────────────────── */
.page-hero {
  background: var(--brand-gradient);
  padding: 32px 0 28px;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.page-hero > * { position: relative; z-index: 1; }

/* ══════════════════════════════════════════════════════════
   FullCalendar overrides — mobile-first, native-app feel
══════════════════════════════════════════════════════════ */

/* ── Base ──────────────────────────────────────────────── */
.fc {
  font-family: 'Source Sans 3', sans-serif !important;
  color: #E5E7EB !important;
}

/* ── Toolbar ───────────────────────────────────────────── */
.fc-toolbar.fc-header-toolbar {
  margin-bottom: 12px !important;
  flex-wrap: wrap;
  gap: 8px;
}
.fc-toolbar-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: clamp(15px, 4vw, 20px) !important;
  color: #fff !important;
  white-space: nowrap;
}
.fc-toolbar-chunk { display: flex; align-items: center; gap: 4px; }

/* ── Nav buttons ───────────────────────────────────────── */
.fc-button-primary {
  background: rgba(124,10,2,0.7) !important;
  border: 1.5px solid rgba(185,28,28,0.5) !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 5px 10px !important;
  transition: background 0.15s !important;
}
.fc-button-primary:hover  { background: var(--brand-red) !important; }
.fc-button-active,
.fc-button-primary:not(:disabled):active {
  background: var(--brand-gold-d) !important;
  border-color: var(--brand-gold) !important;
}
/* Today button — gold accent */
.fc-today-button {
  background: rgba(146,64,14,0.5) !important;
  border-color: rgba(245,200,66,0.3) !important;
  color: var(--brand-gold) !important;
}
.fc-today-button:hover { background: var(--brand-gold-d) !important; }

/* ── Grid borders ──────────────────────────────────────── */
.fc-theme-standard td,
.fc-theme-standard th        { border-color: rgba(255,255,255,0.06) !important; }
.fc-theme-standard .fc-scrollgrid { border-color: rgba(255,255,255,0.06) !important; }

/* ── Column headers (day names) ────────────────────────── */
.fc-col-header-cell {
  padding: 6px 0 !important;
  background: rgba(0,0,0,0.2) !important;
}
.fc-col-header-cell-cushion {
  color: #9CA3AF !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  padding: 4px 6px !important;
}

/* ── Day cells — square-ish via fixed row height ───────── */
/* Desktop: comfortable rows */
.fc-daygrid-day-frame {
  min-height: 80px !important;
}
/* Day number */
.fc-daygrid-day-number {
  color: #9CA3AF !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  padding: 4px 6px !important;
  line-height: 1 !important;
}
.fc-daygrid-day:hover .fc-daygrid-day-frame {
  background: rgba(185,28,28,0.07) !important;
}
/* Today highlight */
.fc-day-today { background: rgba(245,200,66,0.06) !important; }
.fc-day-today .fc-daygrid-day-number {
  color: var(--brand-gold) !important;
  font-weight: 800 !important;
}
/* Today number pill */
.fc-day-today .fc-daygrid-day-number {
  background: var(--brand-gold) !important;
  color: #1a0a00 !important;
  border-radius: 50% !important;
  width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 3px !important;
  padding: 0 !important;
}

/* ── Event pills ───────────────────────────────────────── */
.fc-event {
  border-radius: 4px !important;
  border: none !important;
  cursor: pointer !important;
  margin: 1px 2px !important;
  transition: filter 0.12s, transform 0.12s !important;
}
.fc-event:hover {
  filter: brightness(1.2) !important;
  transform: translateY(-1px) !important;
}
/* Title: truncate cleanly, no overflow */
.fc-event-title {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 1px 4px !important;
  line-height: 1.4 !important;
}
.fc-event-time { display: none !important; } /* hide time in month grid — shown in detail modal */
/* +N more link */
.fc-daygrid-more-link {
  font-size: 10px !important;
  color: var(--brand-gold) !important;
  font-weight: 700 !important;
  padding: 0 4px !important;
}

/* ── List view ─────────────────────────────────────────── */
.fc-list-day-cushion { background: rgba(0,0,0,0.3) !important; padding: 8px 14px !important; }
.fc-list-day-text,
.fc-list-day-side-text {
  color: #D1D5DB !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}
.fc-list-event { cursor: pointer !important; }
.fc-list-event:hover td { background: rgba(185,28,28,0.1) !important; }
.fc-list-event-dot { border-color: var(--brand-gold) !important; }
.fc-list-event-time { color: #6B7280 !important; font-size: 12px !important; }
.fc-list-event-title a { color: #E5E7EB !important; text-decoration: none !important; font-size: 14px !important; }
.fc-list-empty { background: transparent !important; }
.fc-list-empty-cushion { color: #4B5563 !important; font-size: 14px !important; }

/* ── Week/time grid ────────────────────────────────────── */
.fc-timegrid-slot { height: 36px !important; }
.fc-timegrid-slot-label { color: #6B7280 !important; font-size: 11px !important; }
.fc-timegrid-axis { color: #6B7280 !important; }

/* ── Scrollbar inside calendar ─────────────────────────── */
.fc-scroller::-webkit-scrollbar { width: 4px; height: 4px; }
.fc-scroller::-webkit-scrollbar-thumb { background: rgba(185,28,28,0.4); border-radius: 4px; }

/* ─────────────────────────────────────────────────────────
   MOBILE overrides  (≤ 640px)
───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Toolbar: stack title below prev/next on very small screens */
  .fc-toolbar.fc-header-toolbar {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    gap: 6px 4px !important;
  }
  .fc-toolbar-chunk:nth-child(2) {
    grid-column: 1 / -1 !important;
    justify-content: center !important;
    order: -1 !important;
  }
  .fc-toolbar-title { font-size: 16px !important; text-align: center; }
  .fc-button-primary { padding: 4px 8px !important; font-size: 11px !important; }

  /* Tighter day cells on mobile — aim for roughly square */
  .fc-daygrid-day-frame { min-height: 52px !important; max-height: 52px !important; overflow: hidden !important; }

  /* Day number smaller */
  .fc-daygrid-day-number { font-size: 11px !important; }
  .fc-day-today .fc-daygrid-day-number {
    width: 19px !important; height: 19px !important; font-size: 10px !important;
  }

  /* Column headers: 1-letter on mobile (Mon → M) handled via JS view config */
  .fc-col-header-cell-cushion { font-size: 10px !important; padding: 3px 2px !important; }

  /* Only show 1 event pill per cell on mobile — rest become "+N more" */
  /* (controlled by JS dayMaxEvents responsive config) */
  .fc-event-title  { font-size: 10px !important; padding: 1px 3px !important; }
  .fc-daygrid-more-link { font-size: 9px !important; }

  /* List view: comfortable touch targets */
  .fc-list-event td { padding: 10px 12px !important; }
  .fc-list-event-title a { font-size: 14px !important; }

  /* Week grid: compact slots */
  .fc-timegrid-slot { height: 28px !important; }
}

/* ── Modal ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fade-in 0.15s ease;
}
.modal-box {
  background: #161616;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  animation: slide-up 0.2s ease;
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body  { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.animate-slide-in { animation: slide-in 0.3s ease forwards; }

/* ── Spinner ──────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.15);
  border-top-color: var(--brand-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tab navigation ───────────────────────────────────── */
.tab-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tab-btn:hover { color: #D1D5DB; }
.tab-btn.active {
  background: rgba(185,28,28,0.2);
  color: var(--brand-gold);
  border-bottom: 2px solid var(--brand-gold);
}

/* ── Table ────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #6B7280;
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.data-table td {
  padding: 12px 16px; font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #D1D5DB;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Utility ──────────────────────────────────────────── */
.text-gold  { color: var(--brand-gold); }
.text-red   { color: var(--brand-red-l); }
.text-muted { color: #6B7280; }
.divider    { border: none; border-top: 1px solid rgba(255,255,255,0.07); }

/* Responsive container */
.container-app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px)  { .container-app { padding: 0 24px; } }
@media (min-width: 1024px) { .container-app { padding: 0 32px; } }

/* ── Admin sidebar nav ────────────────────────────────────── */
.admin-nav-btn.active-nav {
  background: rgba(185, 28, 28, 0.18);
  color: #fff;
  border-left: 2px solid var(--brand-gold);
  padding-left: calc(0.75rem - 2px);
}

/* Highlight row animation (arriving via email link) */
@keyframes row-highlight {
  0%   { background: rgba(245,200,66,0.12); }
  100% { background: transparent; }
}
.row-highlight { animation: row-highlight 2s ease forwards; }

/* Brand gradient utility */
.bg-brand-gradient { background: var(--brand-gradient); }

/* Stat card number transition */
[data-stat] { transition: color 0.4s ease; }
