@import url('ios-animations.css');

/* ========================================================
   OFFIT DO-D: Clinic Finder New UI Styles
   Matching the new index theme & mockup design
   ======================================================== */

/* ---- HERO BANNER CARD ---- */
.clinic-hero-banner-card {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: none;
  margin-bottom: 20px;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 4px 16px rgba(18, 78, 161, 0.09));
  transition: filter 0.25s ease;
}

.clinic-hero-banner-card:hover {
  filter: drop-shadow(0 6px 20px rgba(18, 78, 161, 0.14));
}

.clinic-hero-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}

@media (max-width: 767.98px) {
  .clinic-hero-banner-card {
    border-radius: 16px;
    margin-bottom: 14px;
  }
}

@media (max-width: 991.98px) {
  .clinic-hero-banner {
    padding: 24px 20px;
    min-height: 170px;
    background-position: right -60px center;
  }
  .clinic-hero-content {
    max-width: 70%;
  }
  .clinic-hero-title {
    font-size: 1.45rem;
  }
}

@media (max-width: 575.98px) {
  .clinic-hero-banner {
    padding: 20px 16px;
    min-height: auto;
    background: linear-gradient(135deg, #e8f3fe 0%, #d8ecfe 100%);
  }
  .clinic-hero-content {
    max-width: 100%;
  }
  .clinic-hero-title {
    font-size: 1.25rem;
  }
  .clinic-hero-subtitle {
    font-size: 0.875rem;
  }
  .clinic-search-card {
    padding: 12px 14px;
    border-radius: 14px;
  }
  .btn-clinic-near {
    width: 100%;
    justify-content: center;
    padding: 9px 16px;
    font-size: 0.88rem;
  }
  .clinic-toolbar {
    gap: 8px !important;
  }
  .clinic-results-count {
    font-size: 0.92rem;
  }
  .clinic-sort-wrap {
    font-size: 0.875rem;
    gap: 6px;
  }
  .clinic-sort-select {
    font-size: 0.875rem;
    padding: 4px 22px 4px 8px;
  }
}

/* ---- SEARCH & FILTER CARD ---- */
.clinic-search-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px 20px;
  border: 1.5px solid #dbe8f7;
  box-shadow: 0 4px 16px rgba(18, 78, 161, 0.04);
  margin-bottom: 16px;
}

.clinic-search-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clinic-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.clinic-search-input-wrap .search-icon {
  position: absolute;
  left: 14px;
  color: #1868d4;
  font-size: 0.95rem;
  pointer-events: none;
}

.clinic-search-input {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 50px;
  padding: 8px 36px 8px 38px;
  font-size: 0.88rem;
  color: #1e293b;
  width: 100%;
  font-family: inherit;
  transition: all 0.2s ease;
}

.clinic-search-input:focus {
  background: #ffffff;
  border-color: #1868d4;
  box-shadow: 0 0 0 3px rgba(24, 104, 212, 0.12);
  outline: none;
}

.clinic-search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.clinic-search-clear:hover {
  color: #64748b;
}

.btn-clinic-near {
  background: #1868d4;
  color: #ffffff !important;
  border: none;
  border-radius: 50px;
  padding: 8px 22px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(24, 104, 212, 0.25);
}

.btn-clinic-near:hover {
  background: #124da0;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(24, 104, 212, 0.35);
}

.btn-clinic-near:active {
  transform: translateY(0);
}

/* ---- RESULTS TOOLBAR ---- */
.clinic-toolbar {
  padding: 0 4px;
}

.clinic-results-count {
  font-size: 0.98rem;
  color: #1e293b;
  font-weight: 600;
}

.clinic-results-count strong {
  color: #1868d4;
  font-size: 1.05rem;
}

.clinic-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #64748b;
}

.clinic-sort-select {
  background-color: #ffffff;
  border: 1.5px solid #dbe8f7;
  border-radius: 10px;
  padding: 5px 28px 5px 12px;
  font-size: 0.875rem;
  color: #1e293b;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.clinic-sort-select:focus {
  border-color: #1868d4;
  box-shadow: 0 0 0 3px rgba(24, 104, 212, 0.12);
}

.clinic-view-toggle {
  display: inline-flex;
  background: #eef4fc;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.btn-view-toggle {
  background: transparent;
  border: none;
  color: #64748b;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.btn-view-toggle.active {
  background: #1868d4;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(24, 104, 212, 0.25);
}

.btn-view-toggle:hover:not(.active) {
  background: rgba(255, 255, 255, 0.6);
  color: #1868d4;
}

/* ---- CLINIC CARDS (GRID VIEW) ---- */
.clinic-card {
  background: #ffffff;
  border: 1.5px solid #e1ebf6;
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(18, 78, 161, 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  position: relative;
}

.clinic-card:hover {
  transform: translateY(-4px);
  border-color: #bcd7f8;
  box-shadow: 0 10px 24px rgba(24, 104, 212, 0.12);
}

.clinic-card.highlighted {
  border-color: #1868d4;
  box-shadow: 0 0 0 3px rgba(24, 104, 212, 0.2), 0 10px 24px rgba(24, 104, 212, 0.15);
}

.clinic-card-img-wrap {
  position: relative;
  width: 100%;
  height: 155px;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clinic-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.clinic-card:hover .clinic-card-img {
  transform: scale(1.04);
}

.clinic-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  z-index: 3;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clinic-fav-btn:hover {
  background: #ffffff;
  color: #ef4444;
  transform: scale(1.1);
}

.clinic-fav-btn.active {
  color: #ef4444;
  background: #ffffff;
}

.clinic-fav-btn.active i {
  animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.clinic-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.clinic-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}

.clinic-card-title a {
  color: #1e293b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.clinic-card:hover .clinic-card-title a {
  color: #1868d4;
}

.clinic-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #64748b;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  gap: 8px;
}

.clinic-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.clinic-meta-item i {
  color: #1868d4;
  font-size: 0.9rem;
}

.clinic-meta-loc {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.clinic-meta-dist {
  font-weight: 500;
  color: #334155;
}

/* ---- CLINIC CARDS (LIST VIEW) ---- */
.clinic-list-mode .clinic-card {
  flex-direction: row;
  height: 130px;
}

.clinic-list-mode .clinic-card-img-wrap {
  width: 170px;
  height: 100%;
  flex-shrink: 0;
}

.clinic-list-mode .clinic-card-title {
  min-height: auto;
  -webkit-line-clamp: 1;
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.clinic-list-mode .clinic-card-footer {
  border-top: none;
  padding-top: 4px;
}

@media (max-width: 575.98px) {
  .clinic-list-mode .clinic-card {
    flex-direction: column;
    height: auto;
  }
  .clinic-list-mode .clinic-card-img-wrap {
    width: 100%;
    height: 150px;
  }
}

/* ---- MAP COLUMN & CONTAINER ---- */
.clinic-map-wrapper {
  position: sticky;
  top: 16px;
  background: #ffffff;
  border-radius: 20px;
  border: 1.5px solid #dbe8f7;
  overflow: hidden;
  height: 620px;
  min-height: 520px;
  box-shadow: 0 4px 18px rgba(18, 78, 161, 0.06);
}

.clinic-map-container {
  width: 100%;
  height: 100%;
  z-index: 1;
}

@media (max-width: 991.98px) {
  .clinic-map-wrapper {
    position: relative;
    top: auto;
    height: 420px;
    margin-top: 16px;
  }
}

/* ---- MAP CUSTOM CONTROLS ---- */
.clinic-map-custom-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-ctrl-btn {
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1.5px solid #dce6f2;
  border-radius: 10px;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.map-ctrl-btn:hover {
  background: #f8fafc;
  color: #1868d4;
  border-color: #bcd7f8;
  transform: scale(1.05);
}

.map-ctrl-btn:active {
  transform: scale(0.96);
}

/* ---- CUSTOM MAP MARKERS (MATCHING SCREENSHOT) ---- */
/* Red/Pink Clinic Pin Badge */
.custom-clinic-marker {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transform: translate(-14px, -14px);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.16));
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-clinic-marker:hover,
.custom-clinic-marker.active {
  transform: translate(-14px, -14px) scale(1.12);
  z-index: 1000 !important;
}

.custom-clinic-marker .marker-pin-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f43f5e;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.875rem;
  flex-shrink: 0;
  z-index: 2;
}

.custom-clinic-marker:hover .marker-pin-dot,
.custom-clinic-marker.active .marker-pin-dot {
  background: #e11d48;
}

.custom-clinic-marker .marker-label-badge {
  background: #ffffff;
  border-radius: 20px;
  padding: 3px 10px 3px 14px;
  margin-left: -10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 1;
}

.custom-clinic-marker .marker-label-badge .dist-text {
  color: #64748b;
  font-weight: 500;
  font-size: 0.875rem;
}

/* User Location Marker (Blue Pulse) */
.custom-user-marker-wrapper,
.custom-clinic-marker-wrapper {
  background: transparent !important;
  border: none !important;
  overflow: visible !important;
}

.custom-user-marker {
  position: relative;
  display: inline-flex;
  align-items: center;
  transform: translate(-16px, -16px);
  cursor: default;
  white-space: nowrap;
}

.user-marker-radar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
  background: rgba(24, 104, 212, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.user-marker-radar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50% !important;
  border: 2px solid #1868d4;
  animation: radarPulse 2s infinite ease-out;
  box-sizing: border-box;
  transform-origin: center center;
  pointer-events: none;
}

.user-marker-dot {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
  background: #1868d4;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(24, 104, 212, 0.5);
  z-index: 2;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.user-marker-badge {
  background: #ffffff;
  border: 1px solid #c8dcf6;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1868d4;
  white-space: nowrap;
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(24, 104, 212, 0.15);
  flex-shrink: 0;
}

@keyframes radarPulse {
  0% { 
    transform: scale(0.8); 
    opacity: 1; 
  }
  100% { 
    transform: scale(2.2); 
    opacity: 0; 
  }
}

/* Leaflet Popup Styling */
.clinic-popup-card {
  font-family: 'Prompt', sans-serif;
  width: 230px;
}

.clinic-popup-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 8px;
}

.clinic-popup-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  line-height: 1.45;
}

.clinic-popup-addr {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 6px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clinic-popup-btn {
  display: block;
  text-align: center;
  background: #1868d4;
  color: #ffffff !important;
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 500;
  transition: background 0.2s;
}

.clinic-popup-btn:hover {
  background: #124da0;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(18, 78, 161, 0.15);
  border: 1px solid #dce6f2;
}

.leaflet-popup-content {
  margin: 8px;
  line-height: 1.4;
}

/* Empty state */
.clinic-empty-state {
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 18px;
  padding: 40px 20px;
  text-align: center;
}
