@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --text: #0f172a;
  --text-muted: #334155;
  --text-faint: #475569;
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* -------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------- */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* -------------------------------------------------------------------------
   Navbar
   ------------------------------------------------------------------------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.navbar-brand span {
  color: var(--primary);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.8rem;
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-success:hover { background: #047857; }

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

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

/* -------------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------------- */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link:hover .card,
.card-link.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

/* -------------------------------------------------------------------------
   Badges
   ------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */

.hero {
  padding: 5rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Category grid (homepage)
   ------------------------------------------------------------------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 3rem 0;
}

.category-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.category-card .card {
  height: 100%;
}

.category-card:hover .card {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.category-emoji {
  font-size: 2rem;
  margin-bottom: 0.875rem;
  display: block;
}

.category-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.category-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.category-arrow {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
}

/* -------------------------------------------------------------------------
   Borough filter bar
   ------------------------------------------------------------------------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-chip {
  padding: 0.375rem 0.875rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* -------------------------------------------------------------------------
   Club grid (category page)
   ------------------------------------------------------------------------- */

.club-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0 4rem;
}

.club-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.club-card .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.club-card:hover .card {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.club-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.club-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.club-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------------------
   Page header
   ------------------------------------------------------------------------- */

.page-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* -------------------------------------------------------------------------
   Club detail
   ------------------------------------------------------------------------- */

.club-detail {
  padding: 2.5rem 0 5rem;
}

.club-detail h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.club-detail .tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.club-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.club-description {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 2rem;
  white-space: pre-line;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.meta-item label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.25rem;
}

.meta-item span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.club-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */

.form-section {
  padding: 2.5rem 0 5rem;
}

.form-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
  background: var(--bg);
}

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

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.3rem;
}

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

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}

.form-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
}

/* -------------------------------------------------------------------------
   Alerts / flash messages
   ------------------------------------------------------------------------- */

.alert {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  border: 1px solid;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* -------------------------------------------------------------------------
   Email capture
   ------------------------------------------------------------------------- */

.email-capture {
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  margin: 2rem 0 4rem;
}

.email-capture h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.email-capture p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.email-form {
  display: flex;
  gap: 0.625rem;
  max-width: 420px;
  margin: 0 auto;
}

.email-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  background: white;
}

.email-form input:focus {
  border-color: var(--primary);
}

/* -------------------------------------------------------------------------
   CTA banner
   ------------------------------------------------------------------------- */

.cta-banner {
  text-align: center;
  padding: 3rem 0 5rem;
}

.cta-banner h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.cta-banner p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* -------------------------------------------------------------------------
   Section headings
   ------------------------------------------------------------------------- */

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.section-heading h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subheading {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------------------
   Admin
   ------------------------------------------------------------------------- */

.admin-nav {
  background: var(--text);
  padding: 0;
}

.admin-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.admin-nav-brand {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.admin-nav-links {
  display: flex;
  gap: 0.25rem;
}

.admin-nav-link {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.15s ease;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-link {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
}

.tab-link:hover { color: var(--text); }

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

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary);
  color: white;
  margin-left: 0.375rem;
}

.data-table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg-subtle);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
}

.admin-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
}

.admin-login-card h1 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.admin-login-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* -------------------------------------------------------------------------
   404
   ------------------------------------------------------------------------- */

.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-page h1 {
  font-size: 5rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-faint);
  text-decoration: none;
}

.footer-links a:hover { color: var(--text); }

/* -------------------------------------------------------------------------
   Success page state
   ------------------------------------------------------------------------- */

.success-state {
  text-align: center;
  padding: 4rem 2rem;
}

.success-state .check {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.success-state h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.success-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .hero h1 { font-size: 2.1rem; }
  .form-row { grid-template-columns: 1fr; }
  .email-form { flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 0 2.5rem; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 1rem; }
  .page-header h1 { font-size: 1.6rem; }
  .category-grid { grid-template-columns: 1fr; }
}
