/* ===== Milpitas Food Pantry Plugin Styles ===== */
:root {
  --mfp-green: #2d6a4f;
  --mfp-green-light: #40916c;
  --mfp-green-pale: #d8f3dc;
  --mfp-red: #dc3545;
  --mfp-red-pale: #f8d7da;
  --mfp-bg: #f8f9fa;
  --mfp-card: #ffffff;
  --mfp-text: #212529;
  --mfp-muted: #6c757d;
  --mfp-border: #dee2e6;
  --mfp-radius: 8px;
  --mfp-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.mfp-wrap { max-width: 760px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--mfp-text); line-height: 1.6; }
.mfp-card { background: var(--mfp-card); border-radius: var(--mfp-radius); box-shadow: var(--mfp-shadow); padding: 2rem; margin-bottom: 1.5rem; }
.mfp-wrap h1 { color: var(--mfp-green); font-size: 1.75rem; margin-bottom: 0.5rem; }
.mfp-wrap h2 { color: var(--mfp-green); font-size: 1.3rem; margin-bottom: 1rem; }
.mfp-wrap h3 { font-size: 1.05rem; margin-bottom: 0.75rem; }

.mfp-text-muted { color: var(--mfp-muted); font-size: 0.9rem; }
.mfp-link { color: var(--mfp-green); font-weight: 500; font-size: 0.9rem; }

/* Progress bar */
.mfp-progress { display: flex; gap: 4px; margin-bottom: 2rem; }
.mfp-progress-dot { flex: 1; height: 4px; background: var(--mfp-border); border-radius: 2px; }
.mfp-progress-dot.done { background: var(--mfp-green); }

/* Steps */
.mfp-step { display: none; }
.mfp-step.active { display: block; }

/* Labels & inputs */
.mfp-wrap label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.95rem; }
.mfp-wrap input, .mfp-wrap select, .mfp-wrap textarea {
  width: 100%; padding: 0.75rem; border: 1px solid var(--mfp-border);
  border-radius: var(--mfp-radius); font-size: 1rem; margin-bottom: 1rem; font-family: inherit;
}
.mfp-wrap input:focus, .mfp-wrap select:focus, .mfp-wrap textarea:focus {
  outline: 2px solid var(--mfp-green-light); border-color: var(--mfp-green-light);
}
/* Missing required field */
.mfp-wrap .mfp-input-error { border-color: var(--mfp-red) !important; background: var(--mfp-red-pale); }
.mfp-wrap .mfp-input-error:focus { outline-color: var(--mfp-red); }

/* ===== Admin page (works on the frontend page AND inside wp-admin) ===== */
.mfp-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 1.5rem; }
.mfp-tabs .mfp-tab { padding: 0.5rem 1.1rem; border: 1px solid var(--mfp-border); border-bottom: 3px solid var(--mfp-border); border-radius: 6px 6px 0 0; background: #fff; color: var(--mfp-text); text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.mfp-tabs .mfp-tab:hover { border-color: var(--mfp-green-light); color: var(--mfp-green); }
.mfp-tabs .mfp-tab.mfp-tab-active { background: var(--mfp-green); border-color: var(--mfp-green); color: #fff; }
.mfp-tabs .mfp-tab.mfp-tab-danger { color: var(--mfp-red); }
.mfp-tabs .mfp-tab.mfp-tab-danger:hover { border-color: var(--mfp-red); }

/* Admin tables: small type, roomy cells, top-aligned rows.
   The scroller bounds tall tables; the header row sticks to its top and the
   name column sticks to its left edge, so a scrolled table still reads. */
.mfp-admin-scroller { overflow: auto; max-height: 70vh; border: 1px solid var(--mfp-border); background: #fff; }
.mfp-admin-table { font-size: 0.85rem; border-collapse: separate; border-spacing: 0; width: 100%; background: #fff; }
.mfp-admin-table th, .mfp-admin-table td { padding: 0.55rem 0.75rem; border-right: 1px solid var(--mfp-border); border-bottom: 1px solid var(--mfp-border); vertical-align: top; text-align: left; }
.mfp-admin-table thead th { background: #f0f4f8; color: var(--mfp-green); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; position: sticky; top: 0; z-index: 2; }
.mfp-admin-table tbody tr:nth-child(even) { background: #fafbfc; }
.mfp-admin-table td:first-child, .mfp-admin-table th:first-child { position: sticky; left: 0; z-index: 1; border-left: none; box-shadow: inset -1px 0 0 var(--mfp-border); background: #fff; }
.mfp-admin-table thead th:first-child { z-index: 3; }
.mfp-admin-table tbody tr:nth-child(even) td:first-child { background: #fafbfc; }
.mfp-admin-table .mfp-admin-actions { display: flex; flex-direction: column; gap: 0.35rem; align-items: stretch; }
.mfp-admin-table td ul.mfp-admin-dates { margin: 0; padding-left: 1rem; }
.mfp-admin-table td ul.mfp-admin-dates li { margin: 0.1rem 0; }

/* Confirmation: this submission's dates first, full schedule below */
.mfp-confirm-new { font-weight: 700; color: var(--mfp-green); font-size: 1.05rem; padding: 0.1rem 0; }
.mfp-confirm-all-label { margin-top: 1rem; font-weight: 600; color: var(--mfp-muted); }
.mfp-confirm-all { color: var(--mfp-text); font-size: 0.95rem; }

/* Welcome-screen mini calendar */
.mfp-mini-cal { margin: 1.25rem 0; padding-top: 1rem; border-top: 1px solid var(--mfp-border); }
.mfp-mini-cal h3 { margin-bottom: 0.25rem; }

/* Buttons */
.mfp-btn { display: inline-block; padding: 0.75rem 1.5rem; border: none; border-radius: var(--mfp-radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.mfp-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mfp-btn-primary { background: var(--mfp-green); color: #fff; }
.mfp-btn-primary:hover:not(:disabled) { background: var(--mfp-green-light); }
.mfp-btn-danger { background: var(--mfp-red); color: #fff; }
.mfp-btn-outline { background: transparent; border: 1px solid var(--mfp-green); color: var(--mfp-green); }
.mfp-btn-outline:hover { background: var(--mfp-green-pale); }

/* Alerts */
.mfp-alert { padding: 1rem; border-radius: var(--mfp-radius); margin-bottom: 1rem; font-weight: 500; }
.mfp-alert-danger { background: var(--mfp-red-pale); color: #721c24; border: 1px solid #f5c6cb; }
.mfp-alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* Welcome */
.mfp-welcome { background: var(--mfp-green-pale); padding: 1.25rem; border-radius: var(--mfp-radius); border-left: 4px solid var(--mfp-green); margin-bottom: 1.5rem; line-height: 1.7; }

/* Nav buttons */
.mfp-nav { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* Calendar */
.mfp-cal-wrap { display: flex; flex-wrap: wrap; gap: 0.75rem; border: 1px solid var(--mfp-border); border-radius: var(--mfp-radius); padding: 0.75rem; background: #fafafa; margin-bottom: 1rem; }
.mfp-cal-legend { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--mfp-muted); margin-bottom: 0.5rem; flex-wrap: wrap; width: 100%; }
.mfp-cal-legend .mfp-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.mfp-cal-legend .mfp-dot-open { background: var(--mfp-green); }
.mfp-cal-legend .mfp-star { margin-right: 3px; vertical-align: middle; }
.mfp-cal-months { display: flex; gap: 1rem; overflow-x: auto; }
.mfp-cal-month { flex: 1; min-width: 200px; }
.mfp-cal-month-title { text-align: center; font-weight: 700; color: var(--mfp-green); margin-bottom: 0.3rem; font-size: 0.85rem; }
.mfp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mfp-cal-header { text-align: center; font-weight: 600; font-size: 0.65rem; color: var(--mfp-muted); padding: 0.15rem 0; }
.mfp-cal-day { text-align: center; font-size: 0.7rem; padding: 0.2rem 0; border-radius: 3px; border: 1px solid transparent; position: relative; }
.mfp-cal-day.mfp-inactive { color: #ddd; }
/* Held (already-reserved) days: the day number stays readable — light gray
   reads as "dead day"; a held day is still the volunteer's own day. */
.mfp-cal-day.mfp-held { color: var(--mfp-muted); }
.mfp-cal-day.mfp-active { cursor: pointer; }
.mfp-cal-selectable .mfp-cal-day.mfp-active:hover { background: var(--mfp-green-pale); border-color: var(--mfp-green-light); }
/* Date being viewed: green outline only — the fill is reserved for chosen dates */
.mfp-cal-selectable .mfp-cal-day.mfp-viewing,
.mfp-cal-day.mfp-viewing { border-color: var(--mfp-green); box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.25); }
.mfp-cal-day .mfp-dot { display: block; width: 5px; height: 5px; border-radius: 50%; margin: 1px auto 0; }
.mfp-cal-day .mfp-dot-open { background: var(--mfp-green); }
/* Markers are shapes, not just colors: a full day is a red ✕ and a held
   day is a yellow ★, so the three states still read apart for red/green
   color-blind volunteers (and in grayscale printing). */
.mfp-dot-full { background: none; color: var(--mfp-red); font-weight: 700; line-height: 1; }
.mfp-dot-full::before { content: "✕"; }
.mfp-cal-legend .mfp-dot-full,
.mfp-cal-day .mfp-dot-full { width: auto; height: auto; border-radius: 0; }
.mfp-cal-day .mfp-dot-full { font-size: 0.6rem; }
/* Yellow, not gray: gray sat too close to the green availability dot.
   A gold-yellow — pure yellow is too pale on the light calendar — sized up
   so the solid glyph carries the same visual weight as the dot and ✕. */
.mfp-star { color: #d4a017; font-weight: 700; line-height: 1; }
.mfp-star::before { content: "★"; }
.mfp-cal-day .mfp-star { display: block; font-size: 0.8rem; line-height: 1; margin: 0 auto; }
.mfp-cal-legend .mfp-star { font-size: 0.9rem; }
.mfp-cal-day.mfp-selected { background: var(--mfp-green-pale); border-color: var(--mfp-green); font-weight: 700; }

/* Slot grid */
.mfp-slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.6rem; }
.mfp-slot-card { border: 2px solid var(--mfp-border); border-radius: var(--mfp-radius); padding: 0.75rem; text-align: center; cursor: pointer; transition: all 0.15s; }
.mfp-slot-card:hover { border-color: var(--mfp-green-light); }
.mfp-slot-card.mfp-slot-selected { border-color: var(--mfp-green); background: #52b788; }
.mfp-slot-card.mfp-slot-full { opacity: 0.5; cursor: not-allowed; }
.mfp-slot-card .mfp-slot-time { font-weight: 700; font-size: 0.85rem; }
.mfp-slot-card .mfp-slot-spots { font-size: 0.75rem; margin-top: 0.2rem; }
.mfp-slot-card .mfp-slot-spots.mfp-low { color: var(--mfp-red); font-weight: 600; }

/* Slot description */
.mfp-slot-desc { margin-bottom: 1rem; padding: 0.75rem; background: #f0f4f8; border-radius: var(--mfp-radius); border-left: 3px solid var(--mfp-green); font-size: 0.9rem; }

/* Confirmation */
.mfp-confirm { background: var(--mfp-green-pale); border: 2px solid var(--mfp-green); border-radius: var(--mfp-radius); padding: 1.5rem; text-align: center; }
.mfp-confirm h2 { margin-bottom: 0.75rem; }
.mfp-parking { margin-top: 1rem; padding: 1rem; background: #fff; border-radius: var(--mfp-radius); font-size: 0.9rem; }
/* Cancellation policy on the confirmation screen — quiet, but visible. */
.mfp-cancel-note { margin-top: 1rem; padding: 1rem; background: #fff; border-left: 3px solid var(--mfp-red); border-radius: var(--mfp-radius); font-size: 0.9rem; }
.mfp-emergency-phone { text-align: center; margin-top: 2rem; padding: 1rem; background: #fff3cd; border-radius: var(--mfp-radius); font-weight: 600; }

/* Modal */
.mfp-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 100000; display: flex; justify-content: center; align-items: center; }
.mfp-modal-box { background: #fff; border-radius: var(--mfp-radius); padding: 1.5rem; max-width: 460px; width: 90%; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.mfp-modal-danger { border-top: 4px solid var(--mfp-red); }
.mfp-modal-box h3 { margin-bottom: 0.75rem; }

/* Selected chips */
.mfp-chip { display: inline-block; background: var(--mfp-green-pale); border: 1px solid var(--mfp-green); border-radius: 4px; padding: 0.2rem 0.5rem; margin: 0.2rem; font-size: 0.8rem; cursor: pointer; }
.mfp-chip:hover { opacity: 0.7; }

/* Lookup results */
.mfp-lookup-result { border: 1px solid var(--mfp-border); border-radius: var(--mfp-radius); padding: 1rem; margin-bottom: 0.75rem; }

/* Magic-link family view — one block per person under the email */
.mfp-person-block { border: 2px solid var(--mfp-border); border-radius: var(--mfp-radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.mfp-person-block h3 { margin: 0 0 0.5rem; }

/* Utility */
.mfp-hidden { display: none !important; }

@media (max-width: 600px) {
  .mfp-card { padding: 1.25rem; }
  .mfp-slot-grid { grid-template-columns: 1fr 1fr; }
}
