/* ============================================
   City2City — Urban Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-input: #111111;
  --border: #2a2a2a;
  --border-focus: #f5a623;
  --text-primary: #f0ede8;
  --text-secondary: #888880;
  --text-muted: #444440;
  --accent: #f5a623;
  --accent-dim: rgba(245, 166, 35, 0.12);
  --accent-glow: rgba(245, 166, 35, 0.2);
  --success: #6fcf97;
  --tag-bg: #1a1a1a;
  --tag-border: #2a2a2a;
  --tag-active-bg: rgba(245, 166, 35, 0.15);
  --tag-active-border: #f5a623;
  --tag-active-text: #f5a623;
  --match-high: #6fcf97;
  --match-mid: #f5a623;
  --match-low: #888880;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.6);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.8);
  --transition: 0.15s ease;
  --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(245,166,35,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(245,166,35,0.03) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ============ Header ============ */

.app-header {
  text-align: center;
  padding: 60px 24px 48px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.header-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.logo {
  display: inline-block;
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 14px;
  font-family: var(--font-main);
}

.logo .two {
  color: var(--accent);
  font-style: italic;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
}

/* ============ Main ============ */

.main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

/* ============ Steps ============ */

.steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 40px;
  padding-top: 40px;
}

@media (max-width: 680px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: visible;
}

.step::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
  transition: background var(--transition);
}

.step.active {
  border-color: rgba(245, 166, 35, 0.4);
  box-shadow: 0 0 0 1px rgba(245,166,35,0.1), 0 0 30px rgba(245,166,35,0.06);
}

.step.active::before {
  background: var(--accent);
}

.step.completed {
  border-color: rgba(111, 207, 151, 0.3);
  cursor: pointer;
}

.step.completed:hover {
  border-color: rgba(111, 207, 151, 0.6);
  background: rgba(111, 207, 151, 0.03);
}

.step.completed::before {
  background: var(--success);
}

.step-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.step.active .step-label {
  color: var(--accent);
}

.step.completed .step-label {
  color: var(--success);
}

.step-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

/* ============ Autocomplete Input ============ */

.autocomplete-wrap {
  position: relative;
}

.autocomplete-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-main);
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.autocomplete-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.autocomplete-input:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.autocomplete-dropdown.open {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: rgba(245, 166, 35, 0.08);
}

.autocomplete-item .item-emoji {
  font-size: 1rem;
  line-height: 1;
}

.autocomplete-item .item-name {
  font-weight: 500;
  color: var(--text-primary);
}

.autocomplete-item .item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
  font-family: var(--font-mono);
}

/* ============ Chosen state ============ */

.step-chosen {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chosen-emoji {
  font-size: 1.1rem;
}

.clear-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition);
}

.clear-btn:hover {
  border-color: #cc4444;
  color: #cc4444;
}

/* Legacy select wrapper for step 3 */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-main);
  padding: 10px 32px 10px 12px;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

.select-wrapper select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.select-wrapper select:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.75rem;
}

/* ============ Neighborhood search (step 2) ============ */

.search-input-wrap {
  position: relative;
}

#neighborhood-search {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-main);
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#neighborhood-search::placeholder { color: var(--text-muted); }

#neighborhood-search:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

#neighborhood-search:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}

.search-dropdown:empty { display: none; }

.search-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}

.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover,
.search-dropdown-item.highlighted {
  background: rgba(245, 166, 35, 0.08);
}

.search-dropdown-item .nh-name {
  font-weight: 600;
  color: var(--text-primary);
}

.search-dropdown-item .nh-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ Results ============ */

#results-section {
  margin-top: 8px;
}

.source-card {
  margin-bottom: 28px;
}

.source-card-inner {
  background: linear-gradient(135deg, #1a1a14 0%, #141414 100%);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
}

.source-card-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at top left, rgba(245,166,35,0.07) 0%, transparent 60%);
  pointer-events: none;
}

.source-city-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.source-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.1;
}

.source-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 16px;
}

/* Result card interior — mirrors source-card style but in destination (teal) color */
.result-city-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dest);
  margin-bottom: 6px;
}

.result-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.1;
}

.result-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.result-why {
  font-size: 0.8rem;
  color: rgba(78, 201, 176, 0.6);
  line-height: 1.5;
  margin-bottom: 14px;
  border-left: 2px solid rgba(78, 201, 176, 0.25);
  padding-left: 10px;
  font-style: italic;
}

/* Shared tags glow teal in result cards */
.dest-shared {
  border-color: rgba(78, 201, 176, 0.4) !important;
  color: var(--dest) !important;
  background: rgba(78, 201, 176, 0.08) !important;
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.results-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.results-subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============ Filter bar ============ */

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  align-items: center;
}

.filter-tag {
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.filter-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-tag.active {
  background: var(--tag-active-bg);
  border-color: var(--tag-active-border);
  color: var(--tag-active-text);
}

/* ============ Result cards ============ */

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 14px;
}

/* Destination color theme: teal/blue vs amber source */
:root {
  --dest: #4ec9b0;
  --dest-dim: rgba(78, 201, 176, 0.12);
  --dest-glow: rgba(78, 201, 176, 0.2);
  --dest-mid: rgba(78, 201, 176, 0.07);
}

.result-card {
  background: linear-gradient(135deg, #14191a 0%, #111414 100%);
  border: 1px solid rgba(78, 201, 176, 0.22);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  transition: border-color var(--transition), transform var(--transition);
  animation: cardIn 0.25s ease both;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at top left, rgba(78,201,176,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.result-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(78, 201, 176, 0.5);
}

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

.result-card:hover {
  border-color: rgba(78, 201, 176, 0.4);
  transform: translateY(-2px);
}

.card-city {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.card-city-emoji {
  font-size: 0.9rem;
}

.card-city-name {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-nh-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.2;
}

.card-why {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  border-left: 2px solid var(--border);
  padding-left: 10px;
  font-style: italic;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.tag.shared {
  background: rgba(245,166,35,0.1);
  border-color: rgba(245,166,35,0.3);
  color: var(--accent);
}

.card-match-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.badge-high {
  background: rgba(111, 207, 151, 0.1);
  color: var(--match-high);
  border: 1px solid rgba(111, 207, 151, 0.2);
}

.badge-mid {
  background: rgba(245, 166, 35, 0.1);
  color: var(--match-mid);
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.badge-low {
  background: rgba(136, 136, 128, 0.1);
  color: var(--match-low);
  border: 1px solid rgba(136,136,128,0.2);
}

/* ============ Empty / error states ============ */

.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

/* ============ Footer ============ */

footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============ Scrollbar ============ */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }
