:root {
  --bg-color: #f4f5f7;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text-main: #1f2937;
  --text-sub: #6b7280;
  --border-color: #e5e7eb;
  --warning-bg: #fffbeb;
  --badge-bg: #ededed;
  --warning-border: #f59e0b;
  --nav-height: 60px;
}

html, body, .app-container {
  max-width: 100vw;
  overflow-x: hidden;
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --sidebar-bg: #1e293b;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --border-color: #334155;
  --warning-bg: #451a03;
  --badge-bg: #1e293b;
  --warning-border: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
}

.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
}

.sidebar {
  width: 360px;
  min-width: 320px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 20;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  background: color-mix(in srgb, var(--card-bg) 0%, transparent);
  backdrop-filter: blur(10px) saturate(150%);
}

.sidebar-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  background: var(--bg-color);
  margin-top: -72px;
  padding-top: calc(64px + 16px);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ==========================================================================
   Absolute View Stacking & Slide Transitions
   ========================================================================== */

/* Container utama pembungkus seluruh view */
.main-content {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Setiap view menempati layer penuh */
.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-primary); /* Pastikan background solid agar tidak mentereng/transparan */
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
  will-change: transform, opacity;
  z-index: 1;
}

/* View aktif ditempatkan di paling atas */
.view:not(.hidden) {
  z-index: 2;
}

/* Sembunyikan elemen secara total saat tidak aktif */
.view.hidden {
  display: none !important;
}

/* Transisi Forward (Maju ke Detail) */
.slide-out-left {
  animation: slideOutLeft 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.slide-in-right {
  animation: slideInRight 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Transisi Backward (Mundur ke Home) */
.slide-out-right {
  animation: slideOutRight 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.slide-in-left {
  animation: slideInLeft 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Keyframes Transisi */
@keyframes slideOutLeft {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-70%, 0, 0); opacity: 0.3; }
}

@keyframes slideInRight {
  from { transform: translate3d(100%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@keyframes slideOutRight {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(100%, 0, 0); }
}

@keyframes slideInLeft {
  from { transform: translate3d(-30%, 0, 0); opacity: 0.6; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}

/* ==========================================================================
   App Header & Route Title (Perbaikan 2 Baris & Flex Layout)
   ========================================================================== */
.app-header {
  background: color-mix(in srgb, var(--card-bg) 0%, transparent);
  backdrop-filter: blur(10px) saturate(150%);
  padding: 8px 12px;
  min-height: 64px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-brand-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-left: 8px;
}

.app-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: 8px;
  display: none;
}

.app-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.75px;
  display: flex;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  text-align: left; /* Teks rata kiri terhadap logo */
}

/* Style Micro Tagline */
.app-tagline {
  font-size: 0.725rem; /* Ukuran font lebih kecil */
  color: var(--text-sub);      /* Warna redup/dimmed (sesuaikan dengan tema) */
  font-weight: 400;
  line-height: 1.2;
  margin-top: 2px;
  letter-spacing: normal;
}

/* Kunci tombol Back & Action di ujung kiri/kanan agar posisinya stabil */
#btn-back,
.header-action {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Area Tengah Header */
.header-title {
  flex: 1;
  min-width: 0; /* PENTING: Mengaktifkan pemotongan/wrapping teks di Flexbox */
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-route-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.header-route-container .badge-bus {
  flex-shrink: 0; /* Badge nomor rute tidak boleh tergepengkan */
}

/* Teks nama rute: melipat otomatis maksimal 2 baris */
.header-route-container .route-text {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

input[type="search"] {
  font-size: 16px; /* Mencegah auto-zoom */
  transform: scale(0.875); /* Menyesuaikan tampilan visual agar tampak seukuran ~14px */
  transform-origin: left center;
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-icon:hover {
  background-color: var(--border-color);
}

.view-container {
  padding: 24px;
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 0.95rem;
  margin-bottom: 16px;
  outline: none;
  corner-shape: squircle;
}

.search-input:focus {
  border-color: var(--primary);
}

.route-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
  corner-shape: squircle;
}

.route-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.stop-item-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
  corner-shape: squircle;
}

.stop-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.stop-info {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  justify-content: space-between;
}

.badge-bus {
  background-color: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 8px 8px;
  border-radius: 16px;
  white-space: nowrap;
  min-width: 40px;
  min-height: 40px;
  text-align: center;
  corner-shape: squircle;
  -webkit-border-radius: 12px;
}

.route-info {
  flex: 1;
}

.route-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.route-stops-count {
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* ==========================================================================
   Timeline / Line Map Component
   ========================================================================== */
.timeline-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.timeline-wrapper::-webkit-scrollbar {
  height: 6px;
}

.timeline-wrapper::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 4px;
}

.timeline-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.timeline-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-sub);
}

.timeline {
  position: relative;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
}

.stop-item {
  position: relative;
  padding-bottom: 18px;
}

/* Garis vertikal utama di setiap elemen halte */
.stop-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--active-route-color);
  z-index: 1;
}

.stop-item:first-child::before {
  top: 10px;
}

.stop-item:last-child::before {
  bottom: calc(100% - 10px);
}

.stop-dot-brt {
  position: absolute;
  left: -22px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--card-bg);
  border: 4px solid var(--active-route-color, var(--primary));
  z-index: 2;
}

.stop-dot-nonbrt {
  position: absolute;
  width: 10px;
  height: 4px;
  border-radius: 2px;
  left: -16px;
  top: 8px;
  z-index: 2;
}

.stop-item.is-nonbrt-item:first-child .stop-dot-nonbrt {
  top: 10px;
  left: -24px;
  width: 18px;
}

.stop-item.is-nonbrt-item:last-child .stop-dot-nonbrt {
  top: 10px;
  left: -24px;
  width: 18px;
}

.stop-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.stop-list-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

/* Container Utama Pencarian */
.search-container {
  position: relative;
  margin-bottom: 16px;
}

/* Wrapper Search Box Input & Trigger Dropdown */
.search-box-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px 6px 4px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box-wrapper .search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  margin-bottom: 0;
  box-shadow: none;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
}

/* Tombol Opsi Dropdown di Kanan */
.custom-select-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 6px 8px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.custom-select-trigger:hover {
  background-color: var(--bg-color);
}

.select-chevron {
  transition: transform 0.2s ease;
}

.custom-select-trigger.active .select-chevron {
  transform: rotate(180deg);
}

/* Menu Dropdown Full-Width */
.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 50;
  overflow: hidden;
}

/* Item Pilihan dengan Tap Target yang Nyaman */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px; /* Padding ditingkatkan agar mudah di-tap di mobile */
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: var(--bg-color);
}

/* Tanda Checkmark (✓) */
.check-mark {
  visibility: hidden;
  font-weight: bold;
  color: var(--primary);
  width: 16px;
  text-align: center;
}

.dropdown-item.selected {
  color: var(--text-main);
  background-color: rgba(37, 99, 235, 0.04);
}

.dropdown-item.selected .check-mark {
  visibility: visible;
}

/* Container Detail Halte */
.stop-detail-container {
  margin: 16px;
  padding-top: calc(64px + 16px);
}
.stop-detail-card {
  background: linear-gradient(135deg, #235ac2 0%, #0c3485 100%);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border-color));
  border-radius: 24px;
  padding: 16px;
  display: flex;
  align-items: stretch;
  gap: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 20vh;
  corner-shape: squircle;
}

.stop-detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
}

.stop-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: aliceblue;
  margin: 0;
}

.stop-detail-section {
  padding: 16px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  corner-shape: squircle;
  margin-bottom: 16px;
  overflow-y: auto;
}

.stop-detial-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.stop-detail-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 12px;
}

/* Interaktif Badge Grid untuk Halte Detail */
.route-badge-grid {
  display: flex;
}

.route-badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.route-badge-item:hover {
  transform: translateY(-1px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  corner-shape: squircle;
}

.route-badge-item .badge-bus {
  font-size: 0.875rem;
  border-radius: 16px;
  line-height: 1.5;
  corner-shape: squircle;
  font-weight: 500;
}

.route-badge-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
}

.stop-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  width: fit-content;
}

.badge-brt {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-nonbrt {
  background-color: #f3f4f6;
  color: #374151;
}

[data-theme="dark"] .badge-brt {
  background-color: #1e3a8a;
  color: #93c5fd;
}

[data-theme="dark"] .badge-nonbrt {
  background-color: #374151;
  color: #d1d5db;
}

.transfers-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.transfer-badge {
  font-size: 0.68rem;
  padding: 2px 4px;
  border-radius: 10px;
  color: white;
  background-color: #6b7280;
  min-width: 20px;
  min-height: 20px;
  text-align: center;
  corner-shape: squircle;
  -webkit-border-radius: 8px;
}

.transfer-sbahn { background-color: #008d4f; }
.transfer-ubahn { background-color: #115da8; }
.transfer-bus { background-color: #d90429; }
.transfer-nonbrt, .transfer-jak { 
  background: none;
  color: var(--text-sub); 
}
.transfer-mrt { background-color: #db0000; }
.transfer-krl { background-color: #db6300; }

.collapsible-content {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 0px; /* Menjaga jarak antar badge tetap konsisten */
}
/* Tombol pemicu collapsible */
.btn-toggle-routes {
  background: #f1f3f5;
  color: #495057;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 2px;
}

.btn-toggle-routes:hover {
  background: #e9ecef;
}

/* ==========================================================================
   Table Schedule & Utilities
   ========================================================================== */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: var(--card-bg);
}

.schedule-table th,
.schedule-table td {
  border: 1px solid #ebebeb;
  padding: 8px 12px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-main);
}

.schedule-table th {
  font-weight: 500;
  background-color: var(--card-bg);
}

[data-theme="dark"] .schedule-table th,
[data-theme="dark"] .schedule-table td {
  border-color: var(--border-color);
}

.timetable-container {
  overflow-x: auto;
  margin-bottom: 24px;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Navigation Icons & Bottom Nav
   ========================================================================== */
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.nav-icon svg {
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.nav-item:active .nav-icon svg {
  transform: scale(0.9);
}

.nav-item.active .nav-icon svg {
  stroke: var(--primary);
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 4px;
}

.header-icon svg {
  transition: transform 0.2s ease, stroke 0.2s ease;
}

/* Container Peta & Tombol Expand */
.map-section {
  margin-top: 12px;
}

.btn-map-toggle {
  width: stretch;
  padding: 4px 16px;
  margin: 4px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-map-toggle:hover {
  background-color: var(--surface-hover, #f3f4f6);
}

.icon-toggle-map {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  width: 16px;
}

/* Rotasi panah 180 derajat saat peta terbuka */
.btn-map-toggle.active .icon-toggle-map {
  transform: rotate(-180deg);
}

.map-wrapper {
  margin-top: 10px;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Memastikan Mapbox 1:1 Aspect Ratio */
.mapbox-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #e5e7eb;
}
/* Custom Map Marker Badge */
.map-custom-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.marker-badge {
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  margin-bottom: 4px;
}

.map-custom-marker.start .marker-badge {
  border-left: 3px solid #10b981;
}

.map-custom-marker.end .marker-badge {
  border-left: 3px solid #ef4444;
}

.marker-pin-icon {
  width: 16px; /* Sedikit diperbesar dari 14px agar simbol muat dengan rapi */
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);

  /* Mengetengahkan simbol secara vertikal & horisontal */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 8px;
  line-height: 1;
}

/* Khusus simbol Play (▶), geser 1px ke kanan agar seimbang secara visual */
.map-custom-marker.start .marker-pin-icon {
  background-color: #10b981;
  padding-left: 1px; 
}

.map-custom-marker.end .marker-pin-icon {
  background-color: #ef4444;
}

/* ==========================================================================
   Header Language Switcher
   ========================================================================== */
.btn-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-lang-switcher:hover {
  border-color: var(--primary);
}

.btn-lang-switcher .lang-active {
  color: var(--primary);
}

.btn-lang-switcher .lang-divider {
  color: var(--text-sub);
  opacity: 0.4;
}

/* ==========================================================================
   Info View: First Time Banner & Topics Grid
   ========================================================================== */
.guide-banner-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, color-mix(in srgb, var(--primary) 10%, var(--card-bg)) 100%);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border-color));
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  height: 25vh;
}

.guide-banner-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.guide-banner-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.guide-banner-text {
  flex: 1;
}

.guide-banner-title {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.guide-banner-subtitle {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
}

.guide-banner-arrow {
  color: var(--text-sub);
  display: flex;
  align-items: center;
}

.topics-section {
  margin-top: 8px;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.topic-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.topic-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.topic-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background-color: rgba(var(--primary-rgb, 37, 99, 235), 0.1);
  color: var(--primary, #2563eb);
  margin-bottom: 8px;
}

.topic-modal-icon {
  display: inline-flex;
  align-items: center;
  color: var(--primary, #2563eb);
}

/* ==========================================================================
   Topic Badge Color Variations
   ========================================================================== */

/* 1. Pembayaran (Biru) */
.topic-icon-blue {
  background-color: #eff6ff;
  color: #2563eb;
}

/* 2. Transit (Hijau) */
.topic-icon-green {
  background-color: #ecfdf5;
  color: #059669;
}

/* 3. Halte & Stasiun (Oranye/Amber) */
.topic-icon-amber {
  background-color: #fffbeb;
  color: #d97706;
}

/* 4. MRT/LRT/KRL (Ungu) */
.topic-icon-purple {
  background-color: #f5f3ff;
  color: #7c3aed;
}

/* Penyesuaian Otomatis di Dark Mode */
[data-theme="dark"] .topic-icon-blue {
  background-color: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
}

[data-theme="dark"] .topic-icon-green {
  background-color: rgba(5, 150, 105, 0.18);
  color: #34d399;
}

[data-theme="dark"] .topic-icon-amber {
  background-color: rgba(217, 119, 6, 0.18);
  color: #fbbf24;
}

[data-theme="dark"] .topic-icon-purple {
  background-color: rgba(124, 58, 237, 0.18);
  color: #a78bfa;
}

.developer-contact {
  margin-top: 32px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.dev-title {
  font-size: 0.725rem;
  color: var(--text-sub, #94a3b8);
  margin: 0;
  font-weight: 500;
  opacity: 0.7;
}

.dev-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dev-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-sub, #94a3b8);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s ease, color 0.2s ease;
}

/* Efek saat di-hover/tap */
.dev-link:hover {
  opacity: 1;
  color: var(--primary, #0284c7);
}

.dev-divider {
  font-size: 0.75rem;
  color: var(--text-sub, #94a3b8);
  opacity: 0.4;
}

/* ==========================================================================
   4-Step Guide Modal & Horizontal Scroll Snap
   ========================================================================== */
.guide-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 768px) {
  .guide-modal-overlay {
    align-items: center;
  }
}

.guide-modal-content {
  background-color: var(--card-bg);
  width: 100%;
  max-width: 480px;
  border-radius: 28px 28px 0 0;
  padding: 20px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

@media (min-width: 768px) {
  .guide-modal-content {
    border-radius: 28px;
  }
}

.guide-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.guide-modal-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.guide-slider-wrapper {
  position: relative;
}

.guide-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  padding-bottom: 8px;
}

.guide-slider::-webkit-scrollbar {
  display: none;
}

.guide-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.slide-step {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.slide-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.slide-desc {
  font-size: 0.875rem;
  color: var(--text-sub);
  line-height: 1.5;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.slider-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-color);
  transition: all 0.2s ease;
}

.slider-dots .dot.active {
  width: 24px;
  border-radius: 12px;
  background-color: var(--primary);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ==========================================================================
   Topic Detail Modal Styles
   ========================================================================== */
.topic-modal-content {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.topic-modal-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-modal-icon {
  font-size: 1.3rem;
}

.topic-modal-badge {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.topic-modal-body {
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.topic-modal-body::-webkit-scrollbar {
  width: 4px;
}

.topic-modal-body::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 4px;
}

.topic-info-card {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
}

.topic-info-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.topic-info-desc {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.5;
}

.topic-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.topic-tag {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

/* ==========================================================================
   Desktop Responsive Styles
   ========================================================================== */
@media (min-width: 768px) {
  .bottom-nav, .mobile-only {
    display: none !important;
  }

  .view-container {
    padding: 24px 24px 0px 24px;
    flex: 1;
  }

  /* Sembunyikan header desktop saat di halaman Home */
  .main-content.is-home .app-header {
    display: none;
  }

  .app-header {
    margin: 0px 12px;
  }


  /* Container Empty State */
  .empty-state-container.is-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 32px;
    box-sizing: border-box;
  }

  .empty-state-container {
    display: none;
  }

  /* Wrapper Konten */
  .empty-state-content {
    text-align: center;
    max-width: 360px; /* Supaya teks tidak terlalu melebar */
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Styling Ikon */
  .empty-state-icon {
    color: var(--text-sub, #a0aec0); /* Gunakan warna muted/redup */
    margin-bottom: 16px;
    opacity: 0.6;
  }

  /* Styling Judul & Teks */
  .empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main, #2d3748);
    margin: 0 0 8px 0;
  }

  .empty-state-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-sub, #718096);
    margin: 0;
  }

  .route-detail-container {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 16px;
    height: calc(100vh - 88px);
  }

  .stop-detial-section-header {
    margin-bottom: 16px;
  }

  .map-section {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 172px);
  }
  .map-wrapper {
    height: 100%;
  }
  .mapbox-container {
    width: 100%;
    height: 100%;
  }

}
/* Route Meta Summary Card */
.route-meta-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  margin-bottom: 16px;
  text-align: center;
  corner-shape: squircle;
}

.route-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 16px;

}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.meta-icon {
  width: 16px;
  height: 16px;
  stroke: var(--text-sub);
  margin-bottom: 4px;
}

.meta-icon-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-sub);
  height: 20px;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-bottom: 2px;
}

.meta-value {
  font-size: 0.85rem;
  color: var(--text-main);
}

.floating-nav {
  display: none;
}

/* ==========================================================================
   Mobile Responsive Styles
   ========================================================================== */
@media (max-width: 767px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }

  #empty-state-desktop {
    display: none;
  }

  .sidebar, .desktop-only {
    display: none !important;
  }

  .app-layout {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 0;
  }

  .main-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .app-header {
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

  .view-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + 48px);
    padding-top: calc(64px + 16px);
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
  }

  .floating-nav {
    /* 1. Melayangkan navbar di bawah */
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom)); /* Aman dari Home Indicator iOS */
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;

    /* 2. Layout & Ketinggian */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 4px 12px;
    height: 64px;
    box-sizing: border-box;

    /* 3. Efek Frosted Glass (Kaca Buram) ala iOS */
    background: color-mix(in srgb, var(--card-bg) 0%, transparent);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);

    /* 4. Bentuk Squircle Pill & Shadow Halus */
    border-radius: 999px;
    border: 1px solid var(--border-color); /* Highlight tepi tipis */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08),
                0 2px 6px rgba(0, 0, 0, 0.04);
    gap: 24px;
  }

  /* Kustomisasi Item Aktif */
  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 999px;
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    border: none;
    background: none;
  }

  .nav-item.active {
    background-color: rgba(0, 0, 0, 0.1); /* Indikator aktif kapsul di belakang ikon */
    color: var(--primary);
    font-weight: 600;
    min-width: 5rem;
    height: 100%;
  }

  .nav-icon {
    font-size: 1.2rem;
  }

  .route-badge-grid {
  flex-direction: column;
  }

  .route-meta-card {
    gap: 16px 12px;
  }
  .empty-state-container {
    display: none;
  }
}