/* Shared styles for all provider estimate pages */

:root {
  --bg: #000;
  --surface: #111;
  --surface-elevated: #1a1a1a;
  --accent: #FF4444;
  --accent-glow: rgba(255, 68, 68, 0.15);
  --text: #fff;
  --text-secondary: #999;
  --text-muted: #666;
  --border: #222;
  --border-hover: #444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: -webkit-fill-available; }

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand-fall-layer { display: none; }
}

/* ========== Particle Canvas ========== */
#particle-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ========== Brand Fall ========== */
.brand-fall-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.brand-fall-item { position: absolute; top: -12vh; width: var(--size, 68px); height: var(--size, 68px); object-fit: contain; opacity: 0.18; animation: fall var(--duration) linear forwards; transform: translate3d(0, -12vh, 0) rotate(var(--rot)); filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45)); }
@keyframes fall { to { transform: translate3d(var(--drift), 120vh, 0) rotate(calc(var(--rot) + 140deg)); } }

/* ========== Glass Container ========== */
.container {
  max-width: 720px;
  width: 100%;
  margin: 24px auto;
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: rgba(17, 17, 17, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 80px rgba(255, 68, 68, 0.04);
}

/* ========== Header ========== */
header { text-align: center; padding: 12px 0 20px; }
.logo { width: min(280px, 70vw); height: auto; display: block; margin: 0 auto; }
h1 { margin-top: 16px; font-size: 1.5rem; font-weight: 700; color: var(--text); }
h1 .year { color: var(--text-muted); font-weight: 400; }
.subhead { margin-top: 8px; font-size: 0.9rem; color: #888; line-height: 1.4; }

/* ========== Route Section ========== */
.route-section { background: transparent; border-radius: 10px; padding: 20px 0 14px; margin-bottom: 20px; }
.route-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.route-header h2 { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.location-line { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: #bbb; min-width: 0; }
.location-flag { font-size: 1rem; }
.location-city-btn { background: transparent; border: none; color: var(--text); font-weight: 600; cursor: pointer; padding: 4px 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; }
.location-city-btn.placeholder { color: var(--text-muted); font-weight: 500; }
.location-city-btn:hover { text-decoration: underline; }
.location-city-input { flex: 1; min-width: 0; background: var(--surface-elevated); border: 1px solid #333; border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 0.95rem; outline: none; max-width: 220px; font-family: inherit; }
.location-city-input:focus { border-color: var(--text); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }

.route-header-buttons { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
.header-btn { background: transparent; border: 1px solid #333; color: var(--text); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); }
.header-btn:hover { background: var(--surface-elevated); }
.header-btn svg { width: 16px; height: 16px; }

/* ========== Route Inputs ========== */
.route-inputs { --route-row-padding: 4px; --route-gap: 12px; --route-dot-size: 10px; --route-handle-size: 20px; --route-remove-size: 32px; --route-input-height: 48px; --route-connector-width: 2px; display: flex; flex-direction: column; gap: 8px; }
.input-row { display: flex; align-items: flex-start; gap: var(--route-gap); transition: opacity 0.2s, transform 0.2s; background: transparent; padding: var(--route-row-padding); margin: calc(var(--route-row-padding) * -1); border-radius: 8px; }
.drag-handle { width: var(--route-handle-size); height: var(--route-handle-size); cursor: grab; color: #444; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: calc((var(--route-input-height) - var(--route-handle-size)) / 2); }
.drag-handle.disabled { opacity: 0.3; cursor: default; }
.drag-handle svg { width: 16px; height: 16px; }
.input-dot { width: var(--route-dot-size); height: var(--route-dot-size); border-radius: 50%; flex-shrink: 0; margin-top: calc((var(--route-input-height) - var(--route-dot-size)) / 2); }
.input-dot.from { background: var(--text); }
.input-dot.to { background: var(--text-muted); }
.input-wrapper { flex: 1; position: relative; }
.input-field { position: relative; display: flex; align-items: center; }
.route-input { width: 100%; background: var(--surface-elevated); border: 1px solid #333; border-radius: 8px; height: var(--route-input-height); padding: 14px 44px 14px 16px; color: var(--text); font-size: 1rem; outline: none; transition: border-color 0.2s; font-family: inherit; }
.route-input:focus { border-color: var(--text); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15); }
.route-input::placeholder { color: var(--text-muted); }
.clear-btn { position: absolute; right: 10px; width: 24px; height: 24px; border: none; background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.clear-btn:hover { color: var(--text); }
.clear-btn.hidden { display: none; }
.input-secondary { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.input-error { font-size: 0.75rem; color: var(--accent); margin-top: 6px; }
.input-error.hidden { display: none; }
.route-connector { width: var(--route-connector-width); height: 20px; background: #333; margin-left: calc(var(--route-row-padding) + var(--route-handle-size) + var(--route-gap) + (var(--route-dot-size) / 2) - (var(--route-connector-width) / 2)); }

/* ========== Suggestions ========== */
.suggestions-portal { position: fixed; background: var(--surface); border: 1px solid #333; border-radius: 10px; z-index: 999; max-height: 240px; overflow-y: auto; display: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.suggestions-portal.active { display: block; }
.suggestion-section { padding: 10px 14px; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); }
.suggestion-row { display: flex; gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.suggestion-row:last-child { border-bottom: none; }
.suggestion-row.active, .suggestion-row:hover { background: var(--surface-elevated); }
.suggestion-icon { width: 20px; height: 20px; color: #888; flex-shrink: 0; }
.suggestion-icon svg { width: 20px; height: 20px; }
.suggestion-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.suggestion-primary { font-size: 0.95rem; font-weight: 600; }
.suggestion-secondary { font-size: 0.8rem; color: #777; }
.suggestion-empty, .suggestion-error, .suggestion-loading { color: #777; cursor: default; }
.retry-btn { background: transparent; border: 1px solid #444; color: var(--text); padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 0.75rem; font-family: inherit; }
.match { color: var(--text); }

/* ========== Route Info ========== */
.route-info { display: flex; justify-content: center; gap: 32px; padding: 12px 0 6px; border-top: 1px solid var(--border); margin-top: 12px; }
.route-stat { text-align: center; }
.route-stat-value { font-size: 1.25rem; font-weight: 600; color: var(--text); }
.route-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ========== Rate Cards ========== */
.rates-section { flex: 1; }
.rates-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rates-header h2 { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.rates-grid { display: flex; flex-direction: column; gap: 8px; }

.rate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.rate-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.rate-card.best {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.best-badge {
  position: absolute;
  top: -8px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}
.app-logo { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; background: #fff; }
.app-logo img { width: 100%; height: 100%; object-fit: contain; }
.app-info { flex: 1; min-width: 0; }
.app-name { font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.app-eta { color: var(--text-muted); font-size: 0.85rem; }
.app-price { text-align: right; }
.price-value { font-size: 1.25rem; font-weight: 700; }
.price-surge { color: #ff6b6b; font-size: 0.75rem; }
.open-icon { color: var(--text-muted); margin-left: 8px; }
.open-icon svg { width: 16px; height: 16px; }

/* ========== Loading ========== */
.loading { text-align: center; padding: 60px 20px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 40px; height: 40px; border: 2px solid #333; border-top-color: var(--text); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: var(--text-muted); font-size: 0.9rem; }

/* ========== SEO Section ========== */
.seo-section { background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin: 20px 0 8px; }
.seo-section h2 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #aaa; margin-bottom: 10px; }
.seo-section p { font-size: 0.85rem; color: #888; line-height: 1.5; margin-bottom: 12px; }
.seo-section ul { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.seo-section li { font-size: 0.8rem; color: #777; display: flex; gap: 8px; align-items: flex-start; }
.seo-section li::before { content: "-"; color: #555; }
.last-updated { font-size: 0.75rem; color: #444; text-align: center; margin-top: 16px; }

/* ========== Search Modal ========== */
.search-modal { position: fixed; inset: 0; background: #000; z-index: 1200; display: none; flex-direction: column; padding: 16px; }
.search-modal.open { display: flex; }
.search-modal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-back { background: transparent; border: 1px solid #333; color: var(--text); padding: 8px 12px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.modal-title { font-size: 1rem; font-weight: 600; }
.search-modal-input { position: relative; margin-bottom: 12px; }
.search-modal-input input { width: 100%; background: var(--surface); border: 1px solid #333; border-radius: 10px; padding: 14px 44px 14px 16px; color: var(--text); font-size: 1rem; font-family: inherit; }
.search-modal-list { flex: 1; overflow-y: auto; }
body.modal-open { overflow: hidden; }

/* ========== Footer ========== */
footer {
  z-index: 1;
  position: relative;
  text-align: center;
  padding: 10px 20px 14px;
  color: var(--text-muted);
  font-size: 0.7rem;
}
footer a { color: #888; text-decoration: none; }
footer a:hover { color: var(--text); }
.footer-links { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; }

/* ========== Comparison Table (alternative pages) ========== */
.comparison-section { background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin: 20px 0 8px; }
.comparison-section h2 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #aaa; margin-bottom: 12px; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.comparison-table th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 8px 0; border-bottom: 1px solid var(--border); }
.comparison-table td { padding: 10px 0; border-bottom: 1px solid var(--surface-elevated); color: #aaa; }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table .feature { color: #ccc; }
.comparison-table .check { color: #4ade80; }
.comparison-table .cross { color: var(--text-muted); }

/* ========== CTA Section ========== */
.cta-section { background: var(--surface); border: 1px solid #333; border-radius: 10px; padding: 20px; margin: 12px 0; text-align: center; }
.cta-section p { font-size: 0.9rem; color: #aaa; margin-bottom: 12px; }
.cta-btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-size: 0.9rem; transition: background 0.15s; }
.cta-btn:hover { background: #ff6666; }

/* ========== FAQ Section ========== */
.faq-section { background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin: 20px 0 8px; }
.faq-section h2 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #aaa; margin-bottom: 14px; }
.faq-item { padding: 14px 0; border-top: 1px solid var(--border); }
.faq-item:first-of-type { border-top: none; padding-top: 0; }
.faq-q { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.faq-a { font-size: 0.85rem; color: #888; line-height: 1.5; margin: 0; }

/* ========== Mobile ========== */
@media (max-width: 480px) {
  .container { margin: 8px; padding: 20px 16px 16px; border-radius: 12px; }
}
