/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ── Header ── */
header {
  background: #c0392b;
  color: white;
  text-align: center;
  padding: 28px 16px 20px;
  position: relative;
}
header h1 { font-size: 1.6rem; margin-bottom: 4px; }
header h2 { font-size: 1.1rem; font-weight: 400; opacity: 0.9; margin-bottom: 6px; }
.event-date { font-size: 1rem; opacity: 0.8; }

.admin-link {
  position: absolute;
  top: 16px; right: 16px;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  text-decoration: none;
}
.admin-link:hover { color: white; }

/* ── Main ── */
main { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }

.intro {
  text-align: center;
  color: #555;
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.loading { text-align: center; color: #aaa; padding: 40px; }

/* ── Time Slot Block ── */
.time-block {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 20px;
  overflow: hidden;
}

.time-block-header {
  background: #2c3e50;
  color: white;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  padding: 16px;
}

/* ── Individual Slot Card ── */
.slot-card {
  border-radius: 8px;
  padding: 14px;
  border: 2px solid #e0e0e0;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.slot-card.available {
  cursor: pointer;
  border-color: #27ae60;
  background: #f0fdf4;
}
.slot-card.available:hover {
  border-color: #219a52;
  box-shadow: 0 2px 10px rgba(39,174,96,0.2);
}
.slot-card.available .slot-status { color: #27ae60; font-weight: 600; font-size: 0.9rem; }
.slot-card.available .slot-cta { color: #888; font-size: 0.78rem; margin-top: 4px; }

.slot-card.booked {
  border-color: #e74c3c;
  background: #fff5f5;
  cursor: default;
}
.slot-card.booked .slot-name { font-weight: 700; color: #c0392b; font-size: 0.95rem; }
.slot-card.booked .slot-dog { color: #888; font-size: 0.8rem; margin-top: 3px; }
.slot-card.booked .slot-status-label {
  font-size: 0.72rem; color: #e74c3c; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}

/* ── Modal ── */
#modal-overlay, #edit-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 28px 24px;
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal h3 { font-size: 1.2rem; color: #c0392b; margin-bottom: 4px; }
.modal .slot-label { color: #888; font-size: 0.9rem; margin-bottom: 18px; }

.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: #aaa; line-height: 1;
}
.modal-close:hover { color: #333; }

/* ── Form ── */
form label {
  display: flex; flex-direction: column;
  font-size: 0.85rem; font-weight: 600; color: #555;
  margin-bottom: 12px;
}
form input, form select {
  margin-top: 4px;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #333;
  background: #fafafa;
  font-weight: 400;
}
form input:focus, form select:focus {
  outline: none; border-color: #c0392b;
}

/* ── Buttons ── */
.btn-primary {
  background: #c0392b; color: white;
  border: none; border-radius: 7px;
  padding: 11px 20px; font-size: 1rem;
  font-weight: 600; cursor: pointer;
  width: 100%; margin-top: 4px;
  transition: background 0.2s;
}
.btn-primary:hover { background: #a93226; }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

.btn-secondary {
  background: #2c3e50; color: white;
  border: none; border-radius: 7px;
  padding: 9px 16px; font-size: 0.9rem;
  font-weight: 600; cursor: pointer;
}
.btn-secondary:hover { background: #1a252f; }

.btn-outline {
  background: transparent; color: white;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 7px; padding: 9px 16px;
  font-size: 0.9rem; cursor: pointer;
}
.btn-outline:hover { border-color: white; }

.btn-danger {
  background: #e74c3c; color: white;
  border: none; border-radius: 7px;
  padding: 11px 20px; font-size: 1rem;
  font-weight: 600; cursor: pointer;
  width: 100%; margin-top: 8px;
}
.btn-danger:hover { background: #c0392b; }

.edit-actions { margin-top: 8px; }

/* ── Login Screen ── */
#login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #f5f5f5; padding: 16px;
}
.login-box {
  background: white; border-radius: 12px;
  padding: 36px 32px; width: 100%; max-width: 380px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  text-align: center;
}
.login-box h2 { font-size: 1.4rem; color: #c0392b; margin-bottom: 4px; }
.login-box p { color: #888; font-size: 0.9rem; margin-bottom: 24px; }
.login-box form label { text-align: left; }

.error { color: #e74c3c; font-size: 0.85rem; margin-bottom: 8px; text-align: center; }

/* ── Admin Panel ── */
#admin-panel header {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: 12px; padding: 20px 24px;
}
#admin-panel header h1 { font-size: 1.3rem; }
#admin-panel header h2 { font-size: 0.95rem; font-weight: 400; }
.admin-header-actions { display: flex; gap: 10px; margin-left: auto; }

/* Admin slot cards */
.slot-card.admin-booked {
  border-color: #e74c3c; background: #fff5f5; cursor: pointer;
}
.slot-card.admin-booked:hover { box-shadow: 0 2px 10px rgba(231,76,60,0.2); }
.slot-card.admin-empty {
  border-color: #bdc3c7; background: #fafafa; cursor: pointer;
}
.slot-card.admin-empty:hover { border-color: #7f8c8d; }
.slot-card.admin-empty .slot-status { color: #bdc3c7; font-size: 0.85rem; }

/* ── Footer ── */
footer {
  text-align: center; padding: 20px;
  color: #aaa; font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  header h1 { font-size: 1.2rem; }
  .slots-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 20px 16px; }
}
