*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #1f2933;
  line-height: 1.6;
}

/* Layout */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  margin: 48px 0;
}

.section-title {
  font-size: 24px;
  margin: 0 0 8px;
}

.section-desc {
  margin: 0 0 24px;
  color: #6b7280;
  font-size: 14px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(8px);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.logo-main {
  font-weight: 700;
  font-size: 18px;
}

.logo-sub {
  display: block;
  font-size: 12px;
  color: #9ca3af;
}

.nav a {
  color: #e5e7eb;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}

.nav a:hover {
  color: #ffffff;
}

/* Hero */

.hero {
  background: radial-gradient(circle at top left, #3b82f6, #0f172a 60%);
  color: #ffffff;
  padding: 40px 0 48px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.hero h1 {
  font-size: 32px;
  margin: 0 0 12px;
}

.hero p {
  margin: 0 0 20px;
}

.hero-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.55);
}

.hero-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.hero-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  font-size: 14px;
}

.hero-card li + li {
  margin-top: 4px;
}

.hero-tip {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

/* Buttons */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 18px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.1s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn-secondary:hover {
  opacity: 0.9;
}

/* Courts */

.court-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.court-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

.court-tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  margin-bottom: 6px;
}

.court-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.court-desc {
  margin: 0 0 10px;
  font-size: 13px;
  color: #4b5563;
}

.court-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: #6b7280;
}

.court-meta li + li {
  margin-top: 2px;
}

/* Booking */

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
}

.booking-form {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 16px 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  font-family: inherit;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.form-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
}

.form-message {
  margin-top: 10px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  display: none;
}

.form-message.error {
  display: block;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.form-message.success {
  display: block;
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Booking help */

.booking-help {
  background: #f9fafb;
  border-radius: 14px;
  padding: 18px 16px 16px;
  border: 1px dashed #e5e7eb;
  font-size: 13px;
}

.booking-help h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 16px;
}

.booking-help ul {
  margin: 0;
  padding-left: 18px;
  color: #4b5563;
}

/* My bookings */

.my-bookings-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.my-bookings-toolbar .form-row {
  margin: 0;
}

.booking-list {
  background: #ffffff;
  border-radius: 14px;
  padding: 12px 12px 6px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  max-height: 420px;
  overflow-y: auto;
}

.booking-item {
  border-radius: 10px;
  padding: 10px 10px;
  border: 1px solid #e5e7eb;
  margin-bottom: 8px;
  font-size: 13px;
}

.booking-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.booking-item-title {
  font-weight: 600;
}

.booking-item-meta {
  font-size: 12px;
  color: #6b7280;
}

.booking-item-note {
  font-size: 12px;
  margin-top: 4px;
}

.empty-tip {
  margin: 4px 0 4px;
  font-size: 13px;
  color: #9ca3af;
}

.booking-list.empty {
  text-align: center;
}

/* Footer */

.site-footer {
  margin-top: 32px;
  padding: 16px 0 26px;
  background: #0f172a;
  color: #9ca3af;
  font-size: 12px;
}

.footer-inner p {
  margin: 4px 0;
}

/* Responsive */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .booking-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .my-bookings-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .nav {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .nav a {
    margin: 4px 12px 0 0;
  }

  .hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .section {
    margin: 32px 0;
  }
}


/* Admin layout */

.admin-body {
  background:#f3f4f6;
}

.admin-topbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 16px;
}

.admin-nav-links a {
  color:#e5e7eb;
  font-size:13px;
  text-decoration:none;
  margin-left:12px;
}

.admin-nav-links a.active {
  font-weight:600;
  text-decoration:underline;
}

.admin-nav-links a:hover {
  color:#ffffff;
}

.admin-container {
  margin-top:18px;
}

.admin-me {
  margin-left:10px;
  font-size:12px;
  color:#9ca3af;
}

.admin-filter {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-end;
  margin-bottom:12px;
}

.admin-filter .form-row {
  margin-bottom:0;
}

.admin-table {
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

.admin-table th,
.admin-table td {
  border-bottom:1px solid #e5e7eb;
  padding:6px 8px;
  text-align:left;
  vertical-align:top;
}

.admin-table th {
  background:#f9fafb;
  font-weight:600;
}

.admin-table tr:nth-child(even) td {
  background:#f9fafb;
}

.badge {
  display:inline-block;
  padding:2px 6px;
  border-radius:999px;
  font-size:11px;
  background:#eff6ff;
  color:#1d4ed8;
}

.btn-link {
  border:none;
  background:none;
  color:#2563eb;
  cursor:pointer;
  font-size:12px;
  padding:0;
}

.btn-link:hover {
  text-decoration:underline;
}

.section-header-row {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  margin-bottom:8px;
}

.section-header-actions {
  flex-shrink:0;
}

/* Auth layout */

.admin-auth-container {
  max-width:420px;
  margin-top:40px;
}

/* Responsive admin */

@media (max-width: 800px) {
  .admin-table {
    font-size:12px;
  }
  .admin-table th,
  .admin-table td {
    padding:4px 6px;
  }
  .section-header-row {
    flex-direction:column;
    align-items:flex-start;
  }
}



/* Court images on front page */
.court-image-wrapper {
  margin: 6px 0 8px;
  border-radius: 10px;
  overflow: hidden;
  max-height: 160px;
}
.court-image {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* Captcha */
.captcha-box {
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:10px;
  background:#111827;
  color:#f9fafb;
  font-size:13px;
}
.captcha-code {
  font-weight:700;
  letter-spacing:0.18em;
}
.captcha-refresh {
  color:#93c5fd;
  font-size:12px;
  text-decoration:none;
}
.captcha-refresh:hover {
  text-decoration:underline;
}
