/* BMCD Eats — Burns & McDonnell Food Truck Booking */
:root {
  --navy: #1a2744;
  --navy-light: #2a3d5e;
  --orange: #e87722;
  --orange-hover: #d46a1e;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --green: #059669;
  --green-light: #d1fae5;
  --red: #dc2626;
  --red-light: #fee2e2;
  --blue-light: #dbeafe;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

/* Header */
.header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header h1 span {
  color: var(--orange);
}

.header-nav {
  display: flex;
  gap: 8px;
}

.header-nav button {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.header-nav button:hover {
  background: rgba(255,255,255,0.2);
}

.header-nav button.active {
  background: var(--orange);
  border-color: var(--orange);
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 18px;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-100);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  gap: 8px;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--orange-hover);
}

.btn-primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--navy);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--navy-light);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-50);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success {
  background: var(--green-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: var(--red-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: var(--blue-light);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Calendar */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-header h3 {
  font-size: 16px;
  color: var(--navy);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.calendar-day-header {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.day-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  transition: all 0.2s;
  cursor: default;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.day-card .day-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}

.day-card .day-weekday {
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.day-card .day-status {
  font-size: 12px;
  margin-top: 6px;
}

.day-card.available {
  border-color: var(--green);
  background: var(--green-light);
  cursor: pointer;
}

.day-card.available:hover {
  background: #a7f3d0;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.day-card.available .day-status {
  color: var(--green);
  font-weight: 600;
}

.day-card.booked {
  border-color: var(--gray-300);
  background: var(--gray-100);
}

.day-card.booked .day-status {
  color: var(--gray-500);
}

.day-card.my-booking {
  border-color: var(--orange);
  background: #fff7ed;
}

.day-card.my-booking .day-status {
  color: var(--orange);
  font-weight: 600;
}

.day-card.blocked {
  border-color: var(--red);
  background: var(--red-light);
}

.day-card.blocked .day-status {
  color: var(--red);
}

.day-card.past {
  opacity: 0.5;
  border-color: var(--gray-200);
  background: var(--gray-50);
}

/* Week labels */
.week-label {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--gray-200);
}

.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--gray-700);
}

.tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* Bookings list */
.booking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.booking-item .booking-info {
  flex: 1;
}

.booking-item .booking-date {
  font-weight: 700;
  color: var(--navy);
}

.booking-item .booking-detail {
  font-size: 13px;
  color: var(--gray-500);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading {
  text-align: center;
  padding: 40px;
  color: var(--gray-400);
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Hero */
.hero {
  text-align: center;
  padding: 40px 20px;
}

.hero h2 {
  border: none;
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 8px;
}

.hero p {
  color: var(--gray-500);
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto;
}

.info-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--navy);
  color: var(--white);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 25px rgba(0,0,0,0.15);
}

.modal h3 {
  color: var(--navy);
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .calendar-week {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    gap: 12px;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
  }

  .hero h2 {
    font-size: 22px;
  }

  .info-badges {
    flex-direction: column;
    align-items: center;
  }
}

/* Admin-specific styles */
.admin-header {
  background: var(--navy);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

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

table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-200);
}

table td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}

table tr:hover td {
  background: var(--gray-50);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 300;
  animation: slideUp 0.3s ease-out;
}

.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Waitlist */
.day-card .waitlist-btn {
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--orange);
  background: transparent;
  color: var(--orange);
  font-weight: 600;
  transition: all 0.2s;
}

.day-card .waitlist-btn:hover {
  background: var(--orange);
  color: var(--white);
}

.day-card .waitlist-btn.on-waitlist {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

.waitlist-badge {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Blackout (vendor unavailable) */
.day-card.vendor-blackout {
  border-style: dashed;
  border-color: var(--gray-400);
  background: #f5f5f5;
}

.day-card.vendor-blackout .day-status {
  color: var(--gray-500);
  font-style: italic;
}

.blackout-indicator {
  font-size: 10px;
  color: var(--gray-500);
  font-style: italic;
  margin-top: 2px;
}

/* Analytics Dashboard */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.chart-card h3 {
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
}

/* Horizontal bar chart */
.bar-chart-h .bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.bar-chart-h .bar-label {
  width: 140px;
  font-size: 13px;
  color: var(--gray-700);
  text-align: right;
  padding-right: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-chart-h .bar-track {
  flex: 1;
  height: 24px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-chart-h .bar-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.bar-chart-h .bar-value {
  width: 40px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
  padding-left: 8px;
}

/* Vertical bar chart */
.bar-chart-v {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  height: 180px;
  padding-top: 20px;
}

.bar-chart-v .bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 100px;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart-v .bar-fill-v {
  width: 100%;
  background: var(--navy);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}

.bar-chart-v .bar-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.bar-chart-v .bar-lbl {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 8px;
  font-weight: 600;
}

/* Monthly trend chart */
.bar-chart-monthly {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding-top: 20px;
}

.bar-chart-monthly .month-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart-monthly .month-fill {
  width: 100%;
  background: var(--green);
  border-radius: 3px 3px 0 0;
  transition: height 0.5s ease;
  min-height: 2px;
}

.bar-chart-monthly .month-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}

.bar-chart-monthly .month-lbl {
  font-size: 10px;
  color: var(--gray-500);
  margin-top: 6px;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  transform: rotate(180deg);
  max-height: 60px;
}

/* ICS success modal */
.success-modal-content {
  text-align: center;
  padding: 8px 0;
}

.success-modal-content .success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.success-modal-content p {
  color: var(--gray-600);
  margin-bottom: 8px;
}

.btn-calendar {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-calendar:hover {
  background: var(--navy-light);
}

/* Section divider for My Bookings sub-sections */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.section-title:first-child {
  margin-top: 0;
}
