/* events/events.css — Events page specific styles */
/* Depends on ../shared.css CSS variables */

/* ── STATUS BADGE ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-planned     { background: var(--gray-100);    color: var(--gray-500); }
.badge-confirmed   { background: var(--blue-light);  color: var(--blue); }
.badge-in_progress { background: var(--orange-light);color: var(--orange); }
.badge-completed   { background: var(--green-light); color: var(--green); }
.badge-invoiced    { background: var(--purple-light);color: var(--purple); }
.badge-cancelled   { background: var(--red-light);   color: var(--red); }

/* ── PAGE HEADER ── */
.events-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.events-title {
  font-size: 22px; font-weight: 800; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.events-actions { display: flex; align-items: center; gap: 10px; }

/* ── VIEW TOGGLE ── */
.view-toggle {
  display: flex; background: var(--gray-100);
  border-radius: 8px; padding: 3px; gap: 2px;
}
.view-toggle-btn {
  padding: 6px 14px; border-radius: 6px; border: none;
  background: transparent; font-size: 13px; font-weight: 600;
  font-family: 'Assistant', sans-serif; cursor: pointer;
  color: var(--gray-500); transition: all 0.14s;
  display: flex; align-items: center; gap: 5px;
}
.view-toggle-btn.active {
  background: var(--white); color: var(--navy);
  box-shadow: var(--shadow-sm);
}

/* ── FILTER PILLS ── */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.filter-pill {
  padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--gray-200);
  background: var(--white); font-size: 13px; font-weight: 600;
  font-family: 'Assistant', sans-serif; cursor: pointer;
  color: var(--gray-500); transition: all 0.14s;
}
.filter-pill:hover { border-color: var(--blue); color: var(--blue); }
.filter-pill.active { background: var(--navy); color: white; border-color: var(--navy); }

/* ── EVENT CARDS (list view) ── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.event-card {
  background: var(--white); border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  padding: 18px; cursor: pointer;
  transition: all 0.16s; position: relative;
}
.event-card:hover {
  border-color: var(--blue); box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.event-card-date {
  font-size: 30px; font-weight: 800; color: var(--navy);
  line-height: 1; margin-top: 24px;
}
.event-card-month {
  font-size: 13px; color: var(--gray-400); font-weight: 600;
  margin-bottom: 10px;
}
.event-card-title {
  font-size: 15px; font-weight: 700; color: var(--navy);
  margin-bottom: 6px; line-height: 1.3;
}
.event-card-meta {
  font-size: 13px; color: var(--gray-500); display: flex;
  align-items: center; gap: 5px; margin-bottom: 3px;
}
.event-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--gray-100); flex-wrap: wrap; gap: 6px;
}
.event-card-actions { display: flex; gap: 5px; }
.shortage-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--red-light); color: var(--red);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}

/* ── CALENDAR ── */
.calendar-wrap {
  background: var(--white); border-radius: var(--radius);
  border: 1.5px solid var(--gray-200); overflow: hidden;
}
.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-100);
}
.calendar-nav-title { font-size: 17px; font-weight: 700; color: var(--navy); }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.calendar-dow {
  padding: 8px 4px; text-align: center; font-size: 12px;
  font-weight: 700; color: var(--gray-400);
  border-bottom: 1px solid var(--gray-100);
}
.calendar-cell {
  min-height: 90px; padding: 6px 4px;
  border-bottom: 1px solid var(--gray-100);
  border-left: 1px solid var(--gray-100);
  vertical-align: top;
}
.calendar-cell:nth-child(7n+1) { border-left: none; }
.calendar-day-num {
  font-size: 12px; font-weight: 600; color: var(--gray-400);
  margin-bottom: 4px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.calendar-day-num.today {
  background: var(--navy); color: white;
}
.cal-event-block {
  font-size: 11px; font-weight: 600; padding: 2px 5px;
  border-radius: 3px; margin-bottom: 2px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.14s;
}
.cal-event-block:hover { opacity: 0.75; }
.cal-planned     { background: var(--gray-100);    color: var(--gray-600); }
.cal-confirmed   { background: var(--blue-light);  color: var(--blue); }
.cal-in_progress { background: var(--orange-light);color: var(--orange); }
.cal-completed   { background: var(--green-light); color: var(--green); }
.cal-invoiced    { background: var(--purple-light);color: var(--purple); }
.cal-cancelled   { background: var(--red-light);   color: var(--red); }

/* ── SIDE PANEL ── */
.side-panel {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 480px; background: var(--white);
  box-shadow: var(--shadow-lg); z-index: 200;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.side-panel.open { transform: translateX(0); }
.side-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0; gap: 10px;
}
.side-panel-title {
  font-size: 15px; font-weight: 700; color: var(--navy);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.side-panel-tabs {
  display: flex; border-bottom: 1.5px solid var(--gray-200);
  margin-bottom: 16px;
}
.side-tab {
  padding: 9px 14px; border: none; background: transparent;
  font-family: 'Assistant', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--gray-500); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1.5px;
  transition: all 0.14s;
}
.side-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ── INGREDIENTS TABLE ── */
.ing-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ing-table th {
  text-align: right; padding: 7px 8px; font-size: 11px; font-weight: 700;
  color: var(--gray-400); letter-spacing: 0.04em;
  border-bottom: 1.5px solid var(--gray-200);
}
.ing-table td { padding: 8px; border-bottom: 1px solid var(--gray-100); color: var(--navy); }
.ing-table tr:last-child td { border-bottom: none; }
.ing-shortage td { background: var(--red-light); }

/* ── STAFF TABLE ── */
.staff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.staff-table th {
  text-align: right; padding: 7px 8px; font-size: 11px; font-weight: 700;
  color: var(--gray-400); letter-spacing: 0.04em;
  border-bottom: 1.5px solid var(--gray-200);
}
.staff-table td { padding: 8px; border-bottom: 1px solid var(--gray-100); color: var(--navy); }
.staff-table tr:last-child td { border-bottom: none; }

/* ── EVENT FORM MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.45);
  z-index: 300; display: none; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius-lg);
  width: 680px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 80px); overflow-y: auto;
  padding: 26px; box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-col-full { grid-column: 1 / -1; }
.form-label {
  font-size: 12px; font-weight: 700; color: var(--gray-500);
  display: block; margin-bottom: 4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px;
  font-family: 'Assistant', sans-serif; color: var(--navy);
  background: var(--white); outline: none; transition: border-color 0.14s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-textarea { height: 76px; resize: vertical; }
.modal-footer {
  display: flex; gap: 8px; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--gray-100);
  justify-content: flex-end;
}

/* ── FAB ── */
.fab {
  position: fixed; bottom: 28px; left: 28px; z-index: 100;
  background: var(--navy); color: white;
  border: none; border-radius: 28px; padding: 12px 20px;
  font-size: 15px; font-weight: 700; font-family: 'Assistant', sans-serif;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 24px rgba(15,23,42,0.35);
  transition: all 0.16s;
}
.fab:hover {
  background: var(--blue); transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59,130,246,0.4);
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--gray-400);
  background: rgba(255,255,255,0.58);
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  max-width: 520px;
  margin: 76px auto 0;
}
.empty-state .material-symbols-outlined {
  font-size: 48px; display: block; margin-bottom: 12px; color: var(--gray-300);
}
.empty-state-title { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.empty-state-copy { font-size: 14px; line-height: 1.55; max-width: 340px; margin: 0 auto; }

/* ── TOAST ── */
.ev-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--navy); color: white;
  padding: 11px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 500;
  opacity: 1; transition: opacity 0.3s;
}
.ev-toast.warn    { background: var(--amber); color: var(--navy); }
.ev-toast.error   { background: var(--red); }
.ev-toast.success { background: var(--green); }
.ev-toast a { color: inherit; text-decoration: underline; font-weight: 700; }

/* ── DETAIL INFO BOX ── */
.detail-info-box {
  background: var(--gray-50); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 16px;
}
.detail-info-row {
  display: flex; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid var(--gray-200); font-size: 13px;
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-label {
  color: var(--gray-400); font-weight: 700;
  min-width: 110px; flex-shrink: 0;
}
.detail-info-value { color: var(--navy); }

/* ── BTN SM ── */
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .events-grid { grid-template-columns: 1fr; }
  .side-panel { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-box { padding: 16px; }
  .fab { bottom: 16px; left: 16px; }
}

/* ── DARK MODE ── navy-filled accents flip to light; keep their text dark for contrast.
   (Surfaces already adapt via var(--white)/var(--gray-*) tokens.) */
html.dark-mode .filter-pill.active,
html.dark-mode .calendar-day-num.today,
html.dark-mode .fab,
html.dark-mode .ev-toast { color: var(--ic-bg) !important; }
html.dark-mode .calendar-cell { background: var(--ic-surface); }
html.dark-mode .calendar-cell:hover { background: var(--ic-surface-2); }
