/**
 * ============================================================
 *  Route Modal CSS — Glassmorphism Compact Popup
 *  Trakita "Lihat Rute" Feature
 * ============================================================
 *
 *  - Width: 92%, max-width: 420px
 *  - Border-radius: 20px
 *  - Glassmorphism with rgba(255,255,255,0.95)
 *  - Map preview: 220px height
 *  - Responsive: 320px → 430px
 *  - All classes prefixed .route- to avoid conflicts
 *
 * ============================================================
 */

/* ==================== OVERLAY ==================== */
.route-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 16px;
  box-sizing: border-box;
}
.route-overlay.show {
  display: flex;
}
.route-overlay.route-fade-in {
  animation: routeFadeIn 0.2s ease-out forwards;
}
.route-overlay.route-fade-out {
  animation: routeFadeOut 0.2s ease-in forwards;
}

@keyframes routeFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes routeFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ==================== MODAL CARD ==================== */
.route-card {
  width: 92%;
  max-width: 420px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease-out;
}
.route-overlay.route-fade-in .route-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ==================== HEADER ==================== */
.route-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 10px;
}
.route-header-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.route-header-title {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  flex: 1;
  margin: 0;
  line-height: 1.3;
}
.route-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}
.route-close-btn:active {
  transform: scale(0.9);
  background: #e5e7eb;
}

/* ==================== INFO SECTION ==================== */
.route-info {
  padding: 0 18px 10px;
}
.route-info-name {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 2px;
  line-height: 1.3;
}
.route-info-address {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 8px;
  line-height: 1.4;
}
.route-info-stats {
  display: flex;
  gap: 12px;
}
.route-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  background: #f0fdf4;
  padding: 4px 10px;
  border-radius: 8px;
}
.route-stat-icon {
  font-size: 13px;
}
.route-stat-distance {
  color: #16a34a;
}
.route-stat-duration {
  color: #2563eb;
  background: #eff6ff;
}

/* ==================== LOADING STATE ==================== */
.route-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  margin: 0 18px;
  border-radius: 14px;
  background: #f9fafb;
  gap: 8px;
}
.route-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: routeSpin 0.7s linear infinite;
}
@keyframes routeSpin {
  to { transform: rotate(360deg); }
}
.route-loading-text {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

/* ==================== ERROR STATE ==================== */
.route-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  margin: 0 18px;
  border-radius: 14px;
  background: #fef2f2;
  gap: 6px;
  text-align: center;
  padding: 16px;
  box-sizing: border-box;
}
.route-error-icon {
  font-size: 28px;
}
.route-error-msg {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  color: #991b1b;
  font-weight: 500;
  line-height: 1.4;
}

/* ==================== MAP PREVIEW ==================== */
.route-map-container {
  margin: 0 18px 12px;
  border-radius: 14px;
  overflow: hidden;
  height: 220px;
  position: relative;
  background: #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.route-map-container #routeMiniMap {
  width: 100%;
  height: 100%;
}

/* ==================== BUTTONS ==================== */
.route-buttons {
  padding: 0 18px 16px;
  display: flex;
  gap: 8px;
}
.route-nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  color: white;
  line-height: 1;
}
.route-nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.route-nav-btn:active {
  transform: scale(0.96);
}
.route-nav-btn-primary {
  background: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.route-nav-btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
.route-close-btn-alt {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: white;
  color: #6b7280;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.route-close-btn-alt:active {
  transform: scale(0.96);
  background: #f9fafb;
}

/* ==================== ROUTE BUTTON ON CARD ==================== */
.mp-route-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
  white-space: nowrap;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.mp-route-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.mp-route-btn:active {
  transform: scale(0.95);
}
.mp-route-btn svg {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
}

/* ==================== ROUTE BUTTON ON POPUP ==================== */
.mpp-route-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 6px;
  line-height: 1;
}
.mpp-route-btn:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.mpp-route-btn:active {
  transform: scale(0.98);
}
.mpp-route-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ==================== RESPONSIVE: 320px ==================== */
@media (max-width: 340px) {
  .route-card {
    width: 96%;
    border-radius: 16px;
  }
  .route-header {
    padding: 12px 14px 8px;
  }
  .route-header-title {
    font-size: 14px;
  }
  .route-info {
    padding: 0 14px 8px;
  }
  .route-info-name {
    font-size: 13px;
  }
  .route-info-stats {
    gap: 8px;
  }
  .route-stat {
    font-size: 11px;
    padding: 3px 8px;
  }
  .route-map-container {
    margin: 0 14px 10px;
    height: 180px;
    border-radius: 12px;
  }
  .route-buttons {
    padding: 0 14px 14px;
    gap: 6px;
  }
  .route-nav-btn {
    padding: 10px 12px;
    font-size: 12px;
  }
  .route-close-btn-alt {
    padding: 10px 14px;
    font-size: 12px;
  }
  .mp-route-btn {
    padding: 2px 5px;
    font-size: 8px;
  }
  .mp-route-btn svg {
    width: 8px;
    height: 8px;
  }
}

/* ==================== RESPONSIVE: 360px - 375px ==================== */
@media (min-width: 341px) and (max-width: 390px) {
  .route-map-container {
    height: 200px;
  }
  .mp-route-btn {
    padding: 3px 6px;
    font-size: 8px;
  }
  .mp-route-btn svg {
    width: 8px;
    height: 8px;
  }
}

/* ==================== RESPONSIVE: 390px - 430px ==================== */
@media (min-width: 391px) {
  .route-map-container {
    height: 220px;
  }
  .mp-route-btn {
    padding: 3px 7px;
    font-size: 9px;
  }
  .mp-route-btn svg {
    width: 9px;
    height: 9px;
  }
}

/* ==================== RESPONSIVE: 412px+ ==================== */
@media (min-width: 412px) {
  .route-header-title {
    font-size: 17px;
  }
  .route-info-name {
    font-size: 15px;
  }
  .route-stat {
    font-size: 14px;
  }
}
