/* ===== Home Page CSS ===== */

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, #0d1257 0%, #1a237e 50%, #283593 100%);
  min-height: 540px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 40px 0 60px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Animated track line */
.track-line {
  position: absolute;
  bottom: 60px;
  left: -100%;
  right: -10%;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,160,0,0.6) 0, rgba(255,160,0,0.6) 30px,
    transparent 30px, transparent 50px
  );
  animation: trackScroll 4s linear infinite;
}

.train-icon-anim {
  position: absolute;
  bottom: 44px;
  font-size: 48px;
  animation: trainMove 8s linear infinite;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

@keyframes trackScroll {
  from { transform: translateX(0); }
  to { transform: translateX(80px); }
}
@keyframes trainMove {
  from { left: -80px; }
  to { left: 110%; }
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  background: rgba(255,160,0,0.2);
  border: 1px solid rgba(255,160,0,0.5);
  color: var(--amber-light);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 0.3px;
}

.hero-text h1 {
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero-highlight {
  color: var(--amber-light);
  position: relative;
}

.hero-text p {
  color: rgba(255,255,255,0.7);
  font-size: 17px;
  line-height: 1.7;
  max-width: 440px;
}

/* ---- Booking Widget ---- */
.booking-widget {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.widget-tabs {
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.wtab {
  flex: 1;
  padding: 14px 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.wtab:hover { color: var(--navy); background: rgba(26,35,126,0.04); }
.wtab.active { color: var(--navy); border-bottom-color: var(--red); background: #fff; }

.tab-panel { display: none; padding: 24px; }
.tab-panel.active { display: block; }

.journey-type { display: flex; gap: 20px; margin-bottom: 20px; }
.radio-opt {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.radio-opt input { accent-color: var(--navy); }

.widget-fields {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.widget-fields-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.field-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.field-wrap > label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.autocomplete-wrap { position: relative; }
.ac-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  display: none;
  overflow: hidden;
}
.ac-list li {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  transition: background 0.1s;
}
.ac-list li:hover { background: var(--bg); }
.ac-code {
  font-weight: 800;
  font-size: 12px;
  color: var(--navy);
  background: rgba(26,35,126,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.ac-name { color: var(--text); }

.swap-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border: 2px solid var(--navy);
  background: #fff;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--navy);
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  align-self: flex-end;
  margin-bottom: 2px;
}
.swap-btn:hover { background: var(--navy); color: #fff; transform: rotate(180deg); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23616161' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.search-btn { width: 100%; font-size: 16px; padding: 14px; }

.pnr-widget { padding: 8px 0; }
.pnr-widget label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}
.pnr-input { font-size: 20px; font-weight: 700; letter-spacing: 2px; text-align: center; margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--text-light); margin-bottom: 20px; text-align: center; }

/* ---- Sections ---- */
.section { padding: 60px 0; }
.section-light { background: #fff; }
.section-navy {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: #fff;
}

.section-header { text-align: center; margin-bottom: 36px; }
.section-header h2 { font-size: 30px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.section-light .section-header h2 { color: var(--navy); }
.section-header p { color: var(--text-muted); font-size: 16px; }

/* ---- Popular Routes ---- */
.routes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.route-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.route-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.route-cities {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.route-arrow { color: var(--red); font-size: 18px; }
.route-meta { display: flex; align-items: center; justify-content: space-between; }
.route-dist { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ---- Services ---- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.service-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: block;
}
.service-card:hover {
  background: #fff;
  border-color: var(--navy);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.svc-icon { font-size: 36px; margin-bottom: 12px; }
.service-card h3 { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.service-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ---- Featured Trains ---- */
.trains-showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.train-feature-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 1.5px solid var(--border);
  position: relative;
  transition: all 0.2s;
}
.train-feature-card:hover { box-shadow: var(--shadow-lg); border-color: var(--navy); transform: translateY(-2px); }

.train-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.train-feature-card h3 { font-size: 20px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.train-feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }
.train-stats { display: flex; flex-direction: column; gap: 6px; }
.train-stats span { font-size: 13px; color: var(--steel); }

/* ---- Why Section ---- */
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.why-text h2 { font-size: 34px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.why-text > p { color: rgba(255,255,255,0.65); font-size: 16px; margin-bottom: 32px; }

.why-points { display: flex; flex-direction: column; gap: 20px; }
.why-point {
  display: flex; align-items: flex-start; gap: 16px;
}
.why-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.why-point strong { display: block; color: #fff; font-size: 16px; margin-bottom: 2px; }
.why-point div { color: rgba(255,255,255,0.6); font-size: 14px; }

.why-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-box {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}
.stat-num { font-size: 32px; font-weight: 900; color: var(--amber-light); margin-bottom: 4px; }
.stat-lbl { font-size: 13px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-text { text-align: center; }
  .hero-text p { margin: 0 auto; }
  .routes-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .trains-showcase { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hero-text h1 { font-size: 34px; }
  .widget-fields { flex-direction: column; }
  .swap-btn { transform: rotate(90deg); align-self: center; }
  .swap-btn:hover { transform: rotate(270deg); }
  .widget-fields-2 { grid-template-columns: 1fr 1fr; }
  .routes-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .trains-showcase { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; gap: 40px; }
  .why-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .widget-fields-2 { grid-template-columns: 1fr; }
  .why-stats { grid-template-columns: 1fr 1fr; }
}