/* ==========================================================================
   Landing Page Modal / Destination Selector & City Management
   ========================================================================== */
#landingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 44px 16px 48px 16px;
  color: white;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#landingOverlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.close-landing-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}

.close-landing-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.04);
}

.landing-header {
  text-align: center;
  max-width: 680px;
  margin-bottom: 28px;
}

.landing-header h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #fed7aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-header p {
  font-size: clamp(0.85rem, 3vw, 1rem);
  color: #94a3b8;
  line-height: 1.5;
}

.destination-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  max-width: 1040px;
  width: 100%;
  margin-bottom: 24px;
}

.dest-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 22px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
  position: relative;
}

.dest-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  box-shadow: 0 20px 30px -10px rgba(234, 88, 12, 0.3);
}

.dest-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.6;
  z-index: 10;
}

.dest-delete-btn:hover {
  opacity: 1;
  background: #ef4444;
  color: white;
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

.dest-flag { font-size: 2.2rem; line-height: 1; }
.dest-title { font-size: 1.2rem; font-weight: 800; color: #ffffff; }
.dest-subtitle { font-size: 0.8rem; color: #94a3b8; line-height: 1.4; flex: 1; }

.dest-stats-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.dest-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fed7aa;
}

.dest-fav-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.dest-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 4px;
  text-align: center;
  transition: background 0.2s;
}

.dest-card:hover .dest-btn { background: var(--primary-hover); }

/* + Add New City Card */
.add-dest-card {
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 24px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  min-height: 220px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
}

.add-dest-card:hover {
  background: rgba(234, 88, 12, 0.08);
  border-color: var(--primary);
  transform: translateY(-6px);
  box-shadow: 0 16px 28px -8px rgba(234, 88, 12, 0.25);
}

.add-dest-icon {
  font-size: 2rem;
  color: var(--primary);
  background: rgba(234, 88, 12, 0.15);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.add-dest-card:hover .add-dest-icon {
  transform: scale(1.18) rotate(90deg);
  background: var(--primary);
  color: white;
}

.add-dest-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.add-dest-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  max-width: 220px;
}

/* Landing Footer with Restore Action */
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 8px;
}

.btn-restore-defaults {
  background: transparent;
  color: #94a3b8;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 4px;
}

.btn-restore-defaults:hover {
  color: #fed7aa;
}

/* ==========================================================================
   Add City Modal Dialog
   ========================================================================== */
.city-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.city-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.city-modal-container {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: white;
  position: relative;
}

.city-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.city-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.city-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.city-form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.city-form-input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  color: white;
  font-size: 0.85rem;
  transition: border-color 0.2s ease;
}

.city-form-input:focus {
  border-color: var(--primary);
  outline: none;
}

.city-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.city-form-geocode-row {
  display: flex;
  gap: 8px;
}

.btn-geocode {
  background: #334155;
  color: #fed7aa;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-geocode:hover {
  background: #475569;
  border-color: var(--primary);
}

.emoji-quick-picks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.pin-cat-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.pin-cat-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  transform: translateY(-1px);
}

.pin-cat-btn.active {
  background: var(--primary);
  border-color: #fb923c;
  color: white;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.4);
}

.btn-add-user-pin.active-drop-mode,
.btn-add-user-pin.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: #fb923c !important;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.4);
  animation: pulsePinBtn 1.5s infinite ease-in-out;
}

@keyframes pulsePinBtn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.map-prompt-banner {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: white;
  border: 1.5px solid var(--primary);
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  pointer-events: none;
  animation: fadeInDown 0.25s ease;
}

.city-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-submit-city {
  flex: 1;
  background: var(--primary);
  color: white;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit-city:hover {
  background: var(--primary-hover);
}

.btn-cancel-city {
  background: #334155;
  color: #cbd5e1;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.btn-cancel-city:hover {
  background: #475569;
  color: white;
}

/* Manage City (Hide vs Permanent Delete) Modal Styles */
.btn-manage-city-option {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  transition: all 0.2s ease;
  color: white;
  width: 100%;
}

.btn-manage-city-option:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.btn-hide-city:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
}

.btn-purge-city {
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-purge-city:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.btn-manage-city-option .option-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.btn-manage-city-option .option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-manage-city-option .option-text strong {
  font-size: 0.95rem;
  color: #f1f5f9;
}

.btn-manage-city-option .option-text span {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

@media (max-width: 840px) {
  #landingOverlay { padding: 36px 14px 44px; }
  .destination-cards { grid-template-columns: 1fr; gap: 14px; }
  .city-modal-container { padding: 18px; }
  .city-form-row { grid-template-columns: 1fr; }
}
