/*
 * Restaurant Roulette styles
 */

:root {
  --bg:           #0f0a1e;
  --surface:      #1e1535;
  --border:       #3d2b6e;
  --accent:       #f5c518;
  --accent-hover: #e6b800;
  --text:         #e8deff;
  --text-muted:   #9e8cbf;
  --card-bg:      #160f2e;
  --purple-dark:  #2d1f5c;
  --link:         #a78bfa;
  --link-hover:   #c4b5fd;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────── */

.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.site-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.site-header h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ─── Screen-reader only ─────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── Filters card ───────────────────────────────────── */

.filters-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.filter-section {
  margin-bottom: 1.5rem;
}

.filter-section h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.filter-row {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

/* ─── Location row ───────────────────────────────────── */

.location-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.location-input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  outline: none;
  transition: border-color 0.12s;
  min-width: 0;
}

.location-input::placeholder {
  color: var(--text-muted);
}

.location-input:focus {
  border-color: var(--accent);
}

.locate-button {
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, color 0.12s;
}

.locate-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.locate-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.distance-wrapper {
  flex-shrink: 0;
}

.distance-select {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.5rem 2rem 0.5rem 0.85rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239e8cbf' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  transition: border-color 0.12s;
}

.distance-select:focus {
  border-color: var(--accent);
}

.distance-select option {
  background: var(--surface);
}

/* ─── Multi-select dropdown ──────────────────────────── */

.multi-select {
  position: relative;
}

.multi-select-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s;
}

.multi-select-trigger:hover,
.multi-select-trigger.is-open {
  border-color: var(--accent);
}

.trigger-label {
  flex: 1;
}

.trigger-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s;
}

.multi-select-trigger.is-open .trigger-chevron {
  transform: rotate(180deg);
}

.multi-select-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  max-height: 280px;
  overflow-y: auto;
}

.multi-select-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.6rem;
}

.multi-select-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s;
}

.multi-select-clear:hover {
  color: var(--text);
}

.multi-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ─── Chips ──────────────────────────────────────────── */

.price-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 2rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  user-select: none;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip input[type="checkbox"] {
  display: none;
}

.chip:has(input:checked) {
  background: var(--purple-dark);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.open-now-chip {
  font-size: 0.95rem;
  padding: 0.45rem 1rem;
}

/* ─── Spin button ────────────────────────────────────── */

.spin-wrapper {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}

.spin-button {
  background: var(--accent);
  color: #0f0a1e;
  border: none;
  padding: 0.85rem 3rem;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
  letter-spacing: 0.02em;
}

.spin-button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(245, 197, 24, 0.3);
}

.spin-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Results ────────────────────────────────────────── */

.results-section {
  margin-top: 0.5rem;
}

.results-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* ─── Restaurant card ────────────────────────────────── */

.restaurant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: cardReveal 0.35s ease backwards;
}

.restaurant-card:nth-child(2) { animation-delay: 0.08s; }
.restaurant-card:nth-child(3) { animation-delay: 0.16s; }

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

.restaurant-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.restaurant-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.price-badge {
  background: var(--purple-dark);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.restaurant-address {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.star {
  color: var(--accent);
}

.rating-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.card-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.maps-link,
.website-link {
  font-size: 0.85rem;
  color: var(--link);
  text-decoration: none;
  transition: color 0.12s;
}

.maps-link:hover,
.website-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ─── No results ─────────────────────────────────────── */

.no-results {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.no-results-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

/* ─── Responsive ─────────────────────────────────────── */

@media (max-width: 600px) {
  .site-header h1 { font-size: 2.2rem; }
  .location-row { flex-direction: column; align-items: stretch; }
  .locate-button { width: 100%; }
  .distance-select { width: 100%; }
  .filter-row { flex-direction: column; gap: 1rem; }
  .results-grid { grid-template-columns: 1fr; }
}
