/* Sisaket Healthcare Web App - Public Health Fresh Green & White Theme */
@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --primary-clinic: #0284c7;
  --primary-pharmacy: #d97706;
  --primary-massage: #9333ea;
  --primary-tourist: #059669;
  --health-green-primary: #059669;
  --health-green-dark: #047857;
  --health-green-light: #ecfdf5;
  --card-bg: #ffffff;
  --card-border: #d1fae5;
}

* {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

/* Custom Scrollbar for Public Health Green Theme */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f0fdf4;
}
::-webkit-scrollbar-thumb {
  background: #a7f3d0;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #6ee7b7;
}

/* View switching display guarantees */
#catalogView {
  display: block;
}

#mapView {
  display: none;
}

.view-panel.view-hidden {
  display: none !important;
}

.view-panel.view-active {
  display: flex !important;
}

/* Map Container */
#map {
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* Custom Marker Pins */
.custom-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid #ffffff;
}

.custom-pin:hover {
  transform: scale(1.25);
  z-index: 1000 !important;
}

.pin-clinic {
  background: linear-gradient(135deg, #0284c7, #0369a1);
}

.pin-pharmacy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.pin-massage {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
}

.pin-tourist {
  background: linear-gradient(135deg, #10b981, #059669);
}

.pin-stadium {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  border: 3px solid #ffffff;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.95);
  animation: pulse-stadium 2.5s infinite;
}

@keyframes pulse-stadium {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* User Location GPS Radar Marker */
.user-location-pin {
  width: 20px;
  height: 20px;
  background-color: #059669;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 12px rgba(5, 150, 105, 0.8);
  position: relative;
}

.user-location-pulse {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(5, 150, 105, 0.3);
  animation: radar-pulse 2s infinite ease-out;
}

@keyframes radar-pulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Marker Labels (Visible when zooming in close >= 14) */
.map-marker-label {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 9999px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  white-space: nowrap !important;
  max-width: 220px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  pointer-events: none !important;
  border-width: 1.5px !important;
  border-style: solid !important;
  line-height: 1.35 !important;
  transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.map-marker-label::before {
  display: none !important;
}

.label-pharmacy {
  background-color: #fffbeb !important;
  color: #92400e !important;
  border-color: #f59e0b !important;
}

.label-massage {
  background-color: #faf5ff !important;
  color: #6b21a8 !important;
  border-color: #a855f7 !important;
}

.label-clinic {
  background-color: #f0f9ff !important;
  color: #075985 !important;
  border-color: #0284c7 !important;
}

.label-stadium {
  background-color: #fef3c7 !important;
  color: #78350f !important;
  border-color: #d97706 !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
}

.label-tourist {
  background-color: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #10b981 !important;
}

/* Hide labels when zoomed out (< 14) */
.zoom-hide-labels .map-marker-label {
  display: none !important;
  opacity: 0 !important;
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.2);
  background: #ffffff;
  border: 1px solid #d1fae5;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.5;
}

.leaflet-popup-tip-container {
  margin-top: -1px;
}

/* Marker Cluster Custom Styling */
.marker-cluster-small {
  background-color: rgba(167, 243, 208, 0.6);
}
.marker-cluster-small div {
  background-color: rgba(5, 150, 105, 0.9);
  color: white;
  font-weight: 600;
}
.marker-cluster-medium {
  background-color: rgba(254, 215, 170, 0.6);
}
.marker-cluster-medium div {
  background-color: rgba(217, 119, 6, 0.85);
  color: white;
  font-weight: 600;
}
.marker-cluster-large {
  background-color: rgba(243, 232, 255, 0.6);
}
.marker-cluster-large div {
  background-color: rgba(147, 51, 234, 0.85);
  color: white;
  font-weight: 600;
}

/* PUBLIC HEALTH FRESH GREEN & WHITE THEME */
.health-catalog-bg {
  background: radial-gradient(circle at 10% 10%, #ecfdf5 0%, #f0fdf4 40%, #f9fafb 100%);
}

.health-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.05), 0 1px 3px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.health-card:hover {
  transform: translateY(-4px);
  border-color: #10b981;
  box-shadow: 0 12px 24px -6px rgba(5, 150, 105, 0.16), 0 4px 8px -2px rgba(5, 150, 105, 0.08);
}

/* Primary Action Button (นำทาง - เขียวสดใส) */
.btn-health-primary {
  background-color: #059669;
  color: #ffffff;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-health-primary:hover {
  background-color: #047857;
  transform: scale(1.02);
}

/* Secondary Action Button (ดูบนแผนที่ - ขาวตัดเขียว) */
.btn-health-secondary {
  background-color: #ffffff;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-health-secondary:hover {
  background-color: #ecfdf5;
  border-color: #059669;
  color: #065f46;
}

/* Category Filter Pills (Public Health Theme) */
.cat-pill-health {
  background-color: #ffffff;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.825rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cat-pill-health:hover {
  background-color: #ecfdf5;
  border-color: #059669;
  color: #047857;
}

.cat-pill-health.active-pill {
  background-color: #059669 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3) !important;
}

/* ========================================================================= */
/* MOPH HERO SECTION WITH 3D FLIPPING EMBLEM & KING'S CUP VISITOR MENU (ภาพที่ 2) */
/* ========================================================================= */
.moph-hero-card {
  background: radial-gradient(circle at 18% 45%, #064e3b 0%, #022c22 65%, #011d17 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 20px 45px -12px rgba(2, 44, 34, 0.5), 0 0 0 1px rgba(16, 185, 129, 0.15);
}

/* 3D Perspective Stage */
.moph-3d-stage {
  perspective: 1000px;
  transform-style: preserve-3d;
  position: relative;
}

/* 3D Flipping Animation for MOPH Logo (หมุนพลิกไปมาแบบในภาพของคิงส์คัพ) */
.moph-3d-logo {
  transform-style: preserve-3d;
  animation: mophFlipRotate 6s ease-in-out infinite alternate;
  will-change: transform, filter;
  transition: transform 0.3s ease;
}

.moph-3d-logo:hover {
  animation-play-state: paused;
  transform: perspective(900px) rotateY(0deg) scale(1.08) !important;
}

@keyframes mophFlipRotate {
  0% {
    transform: perspective(900px) rotateY(-28deg) rotateX(4deg) translateY(0px) scale(0.97);
    filter: drop-shadow(-10px 18px 25px rgba(5, 150, 105, 0.45));
  }
  50% {
    transform: perspective(900px) rotateY(0deg) rotateX(0deg) translateY(-10px) scale(1.03);
    filter: drop-shadow(0px 26px 36px rgba(16, 185, 129, 0.65));
  }
  100% {
    transform: perspective(900px) rotateY(28deg) rotateX(-4deg) translateY(0px) scale(0.97);
    filter: drop-shadow(10px 18px 25px rgba(5, 150, 105, 0.45));
  }
}

/* Glowing Rotating Sunburst Rays */
.moph-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130%;
  height: 130%;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from 0deg,
    rgba(250, 204, 21, 0.12) 0deg 12deg,
    transparent 12deg 24deg
  );
  border-radius: 50%;
  animation: spinRays 45s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes spinRays {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Service Menu Cards (สไตล์ภาพที่ 2) */
.service-menu-card {
  background: #022c22;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(2, 44, 34, 0.25);
  position: relative;
  overflow: hidden;
}

.service-menu-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #10b981;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.service-menu-card:hover {
  background: #064e3b;
  border-color: #34d399;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(5, 150, 105, 0.4);
}

.service-menu-card:hover::before {
  opacity: 1;
}

.service-menu-card:hover .service-arrow-btn {
  background-color: #facc15;
  color: #0f172a;
  border-color: #facc15;
  transform: translateX(4px);
}

.service-arrow-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: #033f31;
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex: none;
  transition: all 0.2s ease;
}

/* Line Clamp Utilities */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Image & Photo Gallery Utilities */
.group\/img img {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.health-card:hover .group\/img img {
  transform: scale(1.06);
}

#dropZone {
  background-image: repeating-linear-gradient(0deg, #10b981, #10b981 10px, transparent 10px, transparent 20px),
                    repeating-linear-gradient(90deg, #10b981, #10b981 10px, transparent 10px, transparent 20px),
                    repeating-linear-gradient(180deg, #10b981, #10b981 10px, transparent 10px, transparent 20px),
                    repeating-linear-gradient(270deg, #10b981, #10b981 10px, transparent 10px, transparent 20px);
  background-size: 2px 100%, 100% 2px, 2px 100%, 100% 2px;
  background-position: 0 0, 0 0, 100% 0, 0 100%;
  background-repeat: no-repeat;
  border: none;
}

#dropZone:hover {
  background-color: #ecfdf5;
}

