/* ============================================================
   IRCTC Chart Analytics — style.css
   Bespoke Warm-Minimalist Editorial Design System
   ============================================================ */

/* ---- Color Tokens (High-Contrast Human Palette) ---- */
:root {
  --bg-studio:      #FAF8F5;   /* Warm Alabaster Studio Base */
  --surface-card:   #FFFFFF;   /* Pure White Canvas */
  --surface-muted:  #F4F1EC;   /* Warm Linen Gray */
  
  --primary:        #1A1A1A;   /* Pure Obsidian Black */
  --secondary:      #5C5752;   /* Editorial Charcoal Warm Gray */
  --terracotta:     #B43E12;   /* Burnt Sienna / Rust Highlight Accent */
  --terracotta-tint:#FDF4F0;   /* Pale Rust tint for highlights */
  
  --border-light:   #EBE6DF;   /* Delicate linen borders */
  --border-focus:   #1A1A1A;   /* Focused input border (Obsidian) */
  
  --success-bg:     #E6F4EA;   /* Forest Green tint */
  --success-text:   #137333;   /* Deep Forest Green */
  --warning-bg:     #FEF7E0;   /* Muted Amber tint */
  --warning-text:   #B06000;   /* Deep Amber */
  --danger-bg:      #FCE8E6;   /* Soft Rose tint */
  --danger-text:    #C5221F;   /* Burnt Crimson */
  
  --radius-sm:      4px;       /* Modern minimalist corners */
  --radius-md:      8px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  
  --transition-premium: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-organic: 0 4px 20px rgba(26, 26, 26, 0.03), 0 1px 2px rgba(26, 26, 26, 0.02);
  --shadow-lifted:  0 12px 32px rgba(26, 26, 26, 0.06), 0 2px 4px rgba(26, 26, 26, 0.02);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-studio);
  color: var(--primary);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout & Geometry (Breaking Visual Symmetry) ---- */
.app-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 100px;
  position: relative;
  z-index: 2;
}

/* Asymmetric Navigation Header */
.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 40px 0 32px;
  border-bottom: 2px solid var(--primary); /* Strong editorial line instead of gradient */
  margin-bottom: 48px;
}
.nav-logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.nav-logo-icon {
  font-size: 22px;
  line-height: 1;
}
.nav-logo-text {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--primary);
}
.nav-logo-text span {
  font-weight: 300;
  color: var(--secondary);
}
.nav-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--terracotta);
  background: var(--terracotta-tint);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(180, 62, 18, 0.15);
}

/* ---- Hero Section (Dramatic Typography) ---- */
.hero {
  text-align: left; /* Left-aligned for asymmetric look */
  max-width: 680px;
  margin-bottom: 48px;
}
.hero h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.05;
  color: var(--primary);
  margin-bottom: 18px;
}
.hero h1 .grad {
  color: var(--terracotta);
  background: none;
  -webkit-text-fill-color: initial;
  text-fill-color: initial;
  position: relative;
}
.hero p {
  color: var(--secondary);
  font-size: 16px;
  line-height: 1.6;
}

/* ---- Bespoke Glass Card ---- */
.card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-organic);
  padding: 40px;
  transition: var(--transition-premium);
  position: relative;
  overflow: visible;
}
.card:hover {
  box-shadow: var(--shadow-lifted);
  border-color: rgba(26, 26, 26, 0.15);
}

/* Bento Search Layout */
.search-card {
  margin-bottom: 40px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr; /* Asymmetric Bento Layout */
  gap: 32px;
}
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-full {
  grid-column: 1 / -1;
}
.field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Autocomplete Custom UI */
.autocomplete-wrap {
  position: relative;
}
.autocomplete-wrap .clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-premium);
  display: none;
}
.autocomplete-wrap .clear-btn:hover {
  color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}
.autocomplete-wrap.has-value .clear-btn {
  display: block;
}

.input {
  width: 100%;
  background-color: var(--bg-studio);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-family: inherit;
  font-size: 15px;
  padding: 14px 18px;
  outline: none;
  transition: var(--transition-premium);
}
.input:focus {
  border-color: var(--border-focus);
  background-color: var(--surface-card);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.05);
}
.input::placeholder {
  color: var(--secondary);
  opacity: 0.6;
}
.input:disabled {
  opacity: 0.5;
  background-color: var(--surface-muted);
  cursor: not-allowed;
}

/* Auto-complete dropdowns */
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background-color: var(--surface-card);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lifted);
  display: none;
}
.suggestions.open {
  display: block;
}
.suggestion-item {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--surface-muted);
  transition: var(--transition-premium);
  display: flex;
  gap: 12px;
  align-items: center;
}
.suggestion-item:hover, .suggestion-item.active {
  background-color: var(--surface-muted);
}
.suggestion-item .train-no {
  font-weight: 700;
  color: var(--terracotta);
}
.suggestion-item .train-name {
  color: var(--primary);
  font-weight: 500;
}

/* Custom Select Dropdowns */
.custom-select-wrap {
  position: relative;
  width: 100%;
}
.custom-select-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-studio);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-premium);
  user-select: none;
  color: var(--primary);
  font-size: 15px;
}
.custom-select-box:hover, .custom-select-box:focus {
  background: var(--surface-card);
  border-color: var(--border-focus);
  outline: none;
}
.custom-select-box.open {
  border-color: var(--primary);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.custom-select-box.disabled {
  opacity: 0.5;
  background: var(--surface-muted);
  cursor: not-allowed;
  pointer-events: none;
}
.custom-select-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-value.placeholder {
  color: var(--secondary);
  opacity: 0.6;
}
.custom-select-arrow {
  font-size: 10px;
  color: var(--secondary);
  transition: transform 0.3s;
}
.custom-select-box.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% - 1px);
  left: 0; right: 0;
  background: var(--surface-card);
  border: 1px solid var(--primary);
  border-top: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  z-index: 9999;
  overflow: hidden;
  box-shadow: var(--shadow-lifted);
}
.custom-select-search {
  width: 100%;
  padding: 12px 18px;
  background: var(--bg-studio);
  border: none;
  border-bottom: 1px solid var(--border-light);
  color: var(--primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.custom-select-list {
  max-height: 220px;
  overflow-y: auto;
}
.custom-select-option {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--secondary);
  cursor: pointer;
  transition: var(--transition-premium);
}
.custom-select-option:hover {
  background: var(--surface-muted);
  color: var(--primary);
}
.custom-select-option.selected {
  background: var(--terracotta-tint);
  color: var(--terracotta);
  font-weight: 700;
}

/* Class Chips Dynamic Selector */
.class-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.chip {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--surface-card);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-premium);
  user-select: none;
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--bg-studio);
}
.chip.selected {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--surface-card);
}

/* ---- Action Buttons ---- */
.btn-analyze {
  width: 100%;
  margin-top: 16px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--primary);
  color: var(--surface-card);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition-premium);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-analyze:hover:not(:disabled) {
  background-color: var(--terracotta);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(180, 62, 18, 0.25);
}
.btn-analyze:active:not(:disabled) {
  transform: translateY(0);
}
.btn-analyze:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---- Loading / Progress States ---- */
.progress-card {
  margin-bottom: 32px;
  border-left: 4px solid var(--terracotta);
}
.progress-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.progress-header h3 {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.progress-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
}
.progress-bar-wrap {
  height: 4px;
  background-color: var(--surface-muted);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar-fill {
  height: 100%;
  background-color: var(--terracotta);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-status {
  font-size: 13px;
  color: var(--secondary);
}

/* ---- Results (Layout Asymmetry) ---- */
.results-section {
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.result-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.meta-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
}
.meta-pill strong {
  color: var(--primary);
  font-weight: 700;
}

/* Bento Probability Cards Grid */
.prob-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.prob-card {
  background-color: var(--bg-studio);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: left;
  transition: var(--transition-premium);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.prob-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.prob-card .class-label {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--secondary);
  margin-bottom: 12px;
}

.prob-card .pct {
  font-family: 'Sora', sans-serif;
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  margin-bottom: 4px;
}
.prob-card .pct.high { color: var(--success-text); }
.prob-card .pct.mid  { color: var(--warning-text); }
.prob-card .pct.low  { color: var(--danger-text); }

.prob-card .sub {
  font-size: 12px;
  color: var(--secondary);
  font-weight: 500;
}
.prob-card .avg-berths {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 14px;
}

/* ---- Dynamic Multi-Class Weekday Breakdowns ---- */
.weekday-breakdown-group {
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
}
.weekday-breakdown-group:first-child {
  border-top: none;
  padding-top: 0;
}
.weekday-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.weekday-row::-webkit-scrollbar {
  height: 4px;
}
.weekday-row::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 99px;
}
.wd-cell {
  flex: 1;
  min-width: 72px;
  background-color: var(--bg-studio);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 6px;
  text-align: center;
  transition: var(--transition-premium);
}
.wd-cell:hover {
  border-color: var(--primary);
}
.wd-cell .wd-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 4px;
}
.wd-cell .wd-pct {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 800;
}
.wd-cell.wd-high { border-color: rgba(19, 115, 51, 0.2); }
.wd-cell.wd-mid  { border-color: rgba(176, 96, 0, 0.2); }
.wd-cell.wd-low  { border-color: rgba(197, 34, 31, 0.15); }

/* ---- Premium Minimalist Tables ---- */
.table-section {
  margin-top: 40px;
}
.table-header {
  margin-bottom: 18px;
}
.table-header h3 {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.table-header p, .section-sub {
  font-size: 13px;
  color: var(--secondary);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  background-color: var(--surface-muted);
  color: var(--primary);
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 16px 20px;
  text-align: left;
  border-bottom: 2px solid var(--primary);
}
tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-premium);
}
tbody tr:hover {
  background-color: var(--bg-studio);
}
tbody td {
  padding: 16px 20px;
  color: var(--primary);
  vertical-align: middle;
}
.td-date {
  font-weight: 600;
  color: var(--secondary);
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}
.badge-none { background-color: var(--danger-bg);  color: var(--danger-text); }
.badge-low  { background-color: var(--warning-bg); color: var(--warning-text); }
.badge-high { background-color: var(--success-bg); color: var(--success-text); }

/* ---- Toast Notification System ---- */
#toast-container {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  background-color: var(--primary);
  color: var(--surface-card);
  box-shadow: var(--shadow-lifted);
  border: 1px solid var(--primary);
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) 2.6s forwards;
  pointer-events: auto;
}
.toast.toast-warn {
  background-color: var(--warning-bg);
  border-color: rgba(176, 96, 0, 0.25);
  color: var(--warning-text);
}
.toast.toast-error {
  background-color: var(--danger-bg);
  border-color: rgba(197, 34, 31, 0.25);
  color: var(--danger-text);
}

/* ---- Error Banner ---- */
.error-banner {
  background-color: var(--danger-bg);
  border: 1px solid rgba(197, 34, 31, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--danger-text);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.error-banner .icon {
  font-size: 18px;
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Utility Helper Classes ---- */
.hidden { display: none !important; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 32px; }
.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
  margin-bottom: 4px;
}

/* ---- App Views ---- */
.app-view {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- AdSense Wrapper Styles ---- */
.adsense-slot-wrapper {
  margin: 32px auto;
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  clear: both;
}
.adsense-placeholder {
  width: 100%;
  min-height: 90px;
  background-color: var(--surface-muted);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.75;
}
.top-ad {
  margin-top: 0;
  margin-bottom: 40px;
}
.mid-ad {
  margin-top: 48px;
  margin-bottom: 48px; /* Safe empty space under Analyze button to prevent accidental clicks */
}
.footer-ad {
  margin-top: 56px;
  margin-bottom: 24px;
}

/* ---- Info Page Custom Styles ---- */
.info-page-card {
  padding: 48px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-card);
}
.info-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 24px;
  margin-bottom: 32px;
}
.page-title {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--primary);
  margin-bottom: 8px;
}
.page-subtitle {
  font-size: 15px;
  color: var(--secondary);
  line-height: 1.5;
}
.info-content h3 {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 32px;
  margin-bottom: 12px;
}
.info-content h3:first-of-type {
  margin-top: 0;
}
.info-content p {
  color: var(--primary);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 16px;
}
.info-content ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 24px;
}
.info-content ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--primary);
  line-height: 1.6;
}
.info-content ul li::before {
  content: "•";
  position: absolute;
  left: 8px;
  color: var(--terracotta);
  font-weight: bold;
}
.alert-box {
  background-color: var(--bg-studio);
  border-left: 3px solid var(--terracotta);
  padding: 20px;
  border-radius: var(--radius-sm);
  margin: 24px 0;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.6;
}
.alert-box strong {
  color: var(--primary);
}
.contact-section {
  background-color: var(--bg-studio);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-top: 40px;
}
.contact-email {
  font-size: 16px;
  color: var(--terracotta);
  font-weight: 700;
  margin-top: 8px;
}

.btn-back {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 24px;
  background-color: var(--primary);
  color: var(--surface-card);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: var(--transition-premium);
}
.btn-back:hover {
  background-color: var(--terracotta);
  transform: translateY(-2px);
}

/* ---- Footer Styles ---- */
.footer {
  margin-top: 64px;
  border-top: 1px solid var(--border-light);
  padding: 40px 0;
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.footer-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
  transition: var(--transition-premium);
}
.footer-link:hover {
  color: var(--terracotta);
}
.footer-sep {
  color: var(--border-light);
  font-size: 12px;
  user-select: none;
}
.footer-credits {
  font-size: 11px;
  color: var(--secondary);
  opacity: 0.8;
}

/* ---- Disclaimers ---- */
.form-disclaimer {
  font-size: 12px;
  color: var(--secondary);
  text-align: center;
  margin-top: 16px;
  font-weight: 500;
}
.table-disclaimer {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.table-disclaimer p {
  font-size: 13px;
  color: var(--secondary);
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

/* ---- Search tab switcher ---- */
.search-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  padding: 8px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-premium);
}
.tab-btn:hover {
  color: var(--primary);
  background-color: var(--bg-studio);
}
.tab-btn.active {
  color: var(--surface-card);
  background-color: var(--primary);
}

/* ---- Rate limits display ---- */
.rate-limit-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.rate-limit-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
  background-color: var(--bg-studio);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

/* ---- Maintenance banner ---- */
.maintenance-banner {
  background-color: var(--danger-bg);
  border: 1px solid rgba(197, 34, 31, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--danger-text);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Route train cards ---- */
.route-trains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.route-train-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-organic);
  padding: 24px;
  transition: var(--transition-premium);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.route-train-card:hover {
  box-shadow: var(--shadow-lifted);
  border-color: rgba(26, 26, 26, 0.15);
}
.route-train-header {
  display: flex;
  flex-direction: column;
}
.route-train-title {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
  line-height: 1.2;
}
.route-train-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--terracotta);
  margin-top: 4px;
}
.route-train-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 12px 0;
}
.path-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 60px;
}
.path-station-code {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}
.path-station-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
}
.path-line-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 0 8px;
}
.path-line {
  height: 2px;
  background-color: var(--border-light);
  width: 100%;
  position: relative;
}
.path-line::before, .path-line::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-light);
}
.path-line::before { left: 0; }
.path-line::after { right: 0; }
.path-duration {
  font-size: 10px;
  font-weight: 700;
  color: var(--secondary);
  background-color: var(--bg-studio);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border-light);
  position: absolute;
  top: -10px;
}
.avl-classes-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.avl-classes-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.route-train-card .class-chips {
  margin-top: 0;
  gap: 6px;
}
.route-train-card .chip {
  padding: 6px 12px;
  font-size: 11px;
}

/* ---- Welcome Modal Overlay ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-card {
  width: 90%;
  max-width: 460px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lifted);
  padding: 32px;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-header {
  margin-bottom: 16px;
}
.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
}
.modal-body {
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}
.modal-body a {
  color: var(--terracotta);
  font-weight: 700;
  text-decoration: underline;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
}
.btn-modal-close {
  padding: 10px 20px;
  background-color: var(--primary);
  color: var(--surface-card);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-premium);
}
.btn-modal-close:hover {
  background-color: var(--terracotta);
  transform: translateY(-1px);
}

/* ---- Mobile Styles ---- */
@media (max-width: 600px) {
  .app-wrapper {
    padding: 0 16px 80px;
  }
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 24px 0 20px;
    margin-bottom: 32px;
  }
  .card {
    padding: 24px 16px;
  }
  .hero {
    margin-bottom: 32px;
  }
  .hero h1 {
    font-size: 30px;
    letter-spacing: -1px;
  }
  .hero p {
    font-size: 14px;
  }
  .btn-analyze {
    padding: 14px 20px;
    font-size: 14px;
  }
  tbody td, thead th {
    padding: 12px 14px;
  }
  .info-page-card {
    padding: 24px 16px;
  }
  .page-title {
    font-size: 22px;
  }
  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
  .footer-sep {
    display: none;
  }
}
