/* ==========================================================================
   style.css — Near Riyadh Metro
   ========================================================================== */

/* Google Font - Tajawal */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --green-primary: #1E4D8C;
  --green-light: #EAF1FB;
  --green-hover: #163A6B;
  --dark-text: #1A1A2E;
  --gray-medium: #555566;
  --gray-light: #F5F7FA;
  --white: #FFFFFF;
  --footer-bg: #12284A;

  --line-blue:   #0072BC;
  --line-red:    #ED1C24;
  --line-orange: #F7941D;
  --line-yellow: #FFD700;
  --line-green:  #00A651;
  --line-purple: #92278F;

  --navbar-height: 64px;
  --font: 'Tajawal', sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  color: var(--dark-text);
  background: var(--gray-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  text-decoration: underline;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 4px 20px rgba(0,0,0,0.06);
  /* Metro line accent strip at bottom */
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg,
    #0072BC 0%, #0072BC 16.6%,
    #ED1C24 16.6%, #ED1C24 33.2%,
    #F7941D 33.2%, #F7941D 49.8%,
    #FFD700 49.8%, #FFD700 66.4%,
    #00A651 66.4%, #00A651 83%,
    #92278F 83%, #92278F 100%
  ) 1;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.navbar__logo-text {
  color: var(--green-primary);
  font-weight: 800;
  font-size: 1.25rem;
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.navbar__nav a {
  color: var(--gray-medium);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.navbar__nav a:hover {
  color: var(--green-primary);
  background: var(--green-light);
  text-decoration: none;
}

.navbar__nav a.active {
  color: var(--green-primary);
  background: var(--green-light);
  font-weight: 700;
  text-decoration: none;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

#lang-toggle {
  background: var(--green-light);
  border: 1.5px solid rgba(30,77,140,0.2);
  color: var(--green-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  letter-spacing: 0.5px;
}

#lang-toggle:hover {
  background: #d4e6f9;
  border-color: rgba(30,77,140,0.4);
}

/* Hamburger (mobile) */
.navbar__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--green-primary);
  flex-direction: column;
  gap: 5px;
}

.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--green-primary);
  border-radius: 2px;
  transition: transform 0.2s;
}

/* Mobile nav dropdown */
.navbar__mobile-menu {
  display: none;
  position: absolute;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-direction: column;
  padding: 8px 16px 16px;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 999;
}

.navbar__mobile-menu.open {
  display: flex;
}

.navbar__mobile-menu a {
  color: var(--gray-medium);
  font-size: 1rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.navbar__mobile-menu a:hover,
.navbar__mobile-menu a.active {
  background: var(--green-light);
  color: var(--green-primary);
  font-weight: 600;
}

/* ---------- Main Content Wrapper ---------- */
.page-content {
  flex: 1;
}

/* ---------- HOME PAGE — Filter Bar ---------- */
.filter-bar {
  background: var(--white);
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
  z-index: 100;
  position: relative;
}

.filter-bar__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-medium);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-bar__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-bar__buttons::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #d0d0d0;
  background: var(--white);
  color: var(--dark-text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.filter-btn:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
  background: var(--green-light);
}

.filter-btn.active {
  background: var(--green-primary);
  color: var(--white);
  border-color: var(--green-primary);
}

.filter-btn .filter-icon {
  font-size: 1rem;
}

/* ---------- Walking Time Filter Bar ---------- */
.walk-filter-bar {
  background: var(--white);
  border-bottom: 1px solid #e0e0e0;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.walk-filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-medium);
  white-space: nowrap;
  flex-shrink: 0;
}

.walk-filter-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.walk-filter-buttons::-webkit-scrollbar {
  display: none;
}

.walk-btn {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid #d0d0d0;
  background: var(--white);
  color: var(--dark-text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.walk-btn:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
  background: var(--green-light);
}

.walk-btn.active {
  background: var(--green-primary);
  color: var(--white);
  border-color: var(--green-primary);
}

/* ---------- Map Container ---------- */
.map-wrapper {
  position: relative;
}

#map {
  width: 100%;
  height: calc(100vh - var(--navbar-height) - 56px - 40px);
  min-height: 400px;
  background: #e8e8e8;
}

/* ---------- Map Overlay Notifications ---------- */
.map-notification {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: rgba(26, 26, 46, 0.9);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  pointer-events: none;
  transition: opacity 0.3s;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.map-notification.hidden {
  opacity: 0;
}

/* Loading spinner overlay */
.loading-overlay {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 900;
  background: var(--white);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--dark-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: opacity 0.3s;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e0e0e0;
  border-top-color: var(--green-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Map Legend ---------- */
.map-legend {
  background: rgba(255,255,255,0.93);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  min-width: 160px;
  pointer-events: none;
}

.map-legend h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.8rem;
  color: var(--dark-text);
}

.legend-swatch {
  width: 28px;
  height: 5px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ---------- Leaflet Popup Styles ---------- */
.leaflet-popup-content-wrapper {
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: auto !important;
  min-width: 200px;
  max-width: 300px;
}

.station-popup,
.poi-popup {
  padding: 14px 16px;
}

.station-popup__name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark-text);
  margin-bottom: 6px;
}

.station-popup__lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.line-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
}

.line-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  flex-shrink: 0;
}

.station-popup__nearby {
  font-size: 0.8rem;
  color: var(--gray-medium);
  font-style: italic;
}

.poi-popup__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark-text);
  margin-bottom: 4px;
}

.poi-popup__type {
  font-size: 0.8rem;
  color: var(--gray-medium);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.poi-popup__gmaps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  background: var(--green-primary);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.poi-popup__gmaps:hover {
  background: var(--green-hover);
  text-decoration: none;
  color: var(--white);
}

/* Local data enriched popup */
.poi-popup--local {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.poi-popup__logo {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  border-radius: 10px 10px 0 0;
  background: var(--gray-light);
}

.poi-popup--local .poi-popup__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.poi-popup__rating {
  font-size: 0.82rem;
  color: var(--dark-text);
  font-weight: 600;
}

.poi-popup__reviews {
  font-weight: 400;
  color: var(--gray-medium);
}

.poi-popup__detail {
  font-size: 0.78rem;
  color: var(--gray-medium);
  line-height: 1.4;
}

.poi-popup__detail a {
  color: var(--green-primary);
  text-decoration: none;
}

.poi-popup__detail a:hover {
  text-decoration: underline;
}

.poi-popup__address {
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.poi-popup--local .poi-popup__name {
  margin-bottom: 2px;
}

.poi-popup--local .poi-popup__gmaps {
  margin-top: 6px;
}

/* ---------- About & Contact Pages ---------- */
.page-hero {
  background: var(--green-light);
  border-bottom: 1px solid #d4e6f9;
  color: var(--green-primary);
  padding: 48px 24px 40px;
  text-align: center;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.page-hero p {
  font-size: 1.05rem;
  opacity: 0.8;
}

.page-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px;
}

.page-section p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--dark-text);
  margin-bottom: 20px;
}

.page-section p:last-child {
  margin-bottom: 0;
}

/* ---------- About How-To Section ---------- */
.about-howto {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #e8e8e8;
}

.about-howto__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-text);
  margin-bottom: 24px;
}

.about-howto__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-howto__item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.about-howto__icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--green-light, #f0faf4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  /* DOM order: div first, icon second.
     In LTR we pull icon to the front with order:-1.
     In RTL we leave it as-is (order:0) so icon stays on the right. */
  order: -1;
}

.about-howto__item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark-text);
  margin-bottom: 4px;
}

.about-howto__item p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #555;
  margin: 0;
}

/* RTL: item itself gets dir=rtl OR ancestor has dir=rtl OR body has .rtl */
.about-howto__item[dir=rtl],
[dir=rtl] .about-howto__item,
body.rtl .about-howto__item {
  text-align: right;
}

/* Icon order in RTL: direction:rtl on container means first item is on the RIGHT.
   order:-1 makes icon come first = appears on the RIGHT side of page. */
.about-howto__item[dir=rtl] .about-howto__icon,
[dir=rtl] .about-howto__icon,
body.rtl .about-howto__icon {
  order: -1;
}

/* In RTL, div is second in flow = appears on the LEFT (which is where text body goes) */
.about-howto__item[dir=rtl] > div,
[dir=rtl] .about-howto__item > div,
body.rtl .about-howto__item > div {
  order: 0;
  text-align: right;
}

.about-howto__item[dir=rtl] > div,
[dir=rtl] .about-howto__item > div,
body.rtl .about-howto__item > div {
  text-align: right;
}

[dir=rtl] .about-howto__title,
body.rtl .about-howto__title {
  text-align: right;
}

.about-howto__item--sub {
  margin-left: 20px;
  padding-left: 12px;
  border-left: 2px solid #e8e8e8;
}

.about-howto__item--sub[dir=rtl],
[dir=rtl] .about-howto__item--sub,
body.rtl .about-howto__item--sub {
  margin-left: 0;
  margin-right: 20px;
  padding-left: 0;
  padding-right: 12px;
  border-left: none;
  border-right: 2px solid #e8e8e8;
}

.about-howto__item--heading {
  margin-top: 4px;
  margin-bottom: -4px;
}

/* ---------- Contact Page ---------- */
.contact-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  max-width: 500px;
  margin: 0 auto;
}

.contact-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.contact-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark-text);
}

.contact-card p {
  font-size: 0.95rem;
  color: var(--gray-medium);
  margin-bottom: 24px;
  line-height: 1.6;
}

.contact-email-row {
  background: var(--green-light);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contact-email-row span {
  font-size: 0.85rem;
  color: var(--gray-medium);
}

.contact-email-row a {
  font-weight: 600;
  color: var(--green-primary);
  font-size: 0.95rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green-primary);
  color: var(--white);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 32px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 3px 10px rgba(30,77,140,0.30);
}

.btn-primary:hover {
  background: var(--green-hover);
  text-decoration: none;
  color: var(--white);
  transform: translateY(-1px);
}

/* ---------- Footer ---------- */
footer {
  background: #f8f9fb;
  border-top: 1px solid #e8ecf0;
  color: var(--gray-medium);
  padding: 28px 24px;
  text-align: center;
  margin-top: auto;
}

footer .footer-brand {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-primary);
  margin-bottom: 8px;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

footer .footer-links a {
  color: var(--gray-medium);
  transition: color 0.2s;
}

footer .footer-links a:hover {
  color: var(--green-primary);
  text-decoration: none;
}

footer .footer-copyright {
  font-size: 0.78rem;
  color: #aaa;
}

footer .footer-map-credit {
  font-size: 0.75rem;
  color: #bbb;
  margin-top: 4px;
}

/* ---------- Custom Station Marker ---------- */
.station-marker-wrapper {
  position: relative;
}

/* ---------- Error Toast ---------- */
.error-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  background: #c62828;
  color: var(--white);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  max-width: 90vw;
  text-align: center;
  animation: slideUp 0.3s ease;
}

.error-toast.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar__nav {
    display: none;
  }

  .navbar__hamburger {
    display: flex;
  }

  .navbar__actions {
    margin-left: auto;
  }

  #map {
    height: 60vh;
  }

  .filter-bar {
    padding: 8px 12px;
  }

  .filter-bar__buttons {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-bar__buttons::-webkit-scrollbar {
    display: none;
  }

  .map-legend {
    padding: 6px 10px;
    min-width: 0;
    border-radius: 8px;
  }

  .map-legend h4 {
    font-size: 0.65rem;
    margin-bottom: 5px;
    padding-bottom: 4px;
  }

  .legend-item {
    font-size: 0.68rem;
    gap: 5px;
    margin-bottom: 3px;
  }

  .legend-swatch {
    width: 18px;
    height: 4px;
  }

  .page-hero h1 {
    font-size: 1.5rem;
  }

  .contact-card {
    padding: 28px 20px;
  }

  .page-section {
    padding: 32px 16px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .navbar {
    padding: 0 14px;
  }

  .navbar__logo-text {
    font-size: 0.95rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------- Leaflet MarkerCluster override ---------- */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(30, 77, 140, 0.2) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(30, 77, 140, 0.75) !important;
  color: white !important;
  font-weight: 700;
  font-family: var(--font);
}

/* ---------- Redesigned POI Card ---------- */
.poi-card {
  width: 280px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.poi-card__img-wrap {
  width: 100%;
  height: 120px;
  overflow: hidden;
  flex-shrink: 0;
}

.poi-card__img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.poi-card__body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poi-card__name {
  font-weight: 700;
  font-size: 15px;
  color: #1a1a1a;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.poi-card__cat-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  width: fit-content;
}

.poi-card__rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}

.poi-card__stars {
  display: inline-flex;
  gap: 1px;
}

.star {
  font-size: 14px;
}

.star--full {
  color: #f39c12;
}

.star--half {
  color: #f39c12;
  opacity: 0.7;
}

.star--empty {
  color: #ccc;
}

.poi-card__rating-num {
  font-weight: 700;
  color: #1a1a1a;
  font-size: 13px;
}

.poi-card__review-count {
  color: #888;
  font-size: 12px;
  font-weight: 400;
}

.poi-card__phone {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #555;
}

.poi-card__walk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #1E4D8C;
  background: #EAF1FB;
  border-radius: 20px;
  padding: 3px 8px;
  width: fit-content;
  font-weight: 600;
  white-space: nowrap;
  margin: 3px 0;
}

.poi-card__walk--ar {
  /* Right-aligned: push to the right edge of the card */
  display: flex;
  margin-left: auto;
  margin-right: 0;
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
}

/* Nearest station badge */
.poi-card__station {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  flex-wrap: wrap;
}

.poi-card__station-label {
  font-size: 11px;
  color: #777;
  white-space: nowrap;
  font-family: 'Tajawal', sans-serif;
}

.poi-card__station-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 7px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: 'Tajawal', sans-serif;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.poi-card__phone a {
  color: var(--green-primary);
  text-decoration: none;
}

.poi-card__phone a:hover {
  text-decoration: underline;
}

.poi-card__gmaps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  margin-top: 4px;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.poi-card__gmaps-btn:hover {
  background: #27ae60;
  text-decoration: none;
  color: #fff;
}

/* Make Leaflet popup fit the card properly */
.leaflet-popup-content-wrapper:has(.poi-card) {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 12px !important;
}

/* ---------- Station Detail Panel ---------- */
.station-panel {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  z-index: 2000;
  max-height: 75vh;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.station-panel.open {
  bottom: 0;
}

.station-panel__handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 4px;
  margin: 12px auto 0;
}

.station-panel__header {
  padding: 16px 20px 8px;
}

.station-panel__name {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.station-panel__lines {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.station-panel__categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 20px 24px;
}

.panel-category-btn {
  background: #f5f5f5;
  border: none;
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  transition: all 0.2s;
  color: #1a1a1a;
  text-align: left;
}

.panel-category-btn:hover {
  background: #eee;
  transform: scale(1.02);
}

.panel-category-btn .cat-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.station-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1999;
  display: none;
}

.station-panel-backdrop.open {
  display: block;
}

/* ---------- Search Bar ---------- */
.search-wrapper {
  position: relative;
  margin-bottom: 8px;
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 24px;
  padding: 0 14px;
  height: 42px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: var(--green-primary);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  padding: 0 8px;
  font-family: var(--font);
  color: #1a1a1a;
}

.search-input::placeholder {
  color: #aaa;
}

.search-icon {
  width: 16px;
  height: 16px;
  color: #999;
  flex-shrink: 0;
}

.search-clear {
  border: none;
  background: none;
  cursor: pointer;
  color: #999;
  padding: 4px;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.search-clear:hover {
  color: #555;
}

.search-results {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
}

.search-result-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #f9f9f9;
}

.search-result-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.search-result-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.3;
}

.search-result-sub {
  font-size: 12px;
  color: #888;
  margin-top: 1px;
}

/* ---------- Sort Row ---------- */
.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 8px;
  flex-wrap: wrap;
  width: 100%;
}

.sort-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  flex-shrink: 0;
}

.sort-btn {
  border: 1.5px solid #ddd;
  background: #fff;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  cursor: pointer;
  color: #555;
  font-family: var(--font);
  transition: all 0.2s;
}

.sort-btn:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.sort-btn.active {
  border-color: var(--green-primary);
  color: var(--green-primary);
  font-weight: 600;
  background: var(--green-light);
}

/* ---------- Filter bar layout fix for new elements ---------- */
.filter-bar {
  flex-direction: column;
  align-items: stretch;
}

.filter-bar > .filter-bar__label {
  display: none; /* hidden in favour of search bar */
}

.filter-bar__buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  flex-wrap: nowrap;
}

.filter-bar__buttons::-webkit-scrollbar {
  display: none;
}

/* RTL support for panel */
[dir=rtl] .station-panel__categories {
  direction: rtl;
}

[dir=rtl] .panel-category-btn {
  text-align: right;
}

[dir=rtl] .sort-row {
  direction: rtl;
}

[dir=rtl] .search-input {
  direction: rtl;
}

[dir=rtl] .walk-filter-bar {
  direction: rtl;
}
