/* ── Healthy Finder v1.4.0 ─────────────────────────────────────────────────── */

#hf-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #2c2c2a;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Search Bar ────────────────────────────────────────────────────────────── */
.hf-search-bar {
  background: #fff;
  border: 1px solid #e0e0da;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ── Location Row ──────────────────────────────────────────────────────────── */
.hf-location-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.hf-location-row input[type="text"] {
  flex: 1; min-width: 200px; padding: 10px 14px;
  border: 1px solid #d0cfc8; border-radius: 8px; font-size: 15px; outline: none;
  transition: border-color 0.2s;
}
.hf-location-row input[type="text"]:focus { border-color: #1D9E75; box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }

.hf-location-row button {
  padding: 10px 18px; border-radius: 8px; border: 1px solid #d0cfc8;
  background: #fff; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.15s, border-color 0.15s; white-space: nowrap;
}
.hf-location-row button:hover { background: #f4f4f0; }

#hf-use-location-btn { background: #1D9E75; color: #fff; border-color: #1D9E75; }
#hf-use-location-btn:hover { background: #1E90FF; border-color: #1E90FF; }

#hf-search-btn { background: #1D9E75; color: #fff; border-color: #1D9E75; font-weight: 500; }
#hf-search-btn:hover { background: #0F6E56; border-color: #0F6E56; }

/* ── Name Filter Row ───────────────────────────────────────────────────────── */
.hf-name-row { margin-bottom: 12px; }
.hf-name-row input[type="text"] {
  width: 100%; padding: 10px 14px; border: 1px solid #d0cfc8; border-radius: 8px;
  font-size: 15px; outline: none; transition: border-color 0.2s; box-sizing: border-box;
}
.hf-name-row input[type="text"]:focus { border-color: #1D9E75; box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }

/* ── Radius Slider ─────────────────────────────────────────────────────────── */
.hf-radius-row { margin-bottom: 12px; }
.hf-radius-row label { display: block; font-size: 14px; color: #5f5e5a; margin-bottom: 8px; }
.hf-radius-row label strong { color: #1D9E75; }
.hf-radius-row input[type="range"] { width: 100%; accent-color: #1D9E75; cursor: pointer; height: 6px; }
.hf-radius-ticks { display: flex; justify-content: space-between; font-size: 11px; color: #888780; margin-top: 4px; }

/* ── Controls Row ──────────────────────────────────────────────────────────── */
.hf-controls-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}

.hf-category-tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.hf-tab {
  padding: 7px 16px; border-radius: 20px; border: 1px solid #d0cfc8;
  background: #fff; font-size: 13px; cursor: pointer; transition: all 0.15s; color: #444441;
}
.hf-tab:hover  { background: #f4f4f0; }
.hf-tab.active { background: #1D9E75; color: #fff; border-color: #1D9E75; font-weight: 500; }

.hf-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.hf-open-toggle {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: #444441; cursor: pointer; user-select: none;
}
.hf-open-toggle input[type="checkbox"] { accent-color: #1D9E75; width: 15px; height: 15px; cursor: pointer; }

#hf-sort {
  padding: 7px 12px; border-radius: 8px; border: 1px solid #d0cfc8;
  background: #fff; font-size: 13px; color: #444441; cursor: pointer; outline: none;
}
#hf-sort:focus { border-color: #1D9E75; }

/* ── Dietary Filter Section ────────────────────────────────────────────────── */
.hf-dietary-section { border-top: 1px solid #f0efe8; padding-top: 12px; }

.hf-dietary-label {
  font-size: 12px; font-weight: 600; color: #5f5e5a;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px;
}

.hf-dietary-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.hf-diet-btn {
  padding: 5px 12px; border-radius: 16px; border: 1px solid #d0cfc8;
  background: #fff; font-size: 12px; color: #444441; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.hf-diet-btn:hover  { background: #E1F5EE; border-color: #9FE1CB; color: #085041; }
.hf-diet-btn.active { background: #1D9E75; color: #fff; border-color: #1D9E75; font-weight: 500; }

/* ── Status Messages ───────────────────────────────────────────────────────── */
.hf-status { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 12px; border: 1px solid transparent; }
.hf-status-info    { background: #E6F1FB; color: #185FA5; border-color: #B5D4F4; }
.hf-status-error   { background: #FCEBEB; color: #A32D2D; border-color: #F7C1C1; }
.hf-status-warning { background: #FAEEDA; color: #854F0B; border-color: #FAC775; }
.hf-status-success { background: #E1F5EE; color: #0F6E56; border-color: #9FE1CB; }

/* ── Map ───────────────────────────────────────────────────────────────────── */
#hf-map { width: 100%; height: 400px; border-radius: 12px; margin-bottom: 20px; border: 1px solid #e0e0da; overflow: hidden; }

.hf-info-window          { font-size: 13px; max-width: 220px; }
.hf-info-window strong   { display: block; font-size: 14px; margin-bottom: 4px; }
.hf-info-window p        { margin: 2px 0; color: #5f5e5a; }
.hf-iw-cat               { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; }

/* ── Results Header ────────────────────────────────────────────────────────── */
#hf-results-header { font-size: 14px; color: #5f5e5a; margin-bottom: 14px; }

/* ── Results Grid ──────────────────────────────────────────────────────────── */
#hf-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.hf-no-results { color: #888780; font-size: 15px; text-align: center; padding: 40px 20px; grid-column: 1 / -1; }

/* ── Result Card ───────────────────────────────────────────────────────────── */
.hf-card {
  background: #fff; border: 1px solid #e0e0da; border-radius: 12px;
  overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; display: flex; flex-direction: column;
}
.hf-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }

.hf-card.hf-card-featured { border: 2px solid #EF9F27; box-shadow: 0 2px 12px rgba(239,159,39,0.15); }
.hf-card.hf-card-featured:hover { box-shadow: 0 6px 20px rgba(239,159,39,0.25); }

.hf-card.hf-card-verified { border-color: #1D9E75; }

/* ── Card Photo ────────────────────────────────────────────────────────────── */
.hf-card-photo-wrap { position: relative; }

.hf-card-photo { width: 100%; height: 160px; background-size: cover; background-position: center; background-color: #f1efe8; }

.hf-no-photo { display: flex; align-items: center; justify-content: center; color: #b4b2a9; font-size: 13px; }

.hf-more-photos-btn {
  position: absolute; bottom: 8px; right: 8px; padding: 5px 10px;
  background: rgba(0,0,0,0.55); color: #fff; border: none; border-radius: 6px;
  font-size: 11px; cursor: pointer; transition: background 0.15s;
}
.hf-more-photos-btn:hover { background: rgba(0,0,0,0.8); }

/* ── Card Body ─────────────────────────────────────────────────────────────── */
.hf-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 7px; }

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

.hf-card-name { font-size: 15px; font-weight: 600; margin: 0; color: #2c2c2a; line-height: 1.3; }

#hf-app .hf-card-name a,
#hf-app .hf-card-name a:visited {
  color: #1D9E75 !important; text-decoration: none !important;
  border-bottom: 1px solid #9FE1CB !important; pointer-events: auto !important; cursor: pointer !important;
}
#hf-app .hf-card-name a:hover { color: #085041 !important; border-bottom-color: #1D9E75 !important; }

.hf-badges-col { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }

.hf-card-desc { font-size: 13px; color: #5f5e5a; margin: 0; line-height: 1.5; }

.hf-card-address { font-size: 13px; color: #888780; margin: 0; }

.hf-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }

.hf-phone { font-size: 13px; color: #185FA5; text-decoration: none; }
.hf-phone:hover { text-decoration: underline; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.hf-badge { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 500; white-space: nowrap; }
.hf-cat-restaurant  { background: #E1F5EE; color: #085041; }
.hf-cat-grocery     { background: #E6F1FB; color: #0C447C; }
.hf-featured        { background: #FAEEDA; color: #633806; border: 1px solid #FAC775; }
.hf-verified-badge  { background: #E1F5EE; color: #0F6E56; border: 1px solid #9FE1CB; }

/* ── Stars ─────────────────────────────────────────────────────────────────── */
.hf-star       { font-size: 14px; }
.hf-star.full  { color: #EF9F27; }
.hf-star.half  { color: #EF9F27; opacity: 0.6; }
.hf-star.empty { color: #d3d1c7; }
.hf-rating-num { color: #5f5e5a; font-size: 13px; }
.hf-price      { color: #5f5e5a; letter-spacing: 0.05em; }
.hf-open       { color: #0F6E56; font-weight: 500; }
.hf-closed     { color: #A32D2D; }

/* ── Health Score Bar ──────────────────────────────────────────────────────── */
.hf-score-bar {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
}
.hf-score-label { font-size: 12px; color: #5f5e5a; white-space: nowrap; }
.hf-score-track {
  flex: 1; height: 6px; background: #e0e0da; border-radius: 3px; overflow: hidden;
}
.hf-score-fill {
  height: 100%; border-radius: 3px; background: linear-gradient(90deg, #9FE1CB, #1D9E75);
  transition: width 0.4s ease;
}
.hf-score-num { font-size: 12px; font-weight: 600; color: #1D9E75; white-space: nowrap; }

/* ── Dietary Tags on Card ──────────────────────────────────────────────────── */
.hf-diet-tags-row { display: flex; flex-wrap: wrap; gap: 4px; }

.hf-diet-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: #E1F5EE; color: #085041; border: 1px solid #9FE1CB; white-space: nowrap;
}

/* ── Try This Section ──────────────────────────────────────────────────────── */
.hf-try-this {
  background: #f9f8f5; border-radius: 8px; padding: 10px 12px;
  border: 1px solid #e8e6df;
}
.hf-try-title {
  font-size: 12px; font-weight: 600; color: #5f5e5a;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;
}
.hf-try-item { display: flex; flex-direction: column; margin-bottom: 5px; }
.hf-try-item:last-child { margin-bottom: 0; }
.hf-try-name { font-size: 13px; font-weight: 600; color: #2c2c2a; }
.hf-try-desc { font-size: 12px; color: #888780; margin-top: 1px; }

/* ── Card Action Buttons ───────────────────────────────────────────────────── */
.hf-card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }

.hf-card-actions button {
  flex: 1; min-width: 70px; padding: 7px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, color 0.15s; white-space: nowrap; text-align: center;
}

.hf-map-btn   { border: 1px solid #1D9E75; background: transparent; color: #1D9E75; }
.hf-map-btn:hover { background: #1D9E75; color: #fff; }

.hf-dir-btn   { border: 1px solid #185FA5; background: transparent; color: #185FA5; }
.hf-dir-btn:hover { background: #185FA5; color: #fff; }

.hf-share-btn { border: 1px solid #888780; background: transparent; color: #5f5e5a; }
.hf-share-btn:hover { background: #888780; color: #fff; }

/* ── Loader ────────────────────────────────────────────────────────────────── */
#hf-loader { flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; gap: 12px; color: #888780; font-size: 14px; }

.hf-spinner { width: 36px; height: 36px; border: 3px solid #e0e0da; border-top-color: #1D9E75; border-radius: 50%; animation: hf-spin 0.8s linear infinite; }
@keyframes hf-spin { to { transform: rotate(360deg); } }

/* ── Photo Modal ───────────────────────────────────────────────────────────── */
#hf-photo-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.hf-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.hf-modal-box { position: relative; z-index: 1; background: #fff; border-radius: 14px; padding: 24px; max-width: 680px; width: 90%; max-height: 85vh; overflow-y: auto; }
.hf-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 24px; cursor: pointer; color: #888780; line-height: 1; }
.hf-modal-close:hover { color: #2c2c2a; }
.hf-modal-title { font-size: 16px; font-weight: 600; margin: 0 0 16px; padding-right: 32px; }
.hf-modal-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.hf-modal-img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; background: #f1efe8; }
.hf-modal-loading { color: #888780; font-size: 14px; text-align: center; padding: 20px 0; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
#hf-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #2c2c2a; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; z-index: 999999; white-space: nowrap;
}
#hf-toast.hf-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #hf-map { height: 280px; }
  .hf-location-row { flex-direction: column; }
  .hf-location-row input[type="text"] { width: 100%; }
  .hf-controls-row { flex-direction: column; align-items: flex-start; }
  #hf-results-grid { grid-template-columns: 1fr; }
  .hf-modal-photos { grid-template-columns: 1fr 1fr; }
  .hf-card-actions button { min-width: 0; font-size: 11px; padding: 6px 6px; }
}
