/* Delhi Metro Rail Clone - Stylesheet */
/* Optimized for Mobile, Tablet & Desktop */

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --dmrc-red: #E60012;
  --dmrc-blue: #0066CC;
  --dmrc-yellow: #FFD700;
  --dmrc-green: #00A651;
  --dmrc-orange: #FF6600;
  --dmrc-violet: #8B008B;
  --dmrc-pink: #E0218A;
  --dmrc-magenta: #C0C0C0;
  --dmrc-aqua: #00BFFF;
  --dmrc-gray: #808080;
  --header-bg: #1a1a2e;
  --header-text: #ffffff;
  --nav-bg: #16213e;
  --nav-text: #e0e0e0;
  --body-bg: #f0f0f5;
  --card-bg: #ffffff;
  --text-dark: #333333;
  --text-light: #666666;
  --border-color: #ddd;
  --accent: #0066CC;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--body-bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: var(--accent);
  transition: color 0.2s;
}

a:hover {
  color: var(--dmrc-red);
}

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, var(--header-bg), var(--nav-bg));
  color: var(--header-text);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--dmrc-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.site-subtitle {
  font-size: 0.75rem;
  color: #aaa;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--header-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== MENU BUTTON (Hamburger) ===== */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===== NAVIGATION ===== */
.main-nav {
  background: var(--nav-bg);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
}

.main-nav.open {
  max-height: 600px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-list li a {
  display: block;
  padding: 14px 20px;
  color: var(--nav-text);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.nav-list li a:hover,
.nav-list li a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-left: 4px solid var(--dmrc-red);
  padding-left: 16px;
}

/* Line color indicators */
.nav-list li a .line-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 20px 16px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-title {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--dmrc-red);
}

/* ===== ROUTE FINDER CARD ===== */
.route-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.route-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.form-group select,
.form-group input {
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text-dark);
  transition: border-color 0.2s;
  width: 100%;
}

.form-group select:focus,
.form-group input:focus {
  border-color: var(--accent);
  outline: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  min-width: 120px;
}

.btn-primary {
  background: var(--dmrc-red);
  color: #fff;
}

.btn-primary:hover {
  background: #c50010;
}

.btn-secondary {
  background: var(--dmrc-blue);
  color: #fff;
}

.btn-secondary:hover {
  background: #0052a3;
}

.btn-swap {
  background: var(--dmrc-green);
  color: #fff;
  font-size: 1.1rem;
  padding: 12px 20px;
}

/* ===== ROUTE RESULT ===== */
.route-result {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
  display: none;
}

.route-result.visible {
  display: block;
}

.result-header {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--header-bg);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.result-table th {
  background: var(--nav-bg);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.9rem;
}

.result-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.result-table tr:nth-child(even) td {
  background: #f8f8ff;
}

/* Route Path */
.route-path {
  margin: 16px 0;
}

.route-path-title {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.station-node {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
  position: relative;
}

.station-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid;
  flex-shrink: 0;
  margin-top: 3px;
  z-index: 1;
  background: #fff;
}

.station-connector {
  width: 3px;
  background: currentColor;
  margin-left: 6.5px;
  min-height: 28px;
  flex-shrink: 0;
}

.station-info {
  flex: 1;
  padding-bottom: 8px;
}

.station-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.station-line-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}

.station-platform {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Gate info */
.gate-section {
  margin-top: 16px;
}

.gate-section h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--header-bg);
}

.gate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.gate-table th {
  background: var(--dmrc-blue);
  color: #fff;
  padding: 8px 10px;
  text-align: left;
}

.gate-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
}

.gate-table tr:nth-child(even) td {
  background: #f0f5ff;
}

/* ===== INFO PAGES ===== */
.info-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.info-card h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--header-bg);
  border-bottom: 2px solid var(--dmrc-red);
  padding-bottom: 6px;
}

.info-card h3 {
  font-size: 1.1rem;
  margin: 16px 0 8px;
  color: var(--nav-bg);
}

.info-card p {
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.info-card ul {
  margin: 8px 0 12px 20px;
}

.info-card ul li {
  margin-bottom: 6px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.info-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.info-card table th {
  background: var(--nav-bg);
  color: #fff;
  padding: 10px;
  text-align: center;
  font-size: 0.88rem;
}

.info-card table td {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.9rem;
}

.info-card table tr:nth-child(even) td {
  background: #f5f5fa;
}

/* ===== LINE LIST (Map Page) ===== */
.line-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.line-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  width: 100%;
  border-top: 5px solid;
  cursor: pointer;
  transition: transform 0.2s;
}

.line-card:hover {
  transform: translateY(-3px);
}

.line-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.line-card p {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== STATION GRID ===== */
.station-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.station-card {
  background: var(--card-bg);
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s;
  border-left: 4px solid var(--dmrc-blue);
}

.station-card:hover {
  transform: translateX(4px);
}

.station-card .station-num {
  font-weight: 700;
  color: var(--text-light);
  min-width: 28px;
}

.station-card .station-text {
  flex: 1;
}

.station-card .station-text strong {
  display: block;
  font-size: 0.95rem;
}

.station-card .station-text span {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--header-bg);
  color: #bbb;
  padding: 24px 16px 16px;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.footer-links a {
  color: #aaa;
  font-size: 0.88rem;
}

.footer-links a:hover {
  color: #fff;
}

.footer-helpline {
  text-align: center;
  font-size: 0.88rem;
}

.footer-helpline strong {
  color: #fff;
}

.footer-copy {
  text-align: center;
  font-size: 0.8rem;
  color: #777;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

/* ===================================================
   TABLET OPTIMIZATION (768px and up)
   =================================================== */
@media (min-width: 768px) {
  html {
    font-size: 17px;
  }

  .header-top {
    padding: 12px 24px;
  }

  .site-title {
    font-size: 1.7rem;
  }

  .site-subtitle {
    font-size: 0.85rem;
  }

  .logo-icon {
    width: 50px;
    height: 50px;
    font-size: 26px;
  }

  .header-btn {
    padding: 8px 18px;
    font-size: 0.9rem;
  }

  /* Menu toggle hidden on tablet+, show inline nav */
  .menu-toggle {
    display: none;
  }

  .main-nav {
    max-height: none;
    overflow: visible;
    background: var(--nav-bg);
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 24px;
  }

  .nav-list li {
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-list li a {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-left: none;
  }

  .nav-list li a:hover,
  .nav-list li a.active {
    border-left: none;
    border-bottom: 3px solid var(--dmrc-red);
    padding-left: 16px;
    background: rgba(255, 255, 255, 0.08);
  }

  .main-content {
    padding: 28px 24px;
  }

  .page-title {
    font-size: 1.8rem;
  }

  /* Route form: side by side on tablet */
  .route-form {
    flex-direction: row;
    align-items: flex-end;
    gap: 16px;
  }

  .form-group {
    flex: 1;
  }

  .form-actions {
    flex: 0 0 auto;
    flex-direction: column;
    gap: 8px;
  }

  .btn {
    min-width: 140px;
  }

  .route-card,
  .route-result,
  .info-card {
    padding: 28px;
  }

  .result-header {
    font-size: 1.4rem;
  }

  /* Line cards: 2 columns on tablet */
  .line-list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Station grid: 2 columns on tablet */
  .station-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer: horizontal layout */
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }

  .footer-links {
    flex: 1;
    justify-content: flex-start;
  }

  .footer-helpline {
    flex: 1;
  }

  .footer-copy {
    flex-basis: 100%;
  }

  /* Info tables */
  .info-card table {
    font-size: 0.92rem;
  }
}

/* ===================================================
   DESKTOP OPTIMIZATION (1024px and up)
   =================================================== */
@media (min-width: 1024px) {
  html {
    font-size: 18px;
  }

  .header-top {
    padding: 14px 32px;
  }

  .site-title {
    font-size: 2rem;
  }

  .site-subtitle {
    font-size: 0.9rem;
  }

  .logo-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .main-content {
    padding: 32px;
    max-width: 1100px;
  }

  .page-title {
    font-size: 2rem;
    margin-bottom: 24px;
  }

  /* Desktop: route result uses two-column layout for path + gates */
  .route-result {
    padding: 32px;
  }

  .result-header {
    font-size: 1.6rem;
  }

  .result-table th,
  .result-table td {
    padding: 14px 16px;
    font-size: 1rem;
  }

  /* Line cards: 3 columns on desktop */
  .line-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  /* Station grid: 3 columns on desktop */
  .station-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .line-card {
    padding: 20px;
  }

  .info-card {
    padding: 32px;
  }

  .info-card h2 {
    font-size: 1.5rem;
  }

  .info-card table th {
    padding: 12px;
    font-size: 0.95rem;
  }

  .info-card table td {
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  /* Two-column route result on desktop */
  .route-result-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .route-path-section {
    grid-column: 1;
  }

  .gate-section {
    grid-column: 2;
  }

  /* Desktop nav: centered with more spacing */
  .nav-list {
    justify-content: center;
  }

  .nav-list li a {
    padding: 14px 20px;
    font-size: 0.95rem;
  }

  .footer-content {
    padding: 0 32px;
  }
}

/* ===================================================
   LARGE DESKTOP (1440px and up)
   =================================================== */
@media (min-width: 1440px) {
  .main-content {
    max-width: 1300px;
  }

  .header-top {
    max-width: 1300px;
  }

  .nav-list {
    max-width: 1300px;
  }

  .footer-content {
    max-width: 1300px;
  }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.hidden { display: none !important; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
