/* Wayplot Dubai Trip Planner - Styles */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --z-map: 1;
  --z-map-controls: 10;
  --z-panels: 100;
  --z-header: 200;
  --z-nav: 300;
  --z-toast: 400;
  --z-modal-backdrop: 500;
  --z-modal: 600;
}

/* 
 * Mobile Safari URL Bar Fix
 * Using dvh (dynamic viewport height) allows the browser chrome to collapse on scroll
 * Fallback to vh for older browsers
 */
html {
  height: 100%;
}

body {
  /* Fallback for browsers that don't support dvh */
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height - adjusts when URL bar hides/shows */
  font-family: 'Inter', sans-serif;
  background: linear-gradient(145deg, #FEFDFB 0%, #FFFBEB 100%);
  color: #0C0A1F;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  /* Enable momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

#root {
  height: 100%;
}

/* Mobile scroll optimization - allows URL bar to collapse */
@supports (height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

/* Ensure scrollable areas trigger URL bar collapse */
.overflow-y-auto {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* 
 * Prevent iOS Safari zoom on input focus
 * iOS zooms when input font-size is less than 16px
 */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (max-width: 767px) {
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Map Container */
.map-container {
  position: absolute;
  inset: 0;
  z-index: var(--z-map);
}

.map-container .leaflet-container {
  height: 100%;
  width: 100%;
  z-index: 1 !important;
}

.leaflet-top, .leaflet-bottom, .leaflet-control {
  z-index: var(--z-map-controls) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: #D4C4A8;
  border-radius: 100px;
}

/* Animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInBottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
  }
}

@keyframes markerBounce {
  0%, 100% {
    transform: translateY(0) rotate(-45deg);
  }
  50% {
    transform: translateY(-6px) rotate(-45deg);
  }
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out forwards;
}

.animate-slide-in-bottom {
  animation: slideInBottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Glass Effect */
.glass-strong {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Modal Root */
#modal-root {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 99998;
}

#modal-root > * {
  pointer-events: auto;
}

/* Map Markers */
.map-marker {
  width: 40px;
  height: 40px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 3px solid white;
  cursor: pointer;
  transition: all 0.2s;
}

.map-marker:hover {
  transform: rotate(-45deg) scale(1.15);
}

.map-marker.selected {
  animation: markerBounce 0.5s ease infinite;
}

.map-marker-emoji {
  transform: rotate(45deg);
  font-size: 16px;
}

.map-marker-home {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #FBBF24, #D97706);
  border: 4px solid white;
}

.map-marker-home .map-marker-emoji {
  font-size: 20px;
}

.marker-day-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  border: 2px solid white;
}

/* Drop Zones */
.drop-zone {
  min-height: 12px;
  margin: 4px 0;
  border-radius: 8px;
  transition: all 0.2s;
}

.drop-zone.active {
  min-height: 48px;
  background: #FEF3C7;
  border: 2px dashed #F59E0B;
}

.drop-zone-empty {
  min-height: 80px;
  border: 2px dashed #D1D5DB;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone-empty.active {
  background: #FEF3C7;
  border-color: #F59E0B;
}

/* Drag State */
.dragging {
  opacity: 0.5;
}

/* Safe Area Padding */
.pb-safe {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* Location Picker Map */
.location-picker-map {
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
}

.location-picker-map .leaflet-container {
  height: 100%;
  cursor: crosshair !important;
}

