:root {
  --navy: #1f3a5f;
  --teal: #2e7d6b;
  --light: #eaf1ee;
  --gray: #5b5b5b;
  --bg: #faf9f6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: #1a1a1a;
}

header {
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: white;
  padding: 48px 24px 40px;
  text-align: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  max-width: 900px;
  margin-inline: auto;
  flex-wrap: wrap;
}

.mango-hero {
  width: 200px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.3));
  animation: mango-hero-in 0.6s ease-out;
}

@keyframes mango-hero-in {
  from { transform: translateY(-16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.header-text {
  text-align: center;
}

@media (min-width: 641px) {
  .header-text {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .mango-hero {
    width: 130px;
  }
}

header h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
}

header p {
  margin: 0;
  font-size: 18px;
  opacity: 0.9;
  max-width: 480px;
}

.prompt-hint {
  margin-top: 20px;
  font-size: 15px;
  opacity: 0.85;
}

main {
  max-width: 900px;
  margin: -24px auto 60px;
  padding: 0 20px;
}

.search-panel {
  background: white;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  padding: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.search-panel input[type="text"] {
  flex: 1 1 260px;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}

.search-panel select {
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background: white;
}

#subcategory-select {
  border-color: var(--teal);
}

#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border: 1px solid #eee;
}

.card.recommended {
  border-color: #e0b029;
  box-shadow: 0 2px 14px rgba(224,176,41,0.25);
}

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

.card h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--navy);
}

.premium-star {
  color: #e0b029;
}

.card-cat {
  margin: 2px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-desc {
  margin: 0 0 10px;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.card-meta {
  margin: 2px 0;
  font-size: 13px;
  color: var(--gray);
}

.card-meta a {
  color: var(--teal);
  text-decoration: none;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 600;
}

.badge-high { background: var(--light); color: var(--teal); }
.badge-medium { background: #fdf1dc; color: #9a6b12; }
.badge-recommended { background: #fdf1d0; color: #8a5e00; white-space: nowrap; }

.empty {
  grid-column: 1 / -1;
  color: var(--gray);
  text-align: center;
  padding: 40px 0;
}

.call-card {
  grid-column: 1 / -1;
  background: white;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
  border: 1px solid #eee;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.call-card h3 {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--navy);
}

.call-card .card-cat {
  margin-bottom: 10px;
}

.call-button {
  display: inline-block;
  margin-top: 14px;
  padding: 16px 28px;
  background: var(--teal);
  color: white;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(46,125,107,0.35);
  transition: transform 0.1s ease;
}

.call-button:active {
  transform: scale(0.97);
}

.call-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--gray);
}

footer {
  text-align: center;
  color: var(--gray);
  font-size: 13px;
  padding: 30px 20px 50px;
}

elevenlabs-convai {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* Mango mascot badge — top-right corner from page load on */
.mango-badge {
  position: fixed;
  top: 10px;
  right: 16px;
  width: 110px;
  height: auto;
  z-index: 9998;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
  pointer-events: none;
  animation: mango-badge-in 0.6s ease-out;
}

@keyframes mango-badge-in {
  from { transform: translateY(-16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 640px) {
  .mango-badge {
    width: 76px;
    top: 6px;
    right: 10px;
  }
}

/* Mango Fetch animation — brief overlay shown when a visitor taps
   "Tap to Open Website"; auto-dismisses itself (see app.js). */
.mango-fetch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
  animation: mango-fetch-fade-in 0.25s ease-out;
}

.mango-fetch-overlay[hidden] {
  display: none;
}

.mango-fetch-overlay video {
  width: min(90vw, 480px);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  display: block;
}

@keyframes mango-fetch-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

