/* Route & Isochrone Reachability Calculator Scoped Styles */
.ric-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--tf-text, #1e293b);
}

.ric-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ric-mode-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--tf-rule, #e2e8f0);
  overflow-x: auto;
}

.ric-tab-btn {
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tf-text-subtle, #64748b);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.ric-tab-btn:hover {
  color: var(--tf-text, #0f172a);
}

.ric-tab-btn.active {
  color: var(--tf-accent, #0284c7);
  border-bottom-color: var(--tf-accent, #0284c7);
}

.ric-config-card {
  background: var(--tf-surface, #ffffff);
  border: 1px solid var(--tf-rule, #e2e8f0);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ric-panel {
  display: none;
}

.ric-panel.active {
  display: block;
}

.ric-card-title {
  margin: 0 0 1.25rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tf-text, #0f172a);
}

.ric-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.ric-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ric-field-wide {
  grid-column: 1 / -1;
}

.ric-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tf-text-subtle, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ric-input,
.ric-select {
  height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--tf-rule, #cbd5e1);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--tf-surface, #ffffff);
  color: var(--tf-text, #0f172a);
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ric-input:focus,
.ric-select:focus {
  border-color: var(--tf-accent, #0284c7);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.ric-range {
  height: 44px;
  width: 100%;
  cursor: pointer;
}

.ric-presets-row {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--tf-rule, #e2e8f0);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ric-presets-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tf-text-subtle, #64748b);
}

.ric-pills-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ric-pill-btn {
  min-height: 32px;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--tf-rule, #cbd5e1);
  background: var(--tf-surface-alt, #f8fafc);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--tf-text, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ric-pill-btn:hover {
  border-color: var(--tf-accent, #0284c7);
  color: var(--tf-accent, #0284c7);
}

.ric-pill-btn.active {
  background: var(--tf-accent, #0284c7);
  color: #ffffff;
  border-color: var(--tf-accent, #0284c7);
}

.ric-action-row {
  margin-top: 1.5rem;
  display: flex;
}

.ric-btn {
  height: 44px;
  padding: 0 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: filter 0.15s ease;
}

.ric-btn-primary {
  background: var(--tf-accent, #0284c7);
  color: #ffffff;
}

.ric-btn-primary:hover {
  filter: brightness(1.08);
}

/* Visualizer Section */
.ric-visual-section {
  background: var(--tf-surface, #ffffff);
  border: 1px solid var(--tf-rule, #e2e8f0);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ric-visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ric-visual-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tf-text, #0f172a);
}

.ric-legend-wrap {
  display: flex;
  gap: 0.5rem;
}

.ric-legend-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.ric-legend-pill.ring-15 {
  background: rgba(34, 197, 94, 0.2);
  color: #15803d;
  border: 1px solid #22c55e;
}

.ric-legend-pill.ring-30 {
  background: rgba(234, 179, 8, 0.2);
  color: #a16207;
  border: 1px solid #eab308;
}

.ric-legend-pill.ring-45 {
  background: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
  border: 1px solid #ef4444;
}

.ric-canvas-wrap {
  width: 100%;
  border: 1px solid var(--tf-rule, #cbd5e1);
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.ric-canvas {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
}

.ric-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.ric-metric-card {
  background: var(--tf-surface-alt, #f8fafc);
  border: 1px solid var(--tf-rule, #e2e8f0);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ric-metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tf-text-subtle, #64748b);
  text-transform: uppercase;
}

.ric-metric-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--tf-text, #0f172a);
}

.ric-metric-sub {
  font-size: 0.75rem;
  color: var(--tf-text-subtle, #64748b);
}

/* Export Section */
.ric-export-section {
  background: var(--tf-surface, #ffffff);
  border: 1px solid var(--tf-rule, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
}

.ric-export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ric-export-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tf-text, #0f172a);
}

.ric-export-actions {
  display: flex;
  gap: 0.5rem;
}

.ric-btn-secondary {
  min-height: 32px;
  padding: 0.25rem 0.85rem;
  background: var(--tf-surface-alt, #f1f5f9);
  border: 1px solid var(--tf-rule, #cbd5e1);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tf-text, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ric-btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.ric-code-box {
  margin: 0;
  padding: 1rem;
  background: #0f172a;
  color: #38bdf8;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  max-height: 220px;
  overflow: auto;
}

.ric-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Interactive Leaflet Map Container */
.ric-map-container {
  width: 100%;
  height: 440px;
  background: #f1f5f9;
  z-index: 1;
}

/* Custom Leaflet Hub Marker */
.ric-leaflet-hub-icon {
  position: relative;
}

.ric-hub-dot {
  width: 14px;
  height: 14px;
  background: #0284c7;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  position: absolute;
  top: 5px;
  left: 5px;
}

.ric-hub-pulse {
  width: 24px;
  height: 24px;
  background: rgba(2, 132, 199, 0.35);
  border-radius: 50%;
  animation: ric-pulse 1.8s infinite ease-out;
}

@keyframes ric-pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}
