/* ============================================================
   Pool Table Finder — Custom Styles
   ============================================================ */

:root {
  --brand-green:  #1a6b3a;
  --brand-dark:   #0f3d20;
  --brand-light:  #e8f5e9;
  --felt-green:   #2e7d32;
  --accent:       #f9a825;
}

/* ── Navbar ── */
.navbar-brand img { height: 36px; margin-right: 8px; }
.navbar { background: var(--brand-dark) !important; }
.navbar .nav-link, .navbar-brand { color: #fff !important; }

/* ── Hero / Search bar ── */
.hero {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--felt-green) 100%);
  padding: 48px 0 36px;
  color: #fff;
}
.hero h1 { font-weight: 700; letter-spacing: -0.5px; }
.hero .subtitle { opacity: 0.85; font-size: 1.1rem; }
.search-box { background: rgba(255,255,255,0.1); border-radius: 12px; padding: 24px; }
.search-box .form-control, .search-box .form-select {
  border-radius: 8px;
  border: none;
  height: 48px;
}
.search-box .btn-search {
  background: var(--accent);
  border: none;
  color: #000;
  font-weight: 600;
  height: 48px;
  border-radius: 8px;
  padding: 0 28px;
  transition: background 0.2s;
}
.search-box .btn-search:hover { background: #e65100; color: #fff; }

/* ── Source toggle pills ── */
.source-pills .btn-check:checked + .btn { background: var(--brand-green); color: #fff; border-color: var(--brand-green); }
.source-pills .btn { border-radius: 20px; padding: 4px 16px; font-size: 0.85rem; }

/* ── Filter bar ── */
.filter-bar { background: #f8f9fa; border-bottom: 1px solid #dee2e6; padding: 12px 0; }
.filter-bar .form-select, .filter-bar .form-control { font-size: 0.9rem; }

/* ── Results ── */
.results-header { font-size: 0.95rem; color: #555; }
#view-toggle .btn { border-radius: 6px; padding: 4px 10px; }

/* ── Listing card ── */
.listing-card {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  background: #fff;
}
.listing-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.12); transform: translateY(-2px); }
.listing-card .card-img-top { height: 200px; object-fit: cover; background: #f0f0f0; }
.listing-card .card-img-top.no-image {
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: #ccc;
}
.listing-card .source-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 4px;
}
.listing-card .price { font-size: 1.25rem; font-weight: 700; color: var(--brand-green); }
.listing-card .distance { font-size: 0.8rem; color: #888; }
.listing-card .condition-badge { font-size: 0.75rem; }
.listing-card .card-title { font-size: 0.95rem; font-weight: 600; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Source badge colors */
.badge-ebay       { background: #e53935; color: #fff; }
.badge-craigslist { background: #7b1fa2; color: #fff; }
.badge-facebook   { background: #1877f2; color: #fff; }
.badge-offerup    { background: #00897b; color: #fff; }

/* ── Map panel ── */
#map-panel { height: 520px; border-radius: 10px; overflow: hidden; border: 1px solid #ddd; }
#map { width: 100%; height: 100%; }

/* ── List view ── */
.listing-row {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 10px;
  padding: 12px; margin-bottom: 12px;
  transition: box-shadow 0.2s;
}
.listing-row:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.1); }
.listing-row img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.listing-row .price { font-size: 1.1rem; font-weight: 700; color: var(--brand-green); }

/* ── Skeleton loader ── */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Pagination ── */
.pagination .page-link { color: var(--brand-green); }
.pagination .page-item.active .page-link { background: var(--brand-green); border-color: var(--brand-green); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; color: #888; }
.empty-state .icon { font-size: 4rem; margin-bottom: 16px; }

/* ── Footer ── */
footer { background: var(--brand-dark); color: rgba(255,255,255,0.7); font-size: 0.85rem; }
footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
footer a:hover { color: #fff; }

/* ── Active filter chips ── */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--brand-light); color: var(--brand-dark);
  border: 1px solid #a5d6a7; border-radius: 20px;
  padding: 3px 10px; font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.filter-chip:hover { background: #c8e6c9; }
.filter-chip .chip-x { font-size: 0.9rem; opacity: 0.6; }

/* ── Distance badge on cards ── */
.distance-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 7px; border-radius: 4px;
  backdrop-filter: blur(2px);
}

/* ── Price drop indicator ── */
.price-drop { color: #c62828; font-size: 0.75rem; font-weight: 600; }
.price-drop i { margin-right: 2px; }

/* ── No-results state ── */
.no-results { text-align: center; padding: 60px 20px; }
.no-results .icon { font-size: 4rem; margin-bottom: 16px; }

/* ── Alert signup banner ── */
.alert-banner {
  background: linear-gradient(90deg, var(--brand-dark), var(--felt-green));
  color: #fff; padding: 20px 0;
}
.alert-banner h5 { font-weight: 700; margin-bottom: 4px; }
.alert-banner .form-control { border: none; border-radius: 8px; }
.alert-banner .btn-alert {
  background: var(--accent); border: none; color: #000;
  font-weight: 700; border-radius: 8px; padding: 10px 24px;
}

/* ── Admin dashboard ── */
.stat-card { border-radius: 12px; border: none; box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.stat-card .stat-number { font-size: 2.2rem; font-weight: 800; color: var(--brand-green); }
.stat-card .stat-label { font-size: 0.85rem; color: #888; }
.admin-table th { background: var(--brand-light); font-size: 0.85rem; }

/* ── Map improvements ── */
.map-sidebar-card {
  border: 1px solid #eee; border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
  background: #fff;
}
.map-sidebar-card:hover { background: var(--brand-light); border-color: #a5d6a7; }
.map-sidebar-card.active { background: var(--brand-light); border-color: var(--brand-green); }
.map-sidebar-card .map-price { font-weight: 700; color: var(--brand-green); }
.map-sidebar-card .map-title { font-size: 0.85rem; font-weight: 600; line-height: 1.3;
  overflow: hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }

/* ── Smooth fade-in for results ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.listing-card, .listing-row {
  animation: fadeInUp 0.25s ease both;
}

/* ── Table size filter pills ── */
.size-pill { border-radius: 20px; padding: 4px 14px; font-size: 0.82rem; }
.size-pill.active { background: var(--brand-green); color: #fff; border-color: var(--brand-green); }

/* ── Responsive ── */
@media (max-width: 576px) {
  .hero { padding: 28px 0 20px; }
  .hero h1 { font-size: 1.6rem; }
  .listing-card .card-img-top { height: 160px; }
  .filter-bar .d-flex { flex-wrap: wrap; gap: 8px; }
}
