/* ===========================
   RailYatra — Main Stylesheet
   =========================== */

:root {
  --navy: #1a237e;
  --navy-dark: #0d1257;
  --navy-light: #283593;
  --red: #c62828;
  --red-light: #ef5350;
  --amber: #ffa000;
  --amber-light: #ffca28;
  --steel: #455a64;
  --steel-light: #78909c;
  --bg: #f0f2f5;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --text: #212121;
  --text-muted: #616161;
  --text-light: #9e9e9e;
  --border: #e0e0e0;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-lg: 16px;
  --header-h: 56px;
  --subheader-h: 40px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

main { flex: 1; }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  letter-spacing: 0.3px;
}
.btn-primary:hover { background: var(--red-light); box-shadow: 0 4px 12px rgba(198,40,40,0.3); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-primary.full-width { width: 100%; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius); padding: 10px 24px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--navy); color: #fff; }

/* ---- Header ---- */
.site-header { position: sticky; top: 0; z-index: 1000; }

.header-top {
  background: var(--navy);
  height: var(--header-h);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo-icon { font-size: 26px; line-height: 1; }
.logo-text { display: flex; flex-direction: column; }
.logo-main { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.logo-sub { font-size: 10px; color: rgba(255,255,255,0.65); letter-spacing: 0.5px; text-transform: uppercase; }

.header-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.15); color: #fff; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-login {
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 6px;
  padding: 7px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-login:hover { background: rgba(255,255,255,0.15); border-color: #fff; }

.btn-register {
  background: var(--amber);
  color: var(--navy-dark);
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-register:hover { background: var(--amber-light); box-shadow: 0 2px 8px rgba(255,160,0,0.4); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

.header-bottom {
  background: var(--navy-dark);
  height: var(--subheader-h);
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.quick-links {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-links::-webkit-scrollbar { display: none; }

.quick-links a {
  color: rgba(255,255,255,0.75);
  font-size: 12.5px;
  padding: 0 14px;
  height: var(--subheader-h);
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,0.1);
  transition: all 0.15s;
  white-space: nowrap;
}
.quick-links a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.quick-links a:first-child { padding-left: 0; }

/* ---- Footer ---- */
.site-footer { background: #1a1a2e; color: rgba(255,255,255,0.8); margin-top: auto; }

.footer-top { padding: 48px 0 32px; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr;
  gap: 32px;
}

.footer-brand .footer-logo {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.footer-brand .logo-main { font-size: 22px; font-weight: 800; color: #fff; }
.footer-brand p { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.7; margin-bottom: 16px; }

.footer-social { display: flex; gap: 8px; }
.social-btn {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s;
}
.social-btn:hover { background: var(--amber); color: var(--navy-dark); }

.footer-col h4 {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--amber);
  display: inline-block;
}

.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  transition: color 0.15s;
}
.footer-col ul a:hover { color: var(--amber); }

.helpline-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.helpline-item { display: flex; justify-content: space-between; align-items: center; }
.helpline-label { font-size: 12px; color: rgba(255,255,255,0.5); }
.helpline-num { font-size: 16px; font-weight: 800; color: var(--amber); }

.app-download p { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.app-btns { display: flex; flex-direction: column; gap: 6px; }
.app-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  transition: all 0.2s;
  text-align: center;
}
.app-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

.footer-bottom {
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 0;
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 12.5px; color: rgba(255,255,255,0.4); }

.payment-icons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pay-icon {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.3px;
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  position: relative;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal h2 { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg); border: none; border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 14px; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,35,126,0.1); }

.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.link-small { font-size: 13px; color: var(--navy); font-weight: 600; }
.link-small:hover { text-decoration: underline; }
.modal-footer-text { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.modal-footer-text a { color: var(--navy); font-weight: 600; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ---- Page Hero ---- */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  padding: 36px 0;
  text-align: center;
}
.page-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.page-hero p { color: rgba(255,255,255,0.7); font-size: 16px; }

/* ---- Breadcrumb ---- */
.breadcrumb {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.breadcrumb-inner { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.breadcrumb-inner a { color: var(--navy); }
.breadcrumb-inner a:hover { text-decoration: underline; }
.breadcrumb-inner span { color: var(--text-light); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #323232;
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: none; }
.toast.success { border-left: 4px solid #4caf50; }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--amber); }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #fce4ec; color: var(--red); }
.badge-info { background: #e3f2fd; color: #1565c0; }
.badge-warning { background: #fff8e1; color: #e65100; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
    position: absolute;
    top: calc(var(--header-h) + var(--subheader-h));
    left: 0; right: 0;
    background: var(--navy-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  .header-nav.open { display: flex; }
  .nav-link { padding: 12px 16px; font-size: 15px; }
  .hamburger { display: flex; }
  .btn-register { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .page-hero h1 { font-size: 24px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}