/* ==========================================================================
   Central NJ Billiards Hub - Master Styling System (Vanilla CSS)
   Aesthetic: Deep Felt Emerald Green (#059669 / #10B981) + Slate Midnight (#0F172A / #1E293B) + Gold (#F59E0B)
   ========================================================================== */

:root {
  --bg-dark: #0b1329;
  --bg-card: #1e293b;
  --bg-card-hover: #273549;
  --bg-panel: #0f172a;
  --border-color: #334155;
  --border-light: rgba(255, 255, 255, 0.08);
  
  --felt-green: #059669;
  --felt-emerald: #10b981;
  --felt-dark: #022c22;
  
  --gold-primary: #f59e0b;
  --gold-hover: #fbbf24;
  --gold-dark: #d97706;
  
  --text-white: #f8fafc;
  --text-slate: #cbd5e1;
  --text-muted: #94a3b8;
  
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-family);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-panel);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--felt-green);
}

/* Glassmorphism & Panel Styling */
.glass-panel {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
}

.glass-panel-glow {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 10px 30px -10px rgba(5, 150, 105, 0.25);
  border-radius: 1rem;
}

/* Buttons */
.btn-felt {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  font-weight: 700;
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  text-decoration: none;
  justify-content: center;
}
.btn-felt:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  font-weight: 800;
  border: none;
  padding: 0.65rem 1.3rem;
  border-radius: 0.75rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  text-decoration: none;
  justify-content: center;
}
.btn-gold:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* 8-Ball Cue Badge Icon */
.cue-ball-badge {
  background: radial-gradient(circle at 30% 30%, #ffffff, #e2e8f0 60%, #94a3b8 100%);
  color: #0f172a;
  font-weight: 900;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Header & Navbar */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.logo-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--felt-emerald), var(--felt-green));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}
.logo-title span {
  color: var(--felt-emerald);
}

.logo-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-slate);
  padding: 0.5rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-item:hover {
  color: #ffffff;
  background: rgba(30, 41, 59, 0.8);
}
.nav-item.active {
  background: rgba(5, 150, 105, 0.15);
  color: var(--felt-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Quick Stats Bar */
.quick-stats {
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

.stats-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stat-icon {
  padding: 0.6rem;
  border-radius: 0.6rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--felt-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-number {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Main Layout */
main {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Header Box */
.section-header {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-slate);
  margin-top: 0.25rem;
}

/* Filter Bar */
.filter-bar {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

input, select, textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--felt-emerald);
}

/* CARDS GRID LAYOUT - UNIFORM HEIGHT & CONSTRAINTS FOR ALL TABS */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.venue-card, .tourney-card, .challenge-card, .gear-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  height: 100%; /* Uniform card height in grid */
  min-height: 420px; /* Fixed consistent minimum height across ALL tabs */
}
.venue-card:hover, .tourney-card:hover, .challenge-card:hover, .gear-card:hover {
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-3px);
}

.card-img-wrapper {
  position: relative;
  height: 190px;
  width: 100%;
  overflow: hidden;
  background-color: #0f172a;
}
.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}
.venue-card:hover .card-img-wrapper img, .gear-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.card-badge-town {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  color: var(--felt-emerald);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(16, 185, 129, 0.4);
  backdrop-filter: blur(4px);
}

.card-badge-rating {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(245, 158, 11, 0.95);
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto; /* Fill card height evenly */
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}

.specs-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
}

.spec-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
}

.spec-box span {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.spec-box strong {
  font-size: 0.82rem;
  word-break: break-word;
}

.card-footer {
  padding: 1.25rem;
  padding-top: 0;
  margin-top: auto; /* Aligns all buttons at exact same bottom baseline */
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  max-width: 650px;
  width: 100%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.modal-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(2, 44, 34, 0.8), var(--bg-panel));
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-slate);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.modal-close:hover {
  color: #ffffff;
  background: var(--bg-card);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Map Container */
#leaflet-map {
  width: 100%;
  height: 380px;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-msg {
  background: var(--bg-panel);
  border: 1px solid var(--felt-emerald);
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: 0.85rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Footer */
footer {
  background: #020617;
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
