/* ==========================================================
   Stiluri Personalizate & Optimizări Mobile-First - LaVeterinar.ro
   Touch-first, Safe-Area insets, Bottom Navigation & Bottom Sheets
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --color-brand-primary: #0284c7;
  --color-brand-emergency: #c53f3f;
  --color-brand-emergency-dark: #a83232;
  --color-brand-emergency-light: #fdf6f6;
  --color-brand-pharmacy: #059669;
  --color-brand-clinic: #7c3aed;
  --bottom-nav-height: 64px;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* Prevenire zoom automat deranjant pe iOS Safari la focus pe inputs */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Suport pentru Safe Area Inset pe iPhone cu bară jos / notch */
body {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 16px));
}

body.no-bottom-nav {
  padding-bottom: 0 !important;
}

/* Ascundere scrollbars inestetice pe liste orizontale (touch swipe fluid) */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Custom Scrollbar pentru desktop */
@media (min-width: 769px) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: #f1f5f9;
  }
  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
}

/* ==========================================================
   BARĂ DE NAVIGAȚIE JOS (MOBILE BOTTOM TAB BAR)
   Standard UX pentru aplicații native mobile (iOS & Android)
   ========================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  z-index: 10001 !important; /* Peste orice element Leaflet (care are z-index până la 1000) */
  -webkit-transform: translate3d(0, 0, 0); /* Forțează GPU layer propriu pe iOS Safari peste straturile 3D Leaflet */
  transform: translate3d(0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.06);
}

/* Evită suprapunerea atribuirii Leaflet (OpenStreetMap) peste marginile ecranului pe mobil */
@media (max-width: 767px) {
  .leaflet-bottom {
    margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 6px) !important;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-nav-item.active {
  color: #0284c7;
}

.mobile-nav-item.active svg {
  transform: translateY(-1px);
  color: #0284c7;
}

.mobile-nav-item.nav-emergency {
  color: var(--color-brand-emergency) !important;
}

.mobile-nav-item.nav-emergency.active {
  color: var(--color-brand-emergency-dark) !important;
}

.mobile-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  width: 7px;
  height: 7px;
  background: var(--color-brand-emergency);
  border-radius: 50%;
  border: 1.5px solid white;
}

#airbnb-map-container {
  height: calc(100vh - 64px - var(--bottom-nav-height) - env(safe-area-inset-bottom, 0px));
}
@media (min-width: 768px) {
  #airbnb-map-container {
    height: calc(100vh - 120px);
  }
}

/* Stiluri Harta Leaflet */
.leaflet-popup-content-wrapper {
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.25), 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #ffffff;
}
.leaflet-popup-content {
  margin: 0;
  line-height: 1.4;
}
.leaflet-popup-tip-container {
  overflow: visible;
}
.leaflet-popup-tip {
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.15);
}
.leaflet-popup-close-button {
  top: 8px !important;
  right: 8px !important;
  background: #f1f5f9 !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #475569 !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  transition: all 0.2s ease !important;
  z-index: 20 !important;
  border: none !important;
}
.leaflet-popup-close-button:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  transform: scale(1.08);
}

.leaflet-popup-content a {
  text-decoration: none !important;
}

.popup-title-link {
  color: #0f172a !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}
.popup-title-link:hover {
  color: #0284c7 !important;
}

.popup-city-row {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #0284c7 !important;
  display: flex !important;
  align-items: center !important;
  margin-bottom: 4px !important;
}

/* Butoane Leaflet Popup - Contrast Ridicat și lizibilitate impecabilă */
.popup-btn-call {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 7px 11px !important;
  background-color: #ecfdf5 !important;
  border: 1.5px solid #10b981 !important;
  color: #065f46 !important;
  border-radius: 10px !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.15) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}
.popup-btn-call:hover, .popup-btn-call:active {
  background-color: #d1fae5 !important;
  border-color: #059669 !important;
  color: #064e3b !important;
  transform: translateY(-1px);
}

.popup-btn-details {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 7px 14px !important;
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 1.5px solid #0284c7 !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  letter-spacing: 0.2px !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35) !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}
.popup-btn-details:hover, .popup-btn-details:active {
  background: linear-gradient(135deg, #0369a1, #075985) !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.45) !important;
}

/* Custom Marker Pins */
.custom-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  border: 2px solid white;
}
.custom-pin:hover, .custom-pin.pin-active {
  transform: scale(1.25);
  z-index: 1000 !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

/* Punct Activ pe Hartă (Markerul cu Leaflet Popup deschis) */
.custom-pin.pin-active-selected {
  transform: scale(1.38) !important;
  z-index: 2000 !important;
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 7px #0284c7, 0 10px 24px rgba(2, 132, 199, 0.6) !important;
  animation: activePinPulseCabinet 2s infinite ease-in-out !important;
}

.pin-spital.pin-active-selected {
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 7px #dc2626, 0 10px 24px rgba(220, 38, 38, 0.65) !important;
  animation: activePinPulseSpital 2s infinite ease-in-out !important;
}

.pin-clinica.pin-active-selected {
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 7px #7c3aed, 0 10px 24px rgba(124, 58, 237, 0.6) !important;
  animation: activePinPulseClinica 2s infinite ease-in-out !important;
}

.pin-farmacie.pin-active-selected {
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 7px #059669, 0 10px 24px rgba(5, 150, 105, 0.6) !important;
  animation: activePinPulseFarmacie 2s infinite ease-in-out !important;
}

.pin-spital { background-color: var(--color-brand-emergency); animation: pulse-emergency 2.5s infinite; }
.pin-clinica { background-color: #7c3aed; }
.pin-cabinet { background-color: #0284c7; }
.pin-farmacie { background-color: #059669; }
.pin-consultanta { background-color: #64748b; }

@keyframes pulse-emergency {
  0%, 100% { box-shadow: 0 0 0 0 rgba(197, 63, 63, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(197, 63, 63, 0); }
}

@keyframes activePinPulseCabinet {
  0%, 100% {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #0284c7, 0 8px 20px rgba(2, 132, 199, 0.5);
    transform: scale(1.35);
  }
  50% {
    box-shadow: 0 0 0 4px #ffffff, 0 0 0 10px rgba(2, 132, 199, 0.6), 0 12px 26px rgba(2, 132, 199, 0.7);
    transform: scale(1.42);
  }
}

@keyframes activePinPulseSpital {
  0%, 100% {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #dc2626, 0 8px 20px rgba(220, 38, 38, 0.5);
    transform: scale(1.35);
  }
  50% {
    box-shadow: 0 0 0 4px #ffffff, 0 0 0 10px rgba(220, 38, 38, 0.6), 0 12px 26px rgba(220, 38, 38, 0.7);
    transform: scale(1.42);
  }
}

@keyframes activePinPulseClinica {
  0%, 100% {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #7c3aed, 0 8px 20px rgba(124, 58, 237, 0.5);
    transform: scale(1.35);
  }
  50% {
    box-shadow: 0 0 0 4px #ffffff, 0 0 0 10px rgba(124, 58, 237, 0.6), 0 12px 26px rgba(124, 58, 237, 0.7);
    transform: scale(1.42);
  }
}

@keyframes activePinPulseFarmacie {
  0%, 100% {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #059669, 0 8px 20px rgba(5, 150, 105, 0.5);
    transform: scale(1.35);
  }
  50% {
    box-shadow: 0 0 0 4px #ffffff, 0 0 0 10px rgba(5, 150, 105, 0.6), 0 12px 26px rgba(5, 150, 105, 0.7);
    transform: scale(1.42);
  }
}

/* Cluster Markers (Server-Side Dynamic Clustering) */
.custom-cluster-marker {
  background: transparent !important;
  border: none !important;
}
.custom-cluster-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}


/* ==========================================================
   STILURI PRINTARE EXACTĂ A4 PENTRU AFIȘUL SOS PIERDUT
   ========================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  body * {
    visibility: hidden;
  }
  #a4-printable-flyer, #a4-printable-flyer * {
    visibility: visible;
  }
  #a4-printable-flyer {
    position: absolute;
    left: 0;
    top: 0;
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 10mm;
    box-sizing: border-box;
    background: white !important;
    color: black !important;
    font-size: 12pt;
    page-break-after: always;
  }
  .no-print, .mobile-bottom-nav {
    display: none !important;
  }
}

/* Fâșii decupabile cu foarfecă (Tear-off tabs) */
.tear-off-tab {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  border-left: 1px dashed #475569;
  padding: 8px 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
}
.tear-off-tab:last-child {
  border-right: 1px dashed #475569;
}

/* ==========================================================
   MENIU DEDICAT PENTRU MOBILE & TABLETĂ (< 1024px)
   Slide-over Drawer, Backdrop Blur & Scroll Lock
   ========================================================== */
#mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease-in-out;
}

#mobile-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

#mobile-tablet-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 380px);
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  z-index: 1060;
  box-shadow: -8px 0 35px -5px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  will-change: transform;
}

#mobile-tablet-drawer.active {
  transform: translateX(0);
}

body.drawer-open {
  overflow: hidden !important;
  touch-action: none !important;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.875rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.drawer-nav-item:hover,
.drawer-nav-item:active {
  background-color: #f1f5f9;
  color: #0f172a;
}

.drawer-nav-item.active {
  background-color: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}

.drawer-nav-item.nav-emergency-item {
  color: var(--color-brand-emergency-dark, #a83232);
}

.drawer-nav-item.nav-emergency-item:hover,
.drawer-nav-item.nav-emergency-item:active {
  background-color: var(--color-brand-emergency-light, #fdf6f6);
  color: var(--color-brand-emergency, #c53f3f);
}

.drawer-nav-item.nav-emergency-item.active {
  background-color: var(--color-brand-emergency-light, #fdf6f6);
  border-color: #f5d5d5;
  color: var(--color-brand-emergency, #c53f3f);
}

/* Modale Globale - Asigură afișarea peste orice hartă Leaflet, pin-uri sau bare fixe */
#review-modal, #claim-modal, #auth-modal, #add-ad-modal {
  z-index: 99999 !important;
}


