/* ============================================
   HAJJ JOURNEY VISUALIZER — DESIGN SYSTEM
   Desert Pilgrimage Editorial
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,700;1,9..144,500&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* Visually hidden — crawlable & screen-reader accessible */
.seo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript-notice {
  max-width: 640px;
  margin: 2rem auto;
  padding: 1.5rem;
  font-family: 'Source Sans 3', sans-serif;
  line-height: 1.6;
  color: #1C1710;
  background: #FEFBF6;
  border: 1px solid rgba(162, 125, 36, 0.25);
  border-radius: 12px;
}

.noscript-notice h1 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.noscript-notice a {
  color: #165343;
}

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

:root {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;

  /* Enhanced Day Palette */
  --gold: #A27D24;                  /* Deeper editorial gold for better day contrast */
  --gold-light: #D4AF5A;
  --gold-bright: #E8C76A;
  --gold-dim: rgba(162, 125, 36, 0.18);
  --emerald: #165343;               /* Tighter contrast emerald */
  --emerald-soft: rgba(22, 83, 67, 0.08);
  --emerald-bright: #2A8C6E;

  --card-bg: rgba(254, 251, 246, 0.98);
  --card-surface: rgba(255, 255, 255, 0.85);
  --card-text: #1C1710;
  --card-text-secondary: #382F20;
  --card-text-muted: #665844;
  --card-border: rgba(162, 125, 36, 0.25);
  --page-bg: #e1d29b;
  --page-bg-deep: #E2D4BF;
  --night: #14110E;

  /* Warm Day Glassmorphism variables */
  --glass-bg: rgba(255, 253, 248, 0.78);
  --glass-border: rgba(162, 125, 36, 0.22);
  --glass-shadow: 0 8px 32px rgba(30, 24, 16, 0.06);

  --radius-sm: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-soft: 0 3px 14px rgba(30, 24, 16, 0.05);
  --shadow-glow: 0 8px 28px rgba(162, 125, 36, 0.16);
  --shadow-card: 0 16px 48px rgba(30, 24, 16, 0.12);
  --transition: 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.45s cubic-bezier(0.34, 1.45, 0.64, 1);
  --card-height-mobile: 260px;
  --card-height-desktop: 300px;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--card-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === MAP CONTAINER === */
#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Soft overlay to blend map edges with UI */
.map-overlay {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(252, 248, 242, 0.28) 0%, transparent 22%, transparent 72%, rgba(252, 248, 242, 0.32) 100%),
    radial-gradient(ellipse at 50% 100%, rgba(26, 92, 75, 0.06) 0%, transparent 55%);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#header,
#progress-track,
#station-panel,
#swipe-hint {
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

body.map-immersive #header {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-110%);
}

body.map-immersive #progress-track {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-120%);
}

body.map-immersive #station-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(110%);
}

body.map-immersive #swipe-hint {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.map-immersive .map-overlay {
  opacity: 0;
}

/* === MAP CHROME HEADER === */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 8px 10px 10px;
  background: linear-gradient(to bottom, rgba(239, 230, 216, 0.88), rgba(239, 230, 216, 0.45) 65%, transparent);
  pointer-events: none;
}

.map-chrome {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px 10px;
  background: var(--card-bg);
  border: 1px solid rgba(28, 23, 16, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
}

.map-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(28, 23, 16, 0.1);
  border-radius: var(--radius-sm);
  background: var(--card-surface);
  color: var(--card-text-secondary);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.map-back-btn:hover {
  border-color: rgba(28, 23, 16, 0.16);
  background: #fff;
  color: var(--card-text);
}

.map-back-btn:active {
  transform: none;
}

.map-back-icon {
  font-size: 14px;
  line-height: 1;
}

.map-chrome-center {
  min-width: 0;
  text-align: center;
}

#route-indicator {
  width: 100%;
  margin: 0;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--card-text-muted);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visitor-count-compact {
  font-size: 9px;
  padding: 4px 8px;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  color: var(--card-text-muted);
  background: var(--card-surface);
  border: 1px solid rgba(28, 23, 16, 0.08);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#route-indicator strong {
  color: var(--card-text);
  font-weight: 700;
}

.visitor-count {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--emerald);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(184, 146, 46, 0.3);
  border-radius: 999px;
  padding: 5px 12px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

/* === PROGRESS TRACK === */
#progress-track {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid rgba(28, 23, 16, 0.08);
  border-radius: var(--radius-lg);
  padding: 7px 14px;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: var(--shadow-soft);
}
#progress-track::-webkit-scrollbar { display: none; }

.prog-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(28, 23, 16, 0.08);
  border: 1px solid rgba(28, 23, 16, 0.14);
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  cursor: pointer;
  position: relative;
}

.prog-dot::after {
  content: attr(data-label);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--card-text-secondary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  background: var(--card-bg);
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(28, 23, 16, 0.08);
  box-shadow: var(--shadow-soft);
  transform: translateX(-50%) translateY(4px);
}

.prog-dot:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.prog-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: none;
  transform: scale(1.15);
}

.prog-dot.completed {
  background: rgba(162, 125, 36, 0.35);
  border-color: var(--gold);
}

.prog-line {
  width: 24px;
  height: 2px;
  background: rgba(28, 23, 16, 0.1);
  flex-shrink: 0;
  transition: var(--transition);
}

.prog-line.completed {
  background: rgba(162, 125, 36, 0.35);
}

/* === STATION CARD (Bottom Sheet) === */
#station-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0 10px 8px;
}

.card-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.station-card {
  background: var(--card-bg);
  border: 1px solid rgba(28, 23, 16, 0.08);
  border-radius: var(--radius-xl);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease, transform 0.35s ease;
  color: var(--card-text);
}

.station-card:not(.is-expanded) {
  background: rgba(252, 248, 242, 0.92);
  border-color: rgba(28, 23, 16, 0.08);
  box-shadow: var(--shadow-soft);
}

.station-card:not(.is-expanded) .card-accent {
  height: 0;
  opacity: 0;
}

.station-card.is-expanded {
  box-shadow: var(--shadow-soft);
  border-color: rgba(28, 23, 16, 0.1);
}

/* Card drag handle */
.card-handle {
  display: none;
}

/* Card accent top border */
.card-accent {
  height: 2px;
  width: 100%;
  background: var(--gold);
}

.card-body {
  padding: 0;
}

.card-bar-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.station-card:not(.is-expanded) .card-bar-row {
  align-items: center;
}

.card-mode-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: background 0.25s ease;
}

.station-card:not(.is-expanded) .card-mode-bar {
  justify-content: flex-start;
  padding: 8px 12px;
  gap: 10px;
}

.station-card:not(.is-expanded) .card-mode-action {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
}

.station-card.is-expanded .card-mode-bar {
  background: transparent;
  border-bottom: 1px solid rgba(28, 23, 16, 0.08);
}

.station-card.is-expanded .nav-bar-btn {
  display: none !important;
}

.card-mode-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  background: rgba(28, 23, 16, 0.06);
  transition: width 0.25s, height 0.25s, font-size 0.25s;
}

.card-mode-icon.is-dual-icon {
  width: auto;
  min-width: 36px;
  padding: 0 4px;
  font-size: 14px;
  white-space: nowrap;
}

.station-card:not(.is-expanded) .card-mode-icon {
  width: 32px;
  height: 32px;
  font-size: 16px;
  border-radius: var(--radius-sm);
}

.station-card:not(.is-expanded) .card-mode-icon.is-dual-icon {
  width: auto;
  min-width: 36px;
  padding: 0 4px;
  font-size: 14px;
}

.station-card:not(.is-expanded) .card-mode-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-mode-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--card-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-mode-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--card-text-muted);
}

.card-mode-bar svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.station-card.is-expanded .card-mode-bar svg {
  transform: rotate(180deg);
}

.card-expanded-content {
  display: none;
  max-height: min(340px, 52vh);
  overflow: hidden;
  flex-direction: column;
}

.station-card.is-expanded .card-expanded-content {
  display: flex;
  animation: cardExpandIn 0.28s ease-out;
}

.card-expanded-top {
  flex-shrink: 0;
  padding: 12px 14px 0;
}

.card-expanded-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px 14px;
}

.card-expanded-scroll::-webkit-scrollbar {
  width: 4px;
  display: block;
}

.card-expanded-scroll::-webkit-scrollbar-thumb {
  background: rgba(28, 23, 16, 0.15);
  border-radius: 2px;
}

@keyframes cardExpandIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Station header */
.station-header {
  margin-bottom: 8px;
}

.station-title-group { flex: 1; min-width: 0; }

.station-icon-wrap {
  display: none;
}

.station-day-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 20px;
  margin-bottom: 3px;
  background: rgba(28, 23, 16, 0.06);
  color: var(--card-text-muted);
}

.station-name {
  display: none;
}

.station-arabic {
  display: none;
}

.station-ritual-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--card-surface);
  border: 1px solid rgba(28, 23, 16, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.station-ritual-badge .ritual-label {
  font-size: 9px;
  color: var(--card-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.station-ritual-badge .ritual-value {
  font-size: 12px;
  color: var(--card-text);
  font-weight: 600;
}

.station-ritual-badge .ritual-duration {
  margin-left: auto;
  font-size: 10px;
  color: var(--card-text-secondary);
}

.station-description {
  font-size: 12px;
  line-height: 1.55;
  color: var(--card-text-secondary);
  margin-bottom: 10px;
  margin-top: 0;
}

.infographic-section-label {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: var(--card-text-muted);
}

#station-transport-section {
  margin-bottom: 8px;
}

#station-transport-section .infographic-section-label {
  margin-top: 4px;
}

#station-transport-section .arrival-transport-list + .infographic-section-label {
  margin-top: 10px;
}

/* Facts grid */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.fact-item {
  background: var(--card-surface);
  border: 1px solid rgba(28, 23, 16, 0.08);
  border-radius: 8px;
  padding: 7px 5px;
  text-align: center;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fact-label {
  font-size: 8px;
  color: var(--card-text-muted);
  letter-spacing: 0.25px;
  text-transform: uppercase;
  line-height: 1.25;
  margin-bottom: 3px;
  order: -1;
}

.fact-value {
  font-size: 10px;
  font-weight: 700;
  color: var(--card-text);
  line-height: 1.3;
  word-break: break-word;
}

/* Arrival transfer options (Continue to Mecca card) */
.arrival-transport-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.arrival-transport-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 7px;
  background: var(--card-surface);
  border: 1px solid rgba(28, 23, 16, 0.08);
  border-radius: 8px;
}

.arrival-transport-icon {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.2;
}

.arrival-transport-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.arrival-transport-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--card-text);
  line-height: 1.25;
}

.arrival-transport-note {
  font-size: 9px;
  line-height: 1.35;
  color: var(--card-text-muted);
}

.arrival-transport-time {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  color: var(--card-text-secondary);
  white-space: nowrap;
  padding-top: 1px;
}

.arrival-translation-warning {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  font-style: normal;
  color: var(--card-text-muted);
}

.card-expanded-scroll .quranic-verse strong {
  font-size: 10px;
  font-weight: 600;
}

/* Quranic verse */
.quranic-verse {
  font-family: var(--font-body);
  font-size: 11px;
  font-style: italic;
  color: var(--card-text-muted);
  text-align: center;
  background: rgba(28, 23, 16, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid rgba(28, 23, 16, 0.06);
  line-height: 1.55;
}

/* === NAVIGATION CONTROLS === */
.nav-counter-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 0;
  border-top: 1px solid rgba(28, 23, 16, 0.08);
  margin-top: 10px;
}

.nav-bar-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 6px 4px;
  min-height: 44px;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  color: var(--card-text-secondary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.nav-bar-btn:hover:not(:disabled) {
  color: var(--card-text);
}

.nav-bar-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-bar-btn-arrow {
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.8;
}

.station-card:not(.is-expanded) .nav-bar-btn {
  align-self: center;
}

.card-actions {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.nav-counter {
  pointer-events: all;
  font-size: 11px;
  color: var(--card-text-muted);
  font-weight: 500;
  background: var(--card-surface);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(28, 23, 16, 0.08);
  white-space: nowrap;
}

/* === MAP CUSTOM MARKER === */
.hajj-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
  transition: transform 0.2s;
  cursor: pointer;
}

.hajj-marker.active-marker {
  animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.15) translateY(-3px); }
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
  background: var(--card-bg) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 12px !important;
  color: var(--card-text) !important;
  box-shadow: 0 4px 20px rgba(44, 34, 19, 0.12) !important;
}
.leaflet-popup-tip { background: var(--card-bg) !important; }
.leaflet-popup-content { margin: 8px 12px !important; font-family: var(--font-body); }
.popup-name { font-size: 12px; font-weight: 700; color: var(--gold); margin-bottom: 2px; }
.popup-ritual { font-size: 10px; color: var(--card-text-secondary); }

/* Hide default leaflet attribution branding */
.leaflet-control-attribution { opacity: 0.4 !important; }

/* === CARD SLIDE ANIMATION === */
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideLeft {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideRight {
  from { transform: translateX(-60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.card-anim-in { animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.card-anim-left { animation: slideLeft 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.card-anim-right { animation: slideRight 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* === INTRO OVERLAY === */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px 48px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.intro-lattice-overlay,
.intro-glow {
  display: none;
}

#intro-overlay > * {
  position: relative;
  z-index: 1;
}

#intro-overlay::-webkit-scrollbar {
  display: block;
  width: 6px;
}

#intro-overlay::-webkit-scrollbar-thumb {
  background: rgba(162, 125, 36, 0.3);
  border-radius: 3px;
}

#intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

.intro-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.intro-top-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  animation: introFadeUp 0.7s ease both;
}

.intro-hero {
  text-align: center;
  padding: 12px 0 8px;
  animation: introFadeUp 0.7s 0.08s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

.intro-tagline {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--card-text-muted);
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.intro-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid rgba(28, 23, 16, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  animation: introFadeUp 0.7s 0.16s ease both;
}

.intro-step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--card-text-muted);
  margin: 0;
}

.intro-header {
  text-align: center;
  margin-bottom: 4px;
  z-index: 2;
  animation: introFadeUp 0.7s ease both;
}

.intro-kaaba {
  font-size: 72px;
  line-height: 1;
}

.intro-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--card-text);
  text-align: center;
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.intro-arabic {
  font-family: var(--font-arabic);
  font-size: 34px;
  color: var(--card-text-secondary);
  text-align: center;
  margin-top: 4px;
}

.intro-sub {
  font-size: 14.5px;
  color: var(--card-text-secondary);
  text-align: center;
  max-width: none;
  line-height: 1.6;
  margin: 0;
}

.intro-sub strong {
  color: var(--card-text);
  font-weight: 700;
}

.intro-verse {
  display: block;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13.5px;
  color: var(--card-text-muted);
  text-align: center;
  margin: 12px 16px;
  line-height: 1.6;
  animation: introFadeUp 0.7s 0.32s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

.intro-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-bottom: 8px;
  animation: introFadeUp 0.7s 0.4s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

.intro-footer-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--card-text-secondary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.intro-footer-link:hover {
  color: var(--card-text);
}

.intro-other-app {
  font-size: 11px;
  color: var(--card-text-muted);
  text-align: center;
  max-width: 340px;
  line-height: 1.55;
  margin: 0;
}

.intro-other-app a {
  color: var(--card-text-secondary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.intro-other-app a:hover {
  color: var(--card-text);
}

.intro-copyright {
  font-size: 10px;
  color: var(--card-text-muted);
  text-align: center;
  margin: 0;
}

@keyframes introFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-mode-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--card-text);
  text-align: center;
  margin: 0;
  letter-spacing: 0.1px;
}

.mode-select-container {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  flex-shrink: 0;
  z-index: 2;
}

.mode-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--card-surface);
  border: 1px solid rgba(28, 23, 16, 0.1);
  border-radius: var(--radius-lg);
  color: var(--card-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: none;
}

.mode-option-btn:hover {
  background: #fff;
  border-color: rgba(28, 23, 16, 0.16);
}

.mode-option-btn.is-selected {
  background: #fff;
  border-color: var(--gold);
  box-shadow: none;
}

[dir="rtl"] .mode-option-btn.is-selected {
  border-color: var(--gold);
}

.mode-emoji {
  font-size: 20px;
  background: rgba(28, 23, 16, 0.05);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mode-btn-name {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--card-text);
}

.mode-btn-desc {
  font-size: 11px;
  color: var(--card-text-muted);
  line-height: 1.35;
}

.miqat-select-container {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  flex-shrink: 0;
  z-index: 2;
}

.miqat-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card-surface);
  border: 1px solid rgba(28, 23, 16, 0.1);
  border-radius: var(--radius-lg);
  color: var(--card-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: none;
}

.miqat-option-btn:hover {
  background: #fff;
  border-color: rgba(28, 23, 16, 0.16);
}

.miqat-emoji {
  font-size: 22px;
  background: rgba(28, 23, 16, 0.05);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.miqat-btn-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--card-text);
  font-family: var(--font-display);
}

.miqat-btn-desc {
  font-size: 11px;
  color: var(--card-text-muted);
  line-height: 1.4;
}

.miqat-action-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: none;
  border-radius: var(--radius-lg);
  color: #FFFDF9;
  font-size: 14.5px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(162, 125, 36, 0.22);
  transition: all var(--transition-spring);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.miqat-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(184, 146, 46, 0.45);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.miqat-action-btn:active {
  transform: translateY(0);
}

.intro-lang-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  background: var(--card-surface);
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(28, 23, 16, 0.08);
  z-index: 2;
}

.intro-lang-wrap label {
  color: var(--card-text-muted) !important;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.intro-lang-wrap .lang-dropdown {
  flex: 1;
  min-width: 0;
  background: #fff;
  color: var(--card-text);
  border: 1px solid rgba(28, 23, 16, 0.1);
}

.intro-lang-wrap .lang-dropdown:hover,
.intro-lang-wrap .lang-dropdown:focus {
  border-color: rgba(28, 23, 16, 0.2);
}

#intro-overlay .visitor-count {
  color: var(--card-text-muted);
  background: var(--card-surface);
  border: 1px solid rgba(28, 23, 16, 0.08);
  box-shadow: none;
}

@media (max-height: 700px), (max-width: 480px) {
  #intro-overlay {
    padding: 14px 12px 28px;
  }

  .intro-shell {
    gap: 14px;
  }

  .intro-step {
    padding: 12px;
  }

  .intro-kaaba {
    font-size: 52px;
  }

  .intro-arabic {
    font-size: 26px;
  }

  .intro-title {
    font-size: 22px;
  }

  .intro-sub {
    font-size: 13px;
  }

  .map-back-label {
    display: none;
  }

  .map-back-btn {
    padding: 0 10px;
  }

  .visitor-count-compact {
    display: none;
  }

  .map-chrome {
    grid-template-columns: auto 1fr;
  }
}

[dir="rtl"] .map-back-icon {
  transform: scaleX(-1);
}

[dir="rtl"] .map-chrome {
  direction: rtl;
}

/* === TOAST HINT === */
#swipe-hint {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  background: rgba(252, 248, 242, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--card-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  animation: hintFade 3s ease 1s both;
  pointer-events: none;
}

@keyframes hintFade {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* === DESKTOP LAYOUT (≥ 768px) === */
@media (min-width: 768px) {
  #station-panel {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: auto;
    transform: none;
    padding: 0;
    width: 340px;
  }

  .card-wrapper { max-width: 340px; }

  #progress-track { top: 56px; }
  #swipe-hint { bottom: 40px; }

  .map-chrome {
    max-width: 560px;
  }

  .visitor-count-compact {
    max-width: 120px;
    font-size: 10px;
  }

  .station-description { font-size: 12px; }

  .station-card.is-expanded .card-expanded-content {
    max-height: min(360px, 55vh);
  }
}

/* === SCROLLBAR HIDE === */
::-webkit-scrollbar { display: none; }

.mode-btn-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.miqat-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-start-container {
  width: 100%;
  max-width: none;
  margin: 0;
  z-index: 2;
}

.history-start-container .miqat-action-btn {
  width: 100%;
}

/* === SUPPORT SYSTEM === */
.support-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 15;
  padding: 10px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  transition: bottom 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.support-fab.support-fab-raised {
  bottom: 72px;
}

.support-fab:hover {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-glow);
}

/* Modal styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(239, 230, 216, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-glow), 0 8px 28px rgba(44, 34, 19, 0.08);
  text-align: center;
  position: relative;
  animation: scaleUp 0.35s cubic-bezier(0.34, 1.45, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: var(--card-text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--card-text);
}

.modal-heart {
  font-size: 36px;
  margin-bottom: 12px;
  color: var(--gold);
  animation: heartBeat 1.8s infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.modal-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
}

.support-modal-desc {
  font-size: 13px;
  color: var(--card-text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.contact-modal-card {
  text-align: left;
}

.contact-modal-card .modal-heart {
  text-align: center;
}

.contact-modal-desc {
  font-size: 13px;
  color: var(--card-text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.contact-form-fields label {
  font-size: 11px;
  font-weight: 600;
  color: var(--card-text-secondary);
}

.contact-textarea {
  resize: vertical;
  min-height: 88px;
}

.pledge-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.pledge-btn {
  padding: 8px;
  background: var(--card-surface);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 10px;
  color: var(--card-text-secondary);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.pledge-btn:hover {
  border-color: var(--gold);
  color: var(--card-text);
}

.pledge-btn.active {
  background: rgba(184, 146, 46, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}

.card-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.support-input {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 8px;
  color: var(--card-text);
  font-size: 12px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}

.support-input:focus {
  border-color: var(--gold);
}

.submit-support-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--gold), #967420);
  border: none;
  border-radius: var(--radius-sm);
  color: #FFFBF5;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.submit-support-btn:hover {
  opacity: 0.9;
}

.support-success-msg {
  background: var(--emerald-soft);
  border: 1px solid rgba(184, 146, 46, 0.28);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: var(--emerald);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

/* === INFOGRAPHIC UPGRADES === */
.fact-item {
  box-shadow: none;
}

.fact-item:hover {
  border-color: rgba(28, 23, 16, 0.14);
  transform: none;
}

#miqat-action-container,
#arrival-action-container,
#restart-action-container {
  margin-top: 0 !important;
  width: 100%;
}

.miqat-travel-mode {
  margin-bottom: 8px;
}

.miqat-travel-mode-label {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--card-text-muted);
}

.miqat-travel-mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.miqat-travel-option {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-height: 44px;
  padding: 7px 8px;
  background: var(--card-surface);
  border: 1px solid rgba(28, 23, 16, 0.1);
  border-radius: 8px;
  color: var(--card-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.miqat-travel-option.is-selected {
  background: #fff;
  border-color: var(--gold);
  box-shadow: none;
}

.miqat-travel-emoji {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.2;
}

.miqat-travel-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.miqat-travel-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--card-text);
  line-height: 1.25;
}

.miqat-travel-desc {
  font-size: 8px;
  line-height: 1.35;
  color: var(--card-text-muted);
}

[dir="rtl"] .miqat-travel-option {
  text-align: right;
}

.station-card .miqat-action-btn {
  padding: 10px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: var(--card-text);
  color: #fff;
  box-shadow: none;
}

.station-card .miqat-action-btn:hover {
  background: #2a2318;
  transform: none;
  box-shadow: none;
}

/* Hide leaflet controls a bit more elegantly */
.leaflet-left .leaflet-control {
  margin-left: 20px !important;
}
.leaflet-bottom .leaflet-control {
  margin-bottom: 20px !important;
}

/* Desktop spacing adaptation for support button */
@media (min-width: 768px) {
  .support-fab {
    bottom: 24px;
    left: 24px;
  }
}

/* === LANGUAGE SELECTOR STYLES === */
.lang-dropdown {
  background: rgba(255, 255, 255, 0.92);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lang-dropdown:focus, .lang-dropdown:hover {
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-dim);
}

/* === HAJJ PATH STYLING === */
.hajj-path-miqat {
  stroke: var(--gold-light);
  stroke-width: 4.5;
  stroke-dasharray: 8, 10;
  stroke-linecap: round;
  opacity: 0.9;
  transition: opacity var(--transition), stroke var(--transition);
}

.hajj-path-completed {
  stroke: var(--gold);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  transition: opacity var(--transition), stroke-width var(--transition);
}

.hajj-path-active {
  stroke: var(--gold-light);
  stroke-width: 5;
  stroke-dasharray: 8, 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
  animation: dashOffsetActive 1.8s linear infinite;
  transition: opacity var(--transition), stroke-width var(--transition);
}

.hajj-path-pending {
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-dasharray: 4, 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.2;
  transition: opacity var(--transition);
}

@keyframes dashOffsetActive {
  from {
    stroke-dashoffset: 36;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* === HAJJ PATH BADGE STYLING === */
.hajj-path-badge-wrap {
  background: transparent;
  border: none;
}

.hajj-path-badge {
  position: relative;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  background: rgba(252, 248, 242, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(184, 146, 46, 0.32);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
  font-family: var(--font-body);
  letter-spacing: 0;
  z-index: 500;
  min-width: 120px;
}

.hajj-path-badge-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  padding: 6px 9px;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.hajj-path-badge-trigger:active {
  background: rgba(201, 168, 76, 0.1);
}

.hajj-path-badge-label {
  flex: 1;
  min-width: 0;
}

.hajj-path-badge-chevron {
  flex-shrink: 0;
  font-size: 7px;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.hajj-path-badge.is-open .hajj-path-badge-chevron {
  transform: rotate(180deg);
}

.hajj-path-transport-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 3px;
  border-top: 1px solid rgba(201, 168, 76, 0.15);
}

.hajj-path-badge.is-open .hajj-path-transport-menu {
  display: flex;
}

.hajj-path-transport-option {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  margin: 0;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--card-text-secondary);
  font-size: 8px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.hajj-path-transport-option:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: rgba(201, 168, 76, 0.2);
}

.hajj-path-transport-option.is-selected {
  background: rgba(201, 168, 76, 0.16);
  border-color: rgba(201, 168, 76, 0.28);
  color: var(--card-text);
}

.hajj-path-badge.active-badge {
  border-color: var(--gold);
  color: var(--card-text);
  box-shadow: 0 1px 8px rgba(201, 168, 76, 0.15);
}

.hajj-path-badge.completed-badge {
  opacity: 0.7;
  border-color: rgba(201, 168, 76, 0.15);
}

.hajj-path-badge.pending-badge {
  opacity: 0.5;
  border-color: rgba(201, 168, 76, 0.1);
}



