:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --bg: #f4a261;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1a1a1a;
  --muted: #6b7280;
  --radius: 10px;
  --map-border: #8b5cf6;
}

body { background: var(--bg); font-family: system-ui, -apple-system, sans-serif; color: var(--text); }

/* Layout */
.container { max-width: 540px; margin: 0 auto; padding: 0 1rem; }
.page { padding: 1.5rem 0; }

/* ── Nav ── */
nav { background: #fff; padding: 0.6rem 1rem; }
nav .inner { display: flex; align-items: center; justify-content: space-between; max-width: 540px; margin: 0 auto; }
.brand { font-size: 2.2rem; font-weight: 900; color: #000; letter-spacing: 6px; text-transform: uppercase; font-family: Impact, 'Arial Black', sans-serif; line-height: 1; text-decoration: none; }
.nav-icons { display: flex; gap: 0.25rem; align-items: center; }
.nav-icon-btn { background: none; border: none; padding: 0.4rem; cursor: pointer; display: flex; align-items: center; color: #000; border-radius: 8px; text-decoration: none; }
.nav-icon-btn:hover { background: #f0f0f0; }
.nav-icon-btn svg { width: 24px; height: 24px; stroke: #000; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-username { font-size: 0.78rem; color: var(--muted); padding: 0 0.25rem; }

/* Nav dropdown menu */
.nav-dropdown { background: #fff; border-bottom: 1px solid var(--border); padding: 0.5rem 1rem; max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.1rem; }
.nav-dropdown a { font-size: 0.9rem; padding: 0.5rem 0.25rem; color: var(--text); text-decoration: none; border-radius: 6px; }
.nav-dropdown a:hover { color: var(--primary); }
#nav-menu-wrapper { background: #fff; border-bottom: 1px solid var(--border); }

/* ── Map Hero ── */
.map-hero { padding: 0.75rem 1rem 0; max-width: 540px; margin: 0 auto; }
.map-hero-border { border: 3px solid var(--map-border); border-radius: 14px; overflow: hidden; position: relative; }
.lines-near-me-label { position: absolute; top: 10px; left: 10px; z-index: 10; background: #000; color: #fff; font-weight: 900; font-size: 0.9rem; padding: 0.28rem 0.65rem; border-radius: 5px; text-transform: uppercase; letter-spacing: 0.04em; pointer-events: none; }
#map { width: 100%; height: 260px; border-radius: 0; border: none; margin: 0; display: block; }

/* ── Quick report bar ── */
.quick-report-wrap { background: #111; max-width: 540px; margin: 0 auto; }
.quick-report-inner { padding: 0.8rem 1rem; }
.quick-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 0.2rem; }
.quick-event-name { font-weight: 700; font-size: 0.95rem; color: #fff; margin-bottom: 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-form { display: flex; gap: 0.45rem; align-items: center; }
.quick-input { flex: 1; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 0.5rem 0.7rem; color: #fff; font-size: 0.875rem; outline: none; min-width: 0; }
.quick-input::placeholder { color: rgba(255,255,255,0.35); }
.quick-input:focus { border-color: rgba(255,255,255,0.4); }
.quick-input-sm { flex: 0 0 80px; }
.quick-submit-btn { background: var(--bg); color: #000; border: none; border-radius: 8px; padding: 0.5rem 1rem; font-weight: 800; font-size: 0.875rem; cursor: pointer; flex-shrink: 0; transition: opacity 0.15s; }
.quick-submit-btn:hover { opacity: 0.85; }
.quick-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.quick-feedback { font-size: 0.75rem; margin-top: 0.35rem; min-height: 1rem; color: rgba(255,255,255,0.6); }

/* ── Home search & content ── */
.home-content { max-width: 540px; margin: 0 auto; padding: 0.85rem 1rem 2rem; }
.home-search-wrap { margin-bottom: 0.85rem; }
.home-search-bar { display: flex; align-items: center; background: #e4e4e4; border-radius: 99px; padding: 0.65rem 1.1rem; gap: 0.7rem; }
.home-search-bar svg { width: 18px; height: 18px; stroke: #666; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.home-search-bar input { background: none; border: none; outline: none; font-size: 0.95rem; flex: 1; color: #333; }
.home-search-bar input::placeholder { color: #999; }

/* Category chips */
.cat-chips { display: flex; gap: 0.45rem; flex-wrap: nowrap; overflow-x: auto; margin-bottom: 1rem; padding-bottom: 0.2rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { flex-shrink: 0; padding: 0.28rem 0.8rem; border-radius: 99px; border: 2px solid #000; background: transparent; font-size: 0.78rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s; }
.cat-chip.active, .cat-chip:hover { background: #000; color: #fff; }

/* Results count */
.results-count-text { font-size: 0.8rem; color: rgba(0,0,0,0.5); margin-bottom: 0.65rem; font-weight: 600; }

/* ── Event cards ── */
.events-grid { display: grid; gap: 0.75rem; }
.event-card { background: var(--card); border: none; border-radius: 12px; padding: 1rem 1.1rem; box-shadow: 0 1px 6px rgba(0,0,0,0.08); transition: box-shadow 0.15s; cursor: pointer; }
.event-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,0.13); }
.event-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.15rem; }
.event-card h3 a { color: #000; text-decoration: none; }
.event-card h3 a:hover { color: var(--primary); }
.event-venue { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
.line-status { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; flex-wrap: wrap; gap: 0.25rem; }
.line-crowd { font-weight: 600; }
.card-update-time { font-size: 0.73rem; color: var(--muted); }

/* ── Standard card ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.35rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius); outline: none; transition: border 0.15s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: var(--radius); border: none; font-size: 0.9rem; font-weight: 500; transition: background 0.15s, opacity 0.15s; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #f0f0f0; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-google { background: #fff; color: #444; border: 1px solid var(--border); }
.btn-google:hover { background: #f8f8f8; }

/* ── Alerts ── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }

/* ── Badge ── */
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 99px; font-size: 0.72rem; font-weight: 600; background: #f3f4f6; color: #374151; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }

/* ── Event detail (event.html) ── */
.event-header { margin-bottom: 1.25rem; }
.event-header h1 { font-size: 1.65rem; font-weight: 800; margin-bottom: 0.4rem; }
.event-detail-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; font-size: 0.875rem; color: var(--muted); margin-bottom: 0.75rem; }
#event-map { width: 100%; height: 200px; border-radius: var(--radius); border: 1px solid var(--border); }

/* Report summary */
.report-summary { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1.25rem; display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.summary-stat { text-align: center; }
.summary-stat .label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.summary-stat .value { font-size: 1.65rem; font-weight: 700; }

/* Report feed */
.report-item { padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.report-item:last-child { border-bottom: none; }
.report-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.25rem; }
.report-stats { font-weight: 600; font-size: 0.9rem; }
.report-time { font-size: 0.78rem; color: var(--muted); }
.report-note { font-size: 0.85rem; color: #374151; margin-top: 0.2rem; }
.report-author { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }

/* ── Auth pages ── */
.auth-page { max-width: 420px; margin: 3rem auto; padding: 0 1rem; }
.auth-page h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.divider { text-align: center; color: var(--muted); margin: 1rem 0; font-size: 0.875rem; }

/* ── Helpers ── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.text-muted { color: var(--muted); font-size: 0.875rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ── Spinner ── */
.spinner { display: inline-block; width: 1.2rem; height: 1.2rem; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Duplicate modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: var(--radius); padding: 1.5rem; max-width: 500px; width: 90%; }
.modal h2 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; justify-content: flex-end; }
.dup-item { padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.5rem; font-size: 0.875rem; }

/* ── Nearby location picker ── */
.nearby-results { border: 1px solid var(--border); border-radius: var(--radius); margin-top: 0.5rem; background: #fff; max-height: 220px; overflow-y: auto; }
.nearby-result-item { padding: 0.6rem 0.85rem; cursor: pointer; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.nearby-result-item:last-child { border-bottom: none; }
.nearby-result-item:hover { background: #f9f9f9; }
.nearby-result-item .place-name { font-weight: 500; }
.nearby-result-item .place-addr { color: var(--muted); font-size: 0.8rem; }

/* ── Proximity banner ── */
.proximity-banner { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 0.85rem 1.1rem; margin-bottom: 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; }
.proximity-banner .banner-text { color: var(--primary); font-weight: 500; }
.proximity-banner .banner-actions { display: flex; gap: 0.5rem; align-items: center; }
.proximity-banner .btn-update { background: var(--primary); color: #fff; padding: 0.35rem 0.85rem; font-size: 0.85rem; border-radius: var(--radius); border: none; cursor: pointer; font-weight: 500; }
.proximity-banner .btn-update:hover { background: var(--primary-dark); }
.proximity-banner .btn-dismiss { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.85rem; padding: 0.25rem; }

/* ── Footer ── */
.site-footer { text-align: center; padding: 1.5rem 0; margin-top: 2rem; }
.site-footer button { background: none; border: none; font-size: 0.75rem; color: rgba(0,0,0,0.4); cursor: pointer; }
.site-footer button:hover { color: rgba(0,0,0,0.7); text-decoration: underline; }
.copy-toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: #1a1a1a; color: #fff; padding: 0.5rem 1.1rem; border-radius: 99px; font-size: 0.82rem; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 999; }
.copy-toast.show { opacity: 1; }

@media (max-width: 600px) {
  .report-summary { gap: 1rem; }
  .brand { font-size: 1.9rem; }
}
