/* danceseekers — global styles */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6c757d;
  --border: #e5e2dc;
  --accent: #e63946;
  --accent-hover: #c5303d;

  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 14px rgba(0,0,0,0.08);

  --maxw: 1280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* Header / nav */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  white-space: nowrap;
}
.brand .accent { color: var(--accent); }
.primary-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}
.primary-nav a {
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
}
.primary-nav a:hover { background: var(--bg); text-decoration: none; }
.primary-nav a.active { background: var(--accent); color: white; }
.submit-btn {
  background: var(--accent);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  border: none;
}
.submit-btn:hover { background: var(--accent-hover); color: white; text-decoration: none; }
.nav-toggle { display: none; background: transparent; border: none; padding: 8px; cursor: pointer; flex-direction: column; gap: 5px; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 1px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-submit { display: none; }

/* Layout */
main { max-width: var(--maxw); margin: 0 auto; padding: 20px; }
.full-width { max-width: none; padding: 0; }

h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #1d3557 0%, #e63946 100%);
  color: white;
  padding: 48px 20px;
  text-align: center;
}
.hero h1 { font-size: 36px; margin-bottom: 8px; }
.hero p { margin: 0; opacity: 0.95; font-size: 17px; }
.hero .search-row {
  margin: 24px auto 0;
  max-width: 600px;
  display: flex;
  gap: 8px;
}
.hero .search-row input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 6px;
  border: none;
  font-size: 15px;
}
.hero .search-row button {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  background: white;
  color: var(--text);
  font-weight: 600;
}

/* Section blocks */
.section { padding: 28px 20px; max-width: var(--maxw); margin: 0 auto; }
.section .header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.section .header-row a { font-size: 14px; }

/* Filter bar */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}
.filter-bar label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  gap: 4px;
}
.filter-bar input, .filter-bar select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: white;
}
.filter-bar .checks {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text);
  flex-wrap: wrap;
}
.filter-bar .checks label {
  flex-direction: row;
  font-size: 13px;
  color: var(--text);
  font-weight: 400;
  gap: 4px;
  align-items: center;
}
.filter-bar .reset {
  align-self: end;
  border: 1px solid var(--border);
  background: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

/* Style chips */
.style-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.style-chip {
  background: white;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.style-chip:hover { background: var(--bg); text-decoration: none; }
.style-chip.active { background: var(--accent); color: white; border-color: var(--accent); }
.style-chip .dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* Event cards */
.event-list { display: flex; flex-direction: column; gap: 10px; }
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 14px;
  align-items: start;
  box-shadow: var(--shadow-sm);
}
.event-card .date {
  font-weight: 700;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
}
.event-card .date .day { font-size: 24px; display: block; }
.event-card .date .mo { color: var(--muted); text-transform: uppercase; font-size: 11px; }
.event-card .body .title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.event-card .body .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 12px; }
.event-card .body .meta strong { color: var(--text); font-weight: 500; }
.event-card .body .desc { font-size: 13px; color: var(--text); margin-top: 6px; }
.event-card .badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.event-card .price { font-weight: 700; font-size: 16px; color: var(--accent); }
.event-card .badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.event-card .badge.lesson { background: #e8f4f8; color: #1d3557; }
.event-card .badge.beg { background: #e8f5e9; color: #2e7d32; }
.event-card .badge.feed { background: #fff3e0; color: #b37700; }
.event-card .style-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  color: white;
  font-weight: 600;
}

/* Map view */
#map { height: calc(100vh - 64px); width: 100%; }
.map-container { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 64px); }
.map-sidebar { overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 14px; }
.map-sidebar h2 { font-size: 16px; }
.map-sidebar .results-count { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.venue-card-mini {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  background: white;
}
.venue-card-mini:hover { background: var(--bg); }
.venue-card-mini .name { font-weight: 600; font-size: 14px; }
.venue-card-mini .addr { font-size: 12px; color: var(--muted); }
.venue-card-mini .count { font-size: 12px; color: var(--accent); margin-top: 4px; }
.leaflet-popup-content {
  margin: 12px !important;
  font-family: inherit;
  max-width: 280px;
}
.leaflet-popup-content .name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.leaflet-popup-content .addr { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.leaflet-popup-content ul { padding-left: 0; list-style: none; margin: 0; max-height: 220px; overflow-y: auto; }
.leaflet-popup-content li { padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.leaflet-popup-content li:last-child { border-bottom: none; }
.leaflet-popup-content li .when { color: var(--muted); }

@media (max-width: 768px) {
  .map-container { grid-template-columns: 1fr; height: auto; }
  .map-sidebar { max-height: 300px; }
  #map { height: 50vh; }
}

/* Calendar view */
#calendar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.fc-event { cursor: pointer; }
.fc .fc-button-primary {
  background: var(--text);
  border-color: var(--text);
}
.fc .fc-button-primary:hover, .fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--accent);
  border-color: var(--accent);
}
.fc-event-title { font-weight: 600; }

/* Style page */
.style-hero {
  padding: 32px 20px;
  text-align: center;
  color: white;
}
.style-hero .style-emoji { font-size: 56px; margin-bottom: 8px; }
.style-hero h1 { font-size: 32px; }

/* Homepage map+list split */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: 600px;
}
.split-grid #home-map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.split-grid .list-pane { overflow-y: auto; padding-right: 4px; }
@media (max-width: 900px) {
  .split-grid { grid-template-columns: 1fr; height: auto; }
  .split-grid #home-map { height: 400px; }
}

/* Forms */
.form-grid {
  display: grid;
  gap: 14px;
  max-width: 600px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  gap: 4px;
}
.form-grid { grid-template-columns: minmax(0, 1fr); }
.form-grid > * { min-width: 0; }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 15px;
  background: white;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.form-grid textarea { min-height: 100px; resize: vertical; }
.form-grid .submit-btn {
  align-self: flex-start;
  padding: 12px 20px;
  font-size: 15px;
}

/* Empty / loading states */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* Footer */
footer {
  margin-top: 60px;
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.site-footer { background: var(--surface); padding: 32px 20px 24px; }
.site-footer .footer-brand { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.site-footer .footer-brand .accent { color: var(--accent); }
.site-footer .footer-tagline { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.site-footer .footer-credits { max-width: 720px; margin: 0 auto; text-align: left; font-size: 12px; }
.site-footer .footer-credits strong { color: var(--text); display: block; margin-bottom: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.site-footer .footer-credits ul { list-style: none; padding: 0; margin: 0; }
.site-footer .footer-credits li { padding: 4px 0; line-height: 1.5; }
.site-footer .footer-credits a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); }
.site-footer .footer-credits a:hover { text-decoration-color: var(--accent); }

/* City grid */
.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.city-grid a {
  display: block;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.city-grid a:hover { border-color: var(--accent); text-decoration: none; }
.city-grid .city-name { font-weight: 600; font-size: 15px; }
.city-grid .city-state { font-size: 12px; color: var(--muted); }
.city-grid .city-count { font-size: 13px; color: var(--accent); margin-top: 4px; }

/* Tab bar (homepage map/list pane) */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tab-bar button {
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab-bar button:hover { color: var(--text); }
.tab-bar button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.popular-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.popular-row:hover { background: var(--bg); text-decoration: none; }
.popular-row .info .name { font-weight: 600; font-size: 14px; }
.popular-row .info .where { font-size: 12px; color: var(--muted); }
.popular-row .count {
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Notice banner */
.notice {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  color: #5d4e1a;
}

/* ---- Mobile (≤768px) ---- */
@media (max-width: 768px) {
  /* FullCalendar toolbar wrap + tighter buttons */
  .fc .fc-toolbar.fc-header-toolbar { flex-wrap: wrap; gap: 8px; row-gap: 8px; padding: 4px; }
  .fc .fc-toolbar-title { font-size: 18px !important; }
  .fc .fc-button { padding: 6px 10px !important; font-size: 13px !important; }
  .fc-list-day-cushion { font-size: 13px; padding: 8px 10px !important; }
  .fc-list-event-time { width: 90px !important; font-size: 12px; padding-right: 4px !important; }
  .fc-list-event-graphic { padding: 4px !important; }
  .fc-list-event-title { font-size: 13px; padding: 8px 6px !important; }
  .fc-list-table { font-size: 13px; }

  /* Hamburger header */
  .site-header .inner { padding: 10px 16px; gap: 12px; flex-wrap: nowrap; }
  .nav-toggle { display: flex; }
  .submit-desktop { display: none; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px;
    gap: 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
  }
  .primary-nav.open { display: flex; }
  .primary-nav a {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav-submit { display: flex !important; margin-top: 4px; justify-content: center; }
  main { padding: 16px; }
  .section { padding: 20px 0; }

  /* Hero */
  .hero { padding: 32px 16px; }
  .hero h1 { font-size: 26px; }
  .hero .search-row { flex-direction: column; gap: 8px; }
  .hero .search-row button { width: 100%; }

  /* Filter bar collapses behind a toggle */
  .filter-bar {
    display: none;
    grid-template-columns: 1fr 1fr;
  }
  .filter-bar.open { display: grid; }
  .filter-bar .checks { grid-column: 1 / -1; }
  .filter-bar .reset { grid-column: 1 / -1; }
  .filter-toggle {
    display: flex !important;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    min-height: 44px;
  }
  .filter-toggle .count {
    background: var(--accent);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
  }

  /* Map page: stack with map on top */
  .map-container { grid-template-columns: 1fr; height: auto; }
  .map-container { display: flex; flex-direction: column; }
  #map { height: 55vh; min-height: 360px; order: 1; }
  .map-sidebar { order: 2; max-height: none; border-right: none; border-top: 1px solid var(--border); padding: 12px 16px; }
  .map-sidebar h2 { font-size: 15px; margin-bottom: 8px; }

  /* Homepage split */
  .split-grid { grid-template-columns: 1fr; height: auto; gap: 14px; }
  .split-grid #home-map { height: 50vh; min-height: 320px; }

  /* Tab bar scrolls horizontally on small screens */
  .tab-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-bar button { flex: 0 0 auto; white-space: nowrap; padding: 10px 12px; }

  /* Event cards: tighten layout */
  .event-card {
    grid-template-columns: 56px 1fr;
    gap: 12px;
    padding: 12px 14px;
  }
  .event-card .date .day { font-size: 22px; }
  .event-card .badges {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 4px;
  }
  .event-card .price { order: -1; }
  .event-card .body .meta { gap: 8px; font-size: 12px; }
  .event-card .body .title { font-size: 14px; }

  /* Inputs sized to avoid iOS zoom */
  input, select, textarea { font-size: 16px !important; }

  /* Submit form: keep checkbox labels intact */
  #style-checkboxes label,
  .form-grid .checks label { white-space: nowrap; }
  #style-checkboxes { gap: 8px 14px !important; }
  .form-grid .checks { gap: 8px 14px !important; }

  /* City grid */
  .city-grid { grid-template-columns: 1fr 1fr; }

  /* Footer */
  footer { padding: 20px 16px; font-size: 12px; }
}

@media (max-width: 380px) {
  .filter-bar { grid-template-columns: 1fr; }
  .city-grid { grid-template-columns: 1fr; }
  .event-card .date { font-size: 11px; }
  .event-card .body .title { font-size: 14px; }
}

/* The toggle button is hidden by default on desktop */
.filter-toggle { display: none; }
