/* ─────────────────────────────────────
   Karoo Line — Global Styles
   Palette: Terracotta / Desert / Sky
───────────────────────────────────── */
:root {
  --primary:       #C1440E;
  --primary-dark:  #9A3509;
  --primary-light: #E8622A;
  --secondary:     #1E4E8C;
  --accent:        #E8A830;
  --success:       #2D7D46;
  --danger:        #C1440E;
  --bg:            #FFF8EE;
  --bg-sand:       #F5E6C8;
  --bg-dark:       #1A0F05;
  --text:          #1A0F05;
  --text-muted:    #6B5340;
  --border:        #DDD0B8;
  --radius:        10px;
  --shadow:        0 2px 16px rgba(26,15,5,.08);
  --shadow-lg:     0 8px 40px rgba(26,15,5,.14);
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Typography ── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.5rem); }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ── Layout ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }

/* ── Navbar ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-dark);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.nav-logo {
  color: #fff; font-weight: 800; font-size: 1.25rem;
  letter-spacing: 2px; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.nav-logo span { color: var(--accent); }
/* Nav logo — no background, white version of the SVG */
.nav-logo-img {
  display: flex; align-items: center; text-decoration: none;
  background: transparent;
  padding: 5px 4px;
  height: 48px; transition: opacity .2s;
}
.nav-logo-img:hover { opacity: .72; text-decoration: none; }
/* Invert the SVG to all-white so it reads on the dark navbar */
.nav-logo-img img {
  height: 38px; width: auto; display: block;
  filter: brightness(0) invert(1);
}
/* Footer logo image */
.footer-logo-img { display: block; margin-bottom: 12px; }
.footer-logo-img img { height: 40px; width: auto; filter: brightness(0) invert(1); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  color: rgba(255,255,255,.75); font-size: .9rem; padding: 6px 14px;
  border-radius: 6px; transition: .2s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.nav-cta {
  background: var(--primary); color: #fff !important;
  padding: 8px 20px !important; border-radius: 8px !important;
  font-weight: 600;
}
.nav-cta:hover { background: var(--primary-light) !important; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: .2s; text-decoration: none;
  font-family: var(--font);
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-secondary:hover { background: #163c6e; text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-sand); text-decoration: none; }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }
.btn-sm { padding: 8px 18px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ── Cards ── */
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }

/* ── Form elements ── */
.form-group { margin-bottom: 20px; }
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
input, select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 1rem; font-family: var(--font); background: #fff;
  color: var(--text); transition: border-color .2s;
  appearance: none;
}
select { 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 fill='%236B5340' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(193,68,14,.12); }
input::placeholder, textarea::placeholder { color: #bbb; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 3px 12px;
  border-radius: 20px; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.badge-provisional { background: #FFF3CD; color: #856404; }
.badge-confirmed   { background: #D1FAE5; color: #065F46; }
.badge-cancelled   { background: #FEE2E2; color: #991B1B; }
.badge-activated   { background: #D1FAE5; color: #065F46; }
.badge-refunded    { background: #E0E7FF; color: #3730A3; }

/* ── Alert boxes ── */
.alert {
  padding: 14px 18px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: .9rem;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-info    { background: #EFF6FF; border: 1px solid #93C5FD; color: #1E40AF; }
.alert-success { background: #F0FDF4; border: 1px solid #86EFAC; color: #166534; }
.alert-warning { background: #FFFBEB; border: 1px solid #FCD34D; color: #92400E; }
.alert-danger  { background: #FFF1F2; border: 1px solid #FDA4AF; color: #9F1239; }

/* ── Progress bar ── */
.progress { background: var(--border); border-radius: 20px; height: 12px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; background: var(--primary); transition: width .6s ease; }
.progress-bar.full { background: var(--success); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: var(--bg-sand); padding: 10px 14px; text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); border-bottom: 2px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ── Seat grid ── */
.seat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 280px; margin: 0 auto; }
.seat-btn {
  aspect-ratio: 1; border-radius: 8px; border: 2px solid var(--border);
  background: #fff; cursor: pointer; font-weight: 700; font-size: .9rem;
  transition: .15s; display: flex; align-items: center; justify-content: center;
}
.seat-btn:hover:not(.taken) { border-color: var(--primary); color: var(--primary); }
.seat-btn.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.seat-btn.taken { background: var(--bg-sand); border-color: var(--border); color: var(--border); cursor: not-allowed; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #2C1206 60%, #1E4E8C 100%);
  color: #fff; padding: 100px 24px;
  text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('../images/Karoo Line Bus Photo.jpg') center/cover no-repeat;
  opacity: .25;
}
.hero > * { position: relative; }
.hero h1 { color: #fff; margin-bottom: 20px; }
.hero p { color: rgba(255,255,255,.8); font-size: 1.2rem; max-width: 600px; margin: 0 auto 36px; }
.hero-badge {
  display: inline-block; background: var(--accent); color: var(--bg-dark);
  padding: 5px 18px; border-radius: 20px; font-size: .85rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 20px;
}
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Route timeline ── */
.route-timeline { position: relative; padding-left: 32px; }
.route-timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.stop-item { position: relative; padding: 10px 0 10px 20px; }
.stop-dot {
  position: absolute; left: -28px; top: 14px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); background: #fff;
}
.stop-dot.board { background: var(--primary); border-color: var(--primary); }
.stop-dot.dest  { background: var(--secondary); border-color: var(--secondary); }
.stop-name { font-weight: 600; }
.stop-label { font-size: .75rem; color: var(--text-muted); margin-left: 8px; }

/* ── Footer ── */
.footer { background: var(--bg-dark); color: rgba(255,255,255,.6); padding: 48px 24px 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer h4 { color: #fff; margin-bottom: 16px; font-size: .95rem; letter-spacing: 1px; text-transform: uppercase; }
.footer a { color: rgba(255,255,255,.6); display: block; margin-bottom: 8px; font-size: .9rem; }
.footer a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-logo { font-size: 1.4rem; font-weight: 800; letter-spacing: 3px; color: #fff; margin-bottom: 12px; }
.footer-logo span { color: var(--accent); }

/* .whatsapp-fab is defined in the Animated Icons section below */

/* ── Spinner ── */
.spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-bg.hidden { display: none; }
.modal {
  background: #fff; border-radius: 14px;
  padding: 36px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }

/* ── SVG icon helpers ── */
/* Flat inline icons (feature strips, contact methods, etc.) */
.icon-svg {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-svg svg { display: block; }
/* How-it-works circle icons */
.how-step .icon svg { width: 28px; height: 28px; }
/* Feature list icons */
.feature .icon-svg svg { width: 24px; height: 24px; }
/* Admin sidebar icons */
.nav-item .icon svg { width: 18px; height: 18px; vertical-align: middle; }
/* Contact method icons */
.contact-method .icon svg { width: 28px; height: 28px; }

/* ─────────────────────────────────────
   Animated Icons & Scroll Reveal
───────────────────────────────────── */

/* Keyframes */
@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: .65; }
  70%  { transform: scale(1.65); opacity: 0; }
  100% { transform: scale(1.65); opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes float-sm {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
@keyframes icon-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18) rotate(-5deg); }
  100% { transform: scale(1); }
}
@keyframes bounce-in {
  0%   { transform: translateY(32px) scale(.85); opacity: 0; }
  60%  { transform: translateY(-6px) scale(1.04); opacity: 1; }
  80%  { transform: translateY(3px) scale(.98); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes draw-in {
  from { transform: scale(0) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}
@keyframes shimmer-bg {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes count-flash {
  0%   { color: var(--accent); }
  100% { color: #fff; }
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }
.reveal-d4 { transition-delay: .4s; }
.reveal-d5 { transition-delay: .5s; }
.reveal-d6 { transition-delay: .6s; }

/* ── How-it-Works big animated icons ── */
.how-step-icon-wrap {
  position: relative;
  width: 100px; height: 100px;
  margin: 0 auto 28px;
}
.how-step-icon-wrap .ring {
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 3px solid currentColor;
  opacity: 0;
  animation: pulse-ring 2.8s cubic-bezier(.25,.46,.45,.94) infinite;
}
.how-step-icon-wrap .ring-2 { animation-delay: .93s; }
.how-step-icon-wrap .ring-3 { animation-delay: 1.86s; }
.how-step-icon {
  width: 100px; height: 100px; border-radius: 50%;
  background: #fff;
  border: 3px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
  animation: float 4s ease-in-out infinite;
  position: relative; z-index: 1;
  transition: transform .2s;
}
.how-step-icon svg { width: 46px; height: 46px; }
.how-step-icon-wrap:hover .how-step-icon {
  animation: none;
  transform: scale(1.08);
}

/* ── Feature cards with big icons ── */
.feature-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(26,15,5,.13);
}
.feature-card-icon {
  width: 64px; height: 64px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .3s;
}
.feature-card-icon svg { width: 32px; height: 32px; }
.feature-card:hover .feature-card-icon {
  animation: icon-pop .4s ease;
}
.feature-card h4 { margin-bottom: 4px; font-size: 1.05rem; }
.feature-card p { color: var(--text-muted); font-size: .9rem; margin: 0; line-height: 1.55; }

/* ── Stats bar ── */
.stat-item { text-align: center; }
.stat-num {
  font-size: 3rem; font-weight: 800; display: block;
  line-height: 1; margin-bottom: 6px;
  transition: color .3s;
}
.stat-num.flash { animation: count-flash .4s ease; }

/* ── Contact method big icons ── */
.contact-icon-big {
  width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .3s;
}
.contact-icon-big svg { width: 30px; height: 30px; }
.contact-method:hover .contact-icon-big {
  animation: icon-pop .4s ease;
}

/* ── Animated route stop dots ── */
.stop-row.revealed .stop-index {
  animation: draw-in .35s cubic-bezier(.34,1.56,.64,1) both;
}

/* ── WhatsApp FAB pulse ring ── */
.whatsapp-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: #25D366; color: #fff;
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  transition: transform .2s;
}
.whatsapp-fab::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid #25D366;
  opacity: 0;
  animation: pulse-ring 2.2s ease infinite;
}
.whatsapp-fab svg { width: 30px; height: 30px; fill: #fff; position: relative; z-index: 1; }
.whatsapp-fab:hover { transform: scale(1.1); text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .section { padding: 56px 0; }
  .nav-links .hide-mobile { display: none; }
  .hero { padding: 70px 20px; }
}
@media (max-width: 480px) {
  .nav-links a:not(.nav-cta) { display: none; }
}
