/* MarunnUndo Stylesheet */
/* Theme: Medical Blue & White Only */

:root {
  --primary: #2563eb;          /* Medical Blue */
  --primary-hover: #1d4ed8;    /* Deep Medical Blue */
  --primary-light: #eff6ff;    /* Soft Tint Blue */
  --white: #ffffff;
  --bg-light: #f8fafc;         /* Slate background tint */
  --border-light: #e2e8f0;     /* Border gray-blue */
  --text-dark: #0f172a;        /* Deep Navy slate */
  --text-muted: #64748b;       /* Cool gray */
  --shadow-premium: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 10px 10px -6px rgba(37, 99, 235, 0.1);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  /* Theme-specific variables */
  --panel-bg: rgba(255, 255, 255, 0.95);
  --panel-border: rgba(255, 255, 255, 0.6);
  --modal-overlay-bg: rgba(15, 23, 42, 0.6);
  --map-filter: none;

  /* Accent Glow / Shadows variables */
  --primary-glow: rgba(37, 99, 235, 0.1);
  --primary-glow-heavy: rgba(37, 99, 235, 0.25);
  --primary-shadow-light: rgba(37, 99, 235, 0.05);
  --primary-shadow-medium: rgba(37, 99, 235, 0.15);
  --primary-shadow-heavy: rgba(37, 99, 235, 0.3);
  --primary-border-soft: rgba(37, 99, 235, 0.2);
  --primary-border-soft-dashed: rgba(37, 99, 235, 0.4);
  --pulse-rgba-start: rgba(37, 99, 235, 0.7);
  --pulse-rgba-mid: rgba(37, 99, 235, 0);
  --pulse-rgba-end: rgba(37, 99, 235, 0);
}

[data-theme="dark"] {
  --primary: #2563eb;          /* Explore Blue */
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.15);
  --white: #161b22;            /* GitHub Dark Box Background */
  --bg-light: #0d1117;         /* GitHub Dark Canvas Background */
  --border-light: #30363d;     /* GitHub Dark Border */
  --text-dark: #c9d1d9;        /* GitHub Dark Primary Text */
  --text-muted: #8b949e;       /* GitHub Dark Secondary Text */
  --shadow-premium: 0 8px 24px rgba(1, 4, 9, 0.8);
  --shadow-hover: 0 20px 25px -5px rgba(37, 99, 235, 0.15), 0 10px 10px -6px rgba(37, 99, 235, 0.15);
  
  --panel-bg: rgba(22, 27, 34, 0.95);
  --panel-border: rgba(48, 54, 61, 0.8);
  --modal-overlay-bg: rgba(1, 4, 9, 0.8);
  --map-filter: invert(90%) hue-rotate(180deg) brightness(90%) contrast(90%);

  /* Accent Glow / Shadows variables (Blue) */
  --primary-glow: rgba(37, 99, 235, 0.1);
  --primary-glow-heavy: rgba(37, 99, 235, 0.25);
  --primary-shadow-light: rgba(37, 99, 235, 0.05);
  --primary-shadow-medium: rgba(37, 99, 235, 0.15);
  --primary-shadow-heavy: rgba(37, 99, 235, 0.3);
  --primary-border-soft: rgba(37, 99, 235, 0.2);
  --primary-border-soft-dashed: rgba(37, 99, 235, 0.4);
  --pulse-rgba-start: rgba(37, 99, 235, 0.7);
  --pulse-rgba-mid: rgba(37, 99, 235, 0);
  --pulse-rgba-end: rgba(37, 99, 235, 0);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-light);
}

.app-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
}

/* Full Screen Map */
#map {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  filter: var(--map-filter);
  transition: filter 0.3s ease;
}

/* Floating Sidebar/Panel */
.floating-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  bottom: 20px;
  width: 380px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px) saturate(190%);
  -webkit-backdrop-filter: blur(12px) saturate(190%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panel Header */
.panel-header {
  padding: 24px 20px 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--white);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.med-cross-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  filter: drop-shadow(0 2px 4px var(--primary-border-soft));
}

.app-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 2px 10px var(--primary-shadow-medium), 0 0 0 2px var(--primary-border-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--white);
  padding: 2px;
}

.app-logo:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px var(--primary-shadow-heavy), 0 0 0 2px var(--primary);
}

.title-wrap h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.1;
}

.title-wrap .sub-title {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Search Box Section */
.search-section {
  padding: 16px 20px;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-light);
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

#medicine-search, #place-search {
  width: 100%;
  padding: 14px 14px 14px 44px;
  font-size: 0.95rem;
  color: var(--text-dark);
  background-color: var(--bg-light);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

#medicine-search:focus, #place-search:focus {
  border-color: var(--primary);
  background-color: var(--white);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Status Panel */
.status-section {
  padding: 12px 20px;
  background-color: var(--bg-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.status-indicator:hover {
  background-color: var(--border-light);
}

.status-indicator:active {
  transform: scale(0.97);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active {
  background-color: var(--primary);
}

.status-dot.denied {
  background-color: var(--text-dark);
}

.status-dot.pulse {
  background-color: var(--primary);
  animation: pulse-dot 1.5s infinite ease-in-out;
}

#status-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dark);
}

.coord-info {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-muted);
  background-color: var(--white);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

/* Actions Section */
.actions-section {
  padding: 12px 20px;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-light);
}

.action-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px var(--primary-shadow-medium);
}

.action-btn:hover:not(:disabled) {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 12px -2px var(--primary-glow-heavy);
  transform: translateY(-1px);
}

.action-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.action-btn:disabled {
  background-color: var(--border-light);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* Results Section */
.results-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--white);
}

.results-header {
  padding: 16px 20px 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.source-verified {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border-soft);
}

.badge.source-sync {
  background-color: var(--bg-light);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.badge.source-google {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

#results-count {
  background-color: var(--primary-light);
  color: var(--primary);
}

.list-placeholder {
  padding: 40px 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pharmacies-list {
  flex: 1;
  list-style: none;
  overflow-y: auto;
  padding: 0 20px 20px 20px;
}

/* Custom Scrollbar for list */
.pharmacies-list::-webkit-scrollbar {
  width: 6px;
}

.pharmacies-list::-webkit-scrollbar-track {
  background: transparent;
}

.pharmacies-list::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 99px;
}

.pharmacies-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Pharmacy Card */
.pharmacy-card {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
}

.pharmacy-card:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-shadow-light);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-header-row h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
}

.card-address {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Card Button Actions */
.card-actions {
  display: flex;
  gap: 8px;
}

.card-wa-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background-color: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-wa-btn svg {
  width: 14px;
  height: 14px;
}

.card-wa-btn:hover {
  color: #ffffff;
  background-color: var(--primary);
  box-shadow: 0 4px 8px var(--primary-shadow-medium);
}

.card-wa-btn.copy-btn {
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.card-wa-btn.copy-btn:hover {
  border-color: var(--text-dark);
  color: #ffffff;
  background-color: var(--text-dark);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.15);
}

.card-wa-btn.copied {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.card-gmaps-btn {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  background-color: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-gmaps-btn svg {
  width: 14px;
  height: 14px;
}

.card-gmaps-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background-color: rgba(26, 115, 232, 0.05);
  box-shadow: 0 4px 8px rgba(26, 115, 232, 0.1);
}

/* Panel Footer */
.panel-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  background-color: var(--bg-light);
}

.panel-footer span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Custom Marker Pins */
.custom-pin {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 6px var(--primary-shadow-heavy));
  transition: transform 0.2s ease;
}

.custom-pin:hover {
  transform: scale(1.15);
}

/* User Pulse Location Marker */
.user-pulse-marker {
  width: 24px;
  height: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inner-dot {
  width: 12px;
  height: 12px;
  background-color: var(--primary);
  border: 2px solid var(--white);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pulse-ring {
  border: 4px solid var(--primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: absolute;
  animation: marker-pulse 2s infinite ease-out;
  opacity: 0;
  z-index: 1;
}

/* Map Popups Styles */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-premium) !important;
  padding: 4px !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  width: 250px !important;
}

.store-popup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popup-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.popup-title-row h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.popup-distance {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}

.popup-addr {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.popup-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.popup-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 10px;
  background-color: var(--primary);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px var(--primary-glow);
}

.popup-wa-btn:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 12px var(--primary-border-soft);
}

.popup-wa-btn.secondary-btn {
  background-color: var(--text-dark);
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.1);
}

.popup-gmaps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border-light);
  color: var(--text-muted) !important;
  background-color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.popup-gmaps-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8 !important;
  background-color: rgba(26, 115, 232, 0.05);
  box-shadow: 0 4px 6px rgba(26, 115, 232, 0.1);
}

.popup-wa-btn.secondary-btn:hover {
  background-color: #000000;
}

.popup-wa-btn.copied {
  background-color: var(--primary);
}

.wa-icon {
  width: 14px;
  height: 14px;
}

/* Animations */
@keyframes marker-pulse {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 var(--pulse-rgba-start);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px var(--pulse-rgba-mid);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 var(--pulse-rgba-end);
  }
}

/* Responsive Rules for Mobile Devices */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column-reverse;
  }
  
  #map {
    position: relative;
    flex: 1;
    width: 100%;
    height: calc(100vh - 280px); /* Map takes upper section */
  }
  
  .floating-panel {
    position: relative;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 280px; /* Panel takes lower section on mobile */
    border-radius: 0;
    border: none;
    border-top: 2px solid var(--border-light);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
  }
  
  .panel-header {
    padding: 12px 16px 8px 16px;
  }
  
  .logo-area {
    margin-bottom: 2px;
  }
  
  .title-wrap h1 {
    font-size: 1.25rem;
  }
  
  .tagline {
    display: none; /* Hide tagline on mobile to save space */
  }
  
  .search-section {
    padding: 8px 16px;
  }
  
  #medicine-search {
    padding: 10px 10px 10px 36px;
    font-size: 0.85rem;
  }
  
  .search-icon {
    left: 12px;
    width: 16px;
    height: 16px;
  }
  
  .status-section {
    padding: 6px 16px;
  }
  
  .actions-section {
    display: none; /* Auto-scans based on movement or simple tap, saving height */
  }
  
  .results-container {
    padding: 0;
  }
  
  .results-header {
    padding: 8px 16px 4px 16px;
  }
  
  .pharmacies-list {
    padding: 0 16px 16px 16px;
  }
  
  .pharmacy-card {
    padding: 10px;
    margin-bottom: 8px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .card-body {
    flex: 1;
  }
  
  .card-header-row h4 {
    font-size: 0.85rem;
  }
  
  .card-actions {
    flex: 0 0 100px;
  }
  
  .card-wa-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  
  .panel-footer {
    display: none; /* Hide footer on mobile */
  }
  
  .google-prompt-card {
    margin: 10px 16px;
  }
  
  .modal-content {
    max-width: calc(100% - 32px);
  }
}

/* Settings Cog Button & Header Action Buttons */
.settings-btn, .header-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
}
.settings-btn:hover, .header-action-btn:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}
.settings-btn:hover {
  transform: rotate(45deg);
}
.settings-btn svg, .header-action-btn svg {
  width: 20px;
  height: 20px;
}
.header-actions-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.header-action-btn .lang-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.header-action-btn:hover .lang-label {
  color: var(--primary);
}
#btn-lang.header-action-btn {
  width: auto;
  border-radius: 18px;
  padding: 8px 12px;
}


/* Pharmacy Detail Panel (slides in from the right) */
.floating-detail-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  bottom: 20px;
  width: 380px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px) saturate(190%);
  -webkit-backdrop-filter: blur(12px) saturate(190%);
  box-shadow: var(--shadow-premium);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 1;
}

.floating-detail-panel.hidden {
  transform: translateX(120%);
  opacity: 0;
  pointer-events: none;
}

.detail-header-image {
  position: relative;
  height: 140px;
  width: 100%;
  overflow: hidden;
}

.header-image-placeholder {
  height: 100%;
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  position: relative;
}

.med-cross-banner {
  width: 50px;
  height: 50px;
  opacity: 0.25;
  stroke: #ffffff;
}

.banner-badge {
  position: absolute;
  bottom: 12px;
  left: 16px;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.detail-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  border: none;
  font-size: 1.4rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background-color 0.2s, transform 0.2s;
  line-height: 1;
}

.detail-close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.05);
}

.detail-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
}

.detail-main-info h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 4px;
}

.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

#detail-rating-num {
  font-weight: 700;
  color: #eab308;
}

#detail-rating-stars {
  color: #eab308;
  letter-spacing: 1px;
}

#detail-rating-count {
  color: var(--text-muted);
}

.detail-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-actions-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.detail-action-circle {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: 76px;
  padding: 0;
  outline: none;
}

.circle-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--white);
  transition: all 0.2s ease;
}

.detail-action-circle:hover .circle-icon {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.circle-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}

.circle-icon.wa svg {
  width: 20px;
  height: 20px;
}

.action-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.detail-action-circle:hover .action-label {
  color: var(--primary);
}

.detail-action-circle.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.detail-action-circle.disabled:hover .circle-icon {
  background: var(--white);
  border-color: var(--border-light);
  transform: none;
}

.detail-action-circle.disabled:hover .action-label {
  color: var(--text-muted);
}


.detail-info-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.info-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

#detail-address, #detail-phone, #detail-hours {
  font-size: 0.85rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.highlighted-phone {
  background-color: var(--primary-light);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-border-soft);
}

.highlighted-phone .info-icon {
  color: var(--primary);
}

#detail-phone.phone-link {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

#detail-phone.phone-link:hover {
  text-decoration: underline;
}

.detail-divider {
  height: 1px;
  background-color: var(--border-light);
  width: 100%;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.visit-plan-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.visit-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background-color: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.review-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
}

.review-stars {
  color: #eab308;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.review-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  font-style: italic;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .floating-detail-panel {
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 65% !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    border-bottom: none !important;
    transform: translateY(0);
    z-index: 2000;
  }
  .floating-detail-panel.hidden {
    transform: translateY(120%) !important;
    opacity: 0;
  }
}

/* Spinner animation for button loading state */
.card-wa-btn.loading, .popup-wa-btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.card-wa-btn.loading::after, .popup-wa-btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: calc(50% - 8px);
  left: calc(50% - 8px);
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: btn-spinner 0.6s linear infinite;
  z-index: 5;
}
.card-wa-btn.loading svg, .popup-wa-btn.loading svg,
.card-wa-btn.loading span, .popup-wa-btn.loading span {
  opacity: 0;
}
@keyframes btn-spinner {
  to { transform: rotate(360deg); }
}

/* Explore button on pharmacy cards — premium blue pill */
.card-explore-btn {
  flex: 1;
  padding: 9px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.4), 0 1px 3px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.card-explore-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
}

.card-explore-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.card-explore-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5), 0 2px 6px rgba(37, 99, 235, 0.3);
  transform: translateY(-2px);
}

.card-explore-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Google Business Profile button in detail sidebar */
.detail-google-biz-btn {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
  margin-top: 4px;
}

.detail-google-biz-btn:hover {
  background: linear-gradient(135deg, #1565c0 0%, #0a2f7d 100%);
  box-shadow: 0 6px 18px rgba(26, 115, 232, 0.45);
  transform: translateY(-2px);
}

.detail-google-biz-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.detail-google-biz-btn span {
  flex: 1;
  text-align: left;
}


/* ── Google Enrichment Badge ─────────────────────────────────── */
.google-enrich-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border-soft);
  width: fit-content;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.google-enrich-badge.success {
  background: #f0fdf4;
  border-color: rgba(34, 197, 94, 0.3);
}
.google-enrich-badge.failed {
  background: #fff7ed;
  border-color: rgba(251, 146, 60, 0.3);
}
#enrich-status-text {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}
.google-enrich-badge.success #enrich-status-text { color: #16a34a; }
.google-enrich-badge.failed  #enrich-status-text { color: #ea580c; }

.enrich-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: enrich-pulse 1.4s infinite ease-in-out;
  flex-shrink: 0;
}
/* ── Website link in detail panel ──────────────────────────── */
.detail-website-link {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
}
.detail-website-link:hover { text-decoration: underline; }

/* Quick Search Button Fallback */
.quick-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border-soft);
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.quick-search-btn:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px var(--primary-shadow-medium);
  transform: translateY(-1px);
}
.quick-search-btn svg {
  width: 12px;
  height: 12px;
}
