:root {
  --bg: #f5f7f3;
  --card: #ffffff;
  --text: #172018;
  --muted: #6c756d;
  --line: #e4e8e1;
  --brand: #244d2b;
  --brand-2: #d9f99d;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(23, 32, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 18px 16px 96px;
}

.hero {
  border-radius: 28px;
  padding: 28px;
  background: linear-gradient(135deg, #173f25, #336b38 60%, #c9f46d);
  color: #fff;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 800;
  opacity: .8;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 22px;
}

.subtitle {
  margin: 10px 0 0;
  opacity: .86;
}

.panel,
.booking-card,
.summary-card,
.sheet-card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(23, 32, 24, .06);
}

.date-panel {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 20px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: #fbfcfa;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
}

.round-btn,
.icon-btn {
  border: 0;
  border-radius: 16px;
  background: #eef3ec;
  color: var(--brand);
  font-weight: 900;
  cursor: pointer;
}

.round-btn {
  height: 46px;
  font-size: 28px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  font-size: 28px;
}

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.summary-card {
  border-radius: 20px;
  padding: 16px;
}

.summary-card span {
  display: block;
  font-size: 24px;
  font-weight: 900;
  color: var(--brand);
}

.summary-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.booking-list {
  display: grid;
  gap: 12px;
}

.booking-card {
  border-radius: 24px;
  padding: 16px;
}

.booking-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.time-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand-2);
  color: #1f3b16;
  font-weight: 900;
  white-space: nowrap;
}

.time-badge.upcoming {
  background: #fef08a; /* yellow-200 */
  color: #854d0e; /* yellow-800 */
}

.time-badge.ongoing {
  background: #dcfce7; /* green-100 */
  color: #166534; /* green-800 */
  border: 1px solid #86efac; /* green-300 */
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.time-badge.past {
  background: #f3f4f6; /* gray-100 */
  color: #6b7280; /* gray-500 */
}

.court-title {
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 4px;
}

.meta {
  color: var(--muted);
  margin: 0;
}

.booking-image {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  height: 260px;
  object-fit: cover;
  object-position: center 15%;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
}

.danger-btn {
  border: 0;
  background: #fff1f0;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
}

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #cdd6c9;
  border-radius: 22px;
  background: rgba(255, 255, 255, .6);
}

.floating-btn {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 32px));
  border: 0;
  border-radius: 20px;
  padding: 16px 20px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}

.sheet-card {
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  margin: 0 auto;
  border-radius: 28px 28px 0 0;
  padding: 20px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.booking-form {
  display: grid;
  gap: 13px;
}

.booking-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  color: #2d342e;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-btn {
  border: 0;
  border-radius: 18px;
  padding: 15px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.image-preview img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: #172018;
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .app {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero {
    padding: 24px;
  }

  h1 {
    font-size: 26px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.helper-text {
  margin-top: -6px;
  color: #6f7b71;
  font-size: 13px;
  line-height: 1.45;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #ddd;
  border-top-color: #222;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
}

.participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.participant-chip {
  display: inline-flex;
  align-items: center;
  background: #f0fdf4;
  color: #166534;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #bbf7d0;
}

.participant-chip.me {
  background: #dcfce7;
  border-color: #86efac;
}

.delete-participant {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 6px;
  padding: 0 4px;
}

.btn-slot {
  background: #eef2ff;
  color: #4f46e5;
  border: 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

/* Accordion */
.accordion {
  border-radius: 24px;
  padding: 16px;
  transition: all 0.3s ease;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(23, 32, 24, .06);
  margin-bottom: 12px;
}

.booking-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none; /* Hide default marker */
  cursor: pointer;
}

.booking-summary::-webkit-details-marker {
  display: none; /* Hide for Safari */
}

.summary-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.participant-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  background: #f0fdf4;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}

.chevron {
  width: 28px;
  height: 28px;
  background-color: #eef3ec;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
  color: var(--brand);
  flex-shrink: 0;
}

.chevron::after {
  content: '▼';
  font-size: 12px;
}

details[open] > .booking-summary .chevron {
  transform: rotate(180deg);
}

.booking-content {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  animation: slideDown 0.3s ease-out;
}

.booking-details-grid {
  display: grid;
  gap: 8px;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Image Accordion */
.image-accordion {
  margin-top: 12px;
}

.image-accordion summary {
  list-style: none;
  cursor: pointer;
}
.image-accordion summary::-webkit-details-marker {
  display: none;
}

.btn-outline {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--brand);
  color: var(--brand);
  font-weight: 800;
  text-align: center;
  width: 100%;
  transition: all 0.2s;
  background: transparent;
  cursor: pointer;
}

.btn-outline:hover {
  background: #eef3ec;
}

.mt-2 {
  margin-top: 12px;
}