/* ── City Selection Modal — Premium Two-Panel Design ── */

/* Overlay */
.city-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 14, 30, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: cpmFadeIn 0.22s ease-out both;
}

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

/* Modal Shell */
.city-modal {
  display: flex;
  width: min(920px, 95vw);
  max-height: min(88vh, 680px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.07),
    0 20px 60px rgba(0,0,0,0.28),
    0 0 0 1px rgba(255,255,255,0.06);
  animation: cpmSlideUp 0.28s cubic-bezier(0.34,1.3,0.64,1) both;
}

@keyframes cpmSlideUp {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── Left Branded Panel ── */
.cpm-left {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(158deg, #0d1b3e 0%, #132254 40%, #0e3060 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}

/* Decorative circles */
.cpm-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cpm-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
}

.cpm-circle.c1 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: -80px;
  right: -80px;
}

.cpm-circle.c2 {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, #818cf8, transparent 70%);
  bottom: -40px;
  left: -50px;
  opacity: 0.16;
}

.cpm-circle.c3 {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, #60a5fa, transparent 70%);
  bottom: 120px;
  right: 10px;
  opacity: 0.1;
}

/* Left inner content */
.cpm-left-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cpm-logo-box {
  width: 48px;
  height: 48px;
  background: rgba(59,130,246,0.22);
  border: 1px solid rgba(59,130,246,0.35);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #93c5fd;
  margin-bottom: 4px;
}

.cpm-brand-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #60a5fa;
}

.cpm-headline {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.22;
  color: #fff;
  margin: 0;
  letter-spacing: -0.5px;
}

.cpm-tagline {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.58);
  line-height: 1.55;
  margin: 0;
}

/* Stats row */
.cpm-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px 16px;
}

.cpm-stat {
  flex: 1;
  text-align: center;
}

.cpm-stat strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.cpm-stat span {
  display: block;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cpm-vr {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
}

/* ── Right Content Panel ── */
.cpm-right {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Right header */
.cpm-right-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 18px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  gap: 16px;
}

.cpm-right-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 3px;
  letter-spacing: -0.3px;
}

.cpm-right-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0;
}

/* Close button */
.close-modal {
  background: #f1f5f9;
  border: none;
  color: #64748b;
  cursor: pointer;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.2s ease;
}

.close-modal:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

/* Scrollable body */
.city-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 28px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.city-modal-body::-webkit-scrollbar { width: 5px; }
.city-modal-body::-webkit-scrollbar-track { background: transparent; }
.city-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}

/* ── Search ── */
.city-search-container {
  position: relative;
  margin-bottom: 22px;
}

.cpm-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.city-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 16px 11px 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.83rem;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.city-search-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.city-search-input::placeholder { color: #b0bec5; }

/* ── Section Headers ── */
.city-section {
  margin-bottom: 22px;
}

.cpm-sec-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.cpm-sec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #64748b;
}

/* ── Popular City Cards ── */
.city-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.city-card {
  background: #fff;
  border: 1.5px solid #e9eef5;
  border-radius: 12px;
  padding: 14px 8px 12px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  position: relative;
  overflow: hidden;
}

.city-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--ci, #3b82f6), var(--ci2, #1d4ed8));
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
}

.city-card:hover {
  border-color: var(--ci, #3b82f6);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--ci, #3b82f6) 22%, transparent);
  transform: translateY(-2px);
}

.city-card:hover::after { opacity: 0; }

.city-icon {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ci, #3b82f6), var(--ci2, #1d4ed8));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ci, #3b82f6) 35%, transparent);
}

.city-card:hover .city-icon { transform: scale(1.1) rotate(-4deg); }

.city-name {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.city-card:hover .city-name { color: #fff; }

/* ── More Cities Pill List ── */
.city-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.city-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.city-item:hover {
  color: #475569;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .cpm-left { display: none; }

  .city-modal {
    width: min(480px, 96vw);
    max-height: min(92vh, 640px);
    border-radius: 20px;
  }

  .city-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .city-modal {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .city-modal-body { padding: 16px 18px 24px; }
  .cpm-right-head  { padding: 18px 18px 14px; }

  .city-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
