/* ==========================================================================
   RailSeatGap - Modern Responsive Stylesheet
   Brand Colors: Royal Navy Blue (#0a3678), Radiant Orange (#f57c00, #ff8f00)
   ========================================================================== */

:root {
  --primary: #0a3d91;
  --primary-hover: #082d6b;
  --primary-light: #e8f0fe;
  --secondary: #ff7900;
  --secondary-hover: #e56d00;
  --secondary-light: #fff3e6;
  
  --dark: #0f172a;
  --dark-surface: #1e293b;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #f8fafc;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(10, 61, 145, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 30px -4px rgba(10, 61, 145, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.06);
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background: var(--light-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utilities & Container */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 18px;
}

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--secondary); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.font-bold { font-weight: 700; }
.bg-blue-subtle { background: var(--primary-light); }
.bg-green-subtle { background: var(--success-bg); }
.bg-orange-subtle { background: var(--secondary-light); }

/* Top Announcement */
.top-bar {
  background: linear-gradient(90deg, #072658, #0a3d91);
  color: #fff;
  font-size: 0.8rem;
  padding: 7px 0;
}
.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-retention-pill {
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.top-lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}
.lang-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.lang-link.active, .lang-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

/* Site Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(10, 61, 145, 0.2);
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.brand-highlight {
  color: var(--secondary);
}
.brand-slogan {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s;
}
.header-link:hover, .header-link.active {
  color: var(--primary);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--secondary), #ea580c);
  color: #fff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #e56d00, #c2410c);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.35);
}
.btn-secondary {
  background: var(--primary);
  color: #fff;
}
.btn-secondary:hover {
  background: var(--primary-hover);
}
.btn-app-download {
  background: linear-gradient(135deg, #0a3d91, #1e40af);
  color: #fff;
  box-shadow: 0 4px 14px rgba(10, 61, 145, 0.25);
  font-size: 0.85rem;
  padding: 8px 14px;
}
.btn-app-download:hover {
  background: linear-gradient(135deg, #082d6b, #1d4ed8);
  transform: translateY(-1px);
}
.btn-outline-light {
  background: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-outline-light:hover {
  background: #e2e8f0;
}
.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger-bg);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.btn-block {
  width: 100%;
}
.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Hero Section */
.main-content {
  flex: 1;
  padding: 32px 0 60px;
}
.hero-container {
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--dark);
  margin-bottom: 12px;
  letter-spacing: -0.8px;
}
.gradient-text {
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 720px;
  margin: 0 auto 28px;
}

/* Search Limit Counter Pill */
.search-limit-tracker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.search-limit-pill {
  background: var(--secondary-light);
  color: var(--secondary);
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Search Card */
.search-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226, 232, 240, 0.8);
  text-align: left;
  margin-bottom: 32px;
}
.form-section {
  margin-bottom: 22px;
}
.field-label-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.field-icon {
  font-size: 0.95rem;
}
.train-preview-chip {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--success-bg);
  color: var(--success);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  animation: fadeIn 0.3s ease;
}
.train-preview-chip.visible {
  display: inline-flex;
}

.train-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s;
  background: #fafbfc;
}
.form-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(10, 61, 145, 0.1);
}
.train-input {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  letter-spacing: 2px;
}
.clear-input-btn {
  position: absolute;
  right: 14px;
  background: #e2e8f0;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}
.clear-input-btn.visible {
  display: flex;
}

.quick-trains {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.quick-train-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.quick-train-pill {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.quick-train-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

/* Date Picker Row */
.date-picker-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.date-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}
.date-chip:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.date-chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(10, 61, 145, 0.15);
}
.date-day {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.date-chip.active .date-day {
  color: var(--primary);
}
.date-val {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 2px;
}
.custom-date-wrap {
  position: relative;
}
.custom-date-input {
  padding: 13px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.custom-date-input:focus {
  border-color: var(--primary);
}

/* Stations Grid */
.stations-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.station-picker-box {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
}
.station-picker-box:hover {
  border-color: var(--primary);
  background: #fafbfc;
}
.station-box-content {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.station-code-badge {
  background: #e2e8f0;
  color: var(--dark);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  min-width: 54px;
  text-align: center;
}
.station-code-badge.selected {
  background: var(--primary);
  color: #fff;
}
.station-info-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.station-selected-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-hint-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.station-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.swap-stations-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.swap-btn {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #bfdbfe;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.95rem;
}
.swap-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: rotate(180deg);
}

.btn-search {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  border-radius: var(--radius-md);
  margin-top: 8px;
}

/* Recent Searches */
.recent-searches-wrap {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.recent-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.recent-chip {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.recent-chip:hover {
  border-color: var(--primary);
  background: #ffffff;
}
.recent-train-tag {
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
}
.recent-route-tag {
  color: var(--text-secondary);
  font-weight: 600;
}
.recent-time-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Progress Card */
.progress-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 32px;
}
.progress-animation-icon {
  font-size: 2.4rem;
  color: var(--secondary);
  margin-bottom: 16px;
}
.progress-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}
.progress-sub {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 20px;
}
.progress-bar-track {
  width: 100%;
  max-width: 500px;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
  border-radius: var(--radius-full);
}
.progress-stats-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Error Card */
.error-card {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-bottom: 32px;
}
.error-icon {
  font-size: 2.2rem;
  color: var(--danger);
  margin-bottom: 12px;
}
.error-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 6px;
}
.error-card p {
  color: #7f1d1d;
  font-size: 0.95rem;
  margin-bottom: 18px;
}

/* Results Section */
.results-container {
  margin-bottom: 48px;
  animation: fadeIn 0.4s ease;
}

/* Train Summary Banner */
.train-summary-banner {
  background: linear-gradient(135deg, #072b66, #0d3b82);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
}
.banner-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.live-tag {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.live-pulse {
  font-size: 0.5rem;
  color: #ef4444;
  animation: pulse 1.5s infinite;
}
.chart-tag {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}
.chart-ready {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.result-train-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.result-route-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #cbd5e1;
}
.route-date-sep {
  color: #64748b;
}
.banner-stat-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  text-align: center;
  min-width: 140px;
  backdrop-filter: blur(8px);
}
.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: #ff9d3b;
  line-height: 1;
  font-family: var(--font-mono);
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Class Filter Bar */
.class-filters-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scrollbar-width: none;
}
.class-filters-bar::-webkit-scrollbar {
  display: none;
}
.filter-pill {
  background: #ffffff;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(10, 61, 145, 0.25);
}

/* Tabs Nav */
.tabs-nav {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  gap: 6px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover {
  background: #f8fafc;
  color: var(--text-primary);
}
.tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}
.badge-tab-highlight {
  background: linear-gradient(135deg, var(--secondary), #ea580c);
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
}
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-pane.active {
  display: block;
}

/* Coach Grid */
.coach-grid-intro {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.coaches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.coach-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.coach-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.coach-card.has-vacancy {
  border-color: #86efac;
  background: #f0fdf4;
}
.coach-card.has-vacancy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--success);
}
.coach-card-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  font-family: var(--font-mono);
}
.coach-card-class {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin: 4px 0 8px;
}
.coach-card.has-vacancy .coach-card-class {
  background: #bbf7d0;
  color: #14532d;
}
.coach-card-vacant {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}
.coach-card.has-vacancy .coach-card-vacant {
  color: var(--success);
}

/* Seat Hopping Tab */
.hopping-banner {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.hopping-icon {
  font-size: 1.5rem;
  color: #d97706;
}
.hopping-text h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}
.hopping-text p {
  font-size: 0.88rem;
  color: #78350f;
  line-height: 1.4;
}
.hopping-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hopping-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.hopping-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.hopping-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.hopping-coach-tag {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}
.hopping-hops-count {
  font-size: 0.78rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.hop-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.hop-step-leg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--dark);
}
.hop-step-seat {
  background: var(--success-bg);
  color: var(--success);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
}

/* All Seats Table View */
.seats-filter-toolbar {
  margin-bottom: 16px;
}
.seat-type-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sub-filter-pill {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
}
.sub-filter-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.seats-table-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.seat-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.seat-info-left {
  display: flex;
  flex-direction: column;
}
.seat-coach-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark);
  font-family: var(--font-mono);
}
.seat-type-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.seat-status-right {
  text-align: right;
}
.seat-vacant-badge {
  background: var(--success-bg);
  color: var(--success);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-block;
}
.seat-split-route {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Information & Article Sections */
.info-section, .faq-section, .article-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.section-title-wrap {
  text-align: center;
  margin-bottom: 36px;
}
.section-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.section-sub {
  color: var(--text-secondary);
  font-size: 1rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Guides & Article Reader View */
.article-header {
  text-align: center;
  margin-bottom: 40px;
}
.article-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}
.article-main-title {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 14px;
}
.article-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto;
}
.article-body {
  max-width: 820px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.article-body h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--dark);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}
.article-body h2:first-child {
  margin-top: 0;
}
.article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 22px 0 10px;
  color: var(--primary);
}
.article-body p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
  font-size: 0.98rem;
}
.article-body ul, .article-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--text-secondary);
}
.article-body li {
  margin-bottom: 8px;
  line-height: 1.6;
}
.info-callout {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 24px 0;
}
.info-callout h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.info-callout p {
  margin-bottom: 0;
  color: #1e3a8a;
  font-size: 0.92rem;
}

/* Comparison / Reference Tables */
.table-responsive {
  overflow-x: auto;
  margin: 24px 0;
}
.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}
.custom-table th {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 700;
}
.custom-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.custom-table tr:hover td {
  background: #f8fafc;
}

/* FAQ Accordion */
.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  cursor: pointer;
  transition: all 0.2s;
}
.faq-item:hover {
  border-color: #cbd5e1;
}
.faq-item[open] {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.faq-question {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--dark);
  outline: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-answer {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* App Download Gate Modal */
.app-gate-dialog {
  max-width: 460px;
  text-align: center;
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}
.app-gate-dialog::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.gate-logo {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin: 0 auto 16px;
  box-shadow: 0 6px 20px rgba(10, 61, 145, 0.25);
  display: block;
}
.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff3e6;
  color: #ea580c;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gate-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.3;
}
.gate-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.gate-perks-list {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gate-perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
}
.gate-perk-item i {
  color: var(--success);
  font-size: 1rem;
}
.gate-cta-btn {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.gate-footnote {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.active {
  display: flex;
}
.modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark);
}
.modal-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-close-btn:hover {
  color: var(--dark);
}
.modal-search-box {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
}
.modal-search-icon {
  position: absolute;
  left: 30px;
  color: var(--text-muted);
}
.modal-search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  font-size: 0.92rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
}
.modal-search-input:focus {
  border-color: var(--primary);
}
.modal-station-list {
  overflow-y: auto;
  padding: 8px 12px;
  max-height: 50vh;
}
.station-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}
.station-row-item:hover {
  background: var(--primary-light);
}
.station-row-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.stn-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stn-row-code {
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  background: #e0f2fe;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.stn-row-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--dark);
}
.stn-row-order {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Storage Modal */
.modal-body {
  padding: 20px;
}
.storage-stat-card {
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.storage-icon {
  font-size: 2rem;
}
.storage-stat-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}
.storage-stat-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.storage-details-list {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.storage-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed var(--border);
}
.storage-row:last-child {
  border-bottom: none;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 54px 0 32px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}
.footer-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}
.footer-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #94a3b8;
}
.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-link:hover {
  color: var(--secondary);
}
.footer-meta {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-disclaimer {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.5;
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Mobile Responsiveness */
@media (max-width: 860px) {
  .hero-title {
    font-size: 1.8rem;
  }
  .article-main-title {
    font-size: 1.7rem;
  }
  .stations-grid {
    grid-template-columns: 1fr;
  }
  .swap-stations-wrap {
    margin: -4px 0;
  }
  .train-summary-banner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .banner-stat-box {
    width: 100%;
  }
  .banner-badge-row, .result-route-meta {
    justify-content: center;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .top-retention-pill, .hide-mobile {
    display: none;
  }
  .search-card {
    padding: 20px 16px;
  }
  .article-body {
    padding: 24px 18px;
  }
}
