@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Manrope:wght@500;600;700;800;900&display=swap');

:root {
  --bg-dark: #030d17;
  --bg-gradient-top: #123452;
  --bg-gradient-mid: #06182a;
  --gold-primary: #ffb000;
  --gold-light: #ffd166;
  --gold-dark: #d48200;
  --gold-border: #f59e0b;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  --accent-green: #16a34a;
  --text-white: #f8fafc;
  --text-muted: #8e9fab;
  --text-dark: #081d31;
  --card-bg: rgba(7, 26, 43, 0.96);
  --card-border: rgba(245, 158, 11, 0.95);
  --font-manrope: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-dmsans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-dmsans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  min-height: 100vh;
}

button, input {
  font-family: inherit;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  background: none;
}

/* Mobile Shell Wrapper */
.mobile-viewport {
  min-height: 100vh;
  background: radial-gradient(ellipse 90% 60% at 50% -5%, var(--bg-gradient-top) 0%, var(--bg-gradient-mid) 45%, var(--bg-dark) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

/* Simulated Mobile Status Bar (9:41, wifi, battery) */
.mobile-status-bar {
  width: min(100%, 460px);
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  z-index: 10;
  opacity: 0.92;
}

.status-time {
  font-family: var(--font-manrope);
  font-weight: 700;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-icon {
  width: 16px;
  height: 12px;
  fill: currentColor;
}

.battery-icon {
  width: 22px;
  height: 12px;
}

/* App Main Container (Max 440px wide for native mobile feel) */
.app-container {
  width: min(100%, 440px);
  padding: 6px 18px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}

/* Header & Brand Emblem */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 4px;
  margin-bottom: 20px;
}

.emblem-container {
  width: 230px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.sulky-emblem-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(255, 176, 0, 0.28));
}

.main-logo-text {
  font-family: var(--font-manrope);
  font-size: 35px;
  font-weight: 900;
  letter-spacing: -1.2px;
  line-height: 1.1;
  margin-top: -8px;
  margin-bottom: 8px;
}

.logo-white {
  color: #ffffff;
}

.logo-gold {
  color: var(--gold-primary);
  text-shadow: 0 0 16px rgba(255, 176, 0, 0.4);
}

.logo-tld {
  color: #e2e8f0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.main-tagline {
  color: #d1dde8;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 500;
  text-align: center;
}

.tagline-highlight {
  color: var(--gold-primary);
  font-weight: 800;
}

/* Floating White Pill Search Bar */
.search-section {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
  z-index: 20;
}

.search-pill-box {
  width: 100%;
  height: 56px;
  background: #ffffff;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  padding: 4px 6px 4px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15);
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.search-pill-box:focus-within {
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5), 0 0 0 2.5px rgba(255, 176, 0, 0.7);
}

.search-lens-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d263f;
  flex-shrink: 0;
}

.search-lens-icon {
  width: 22px;
  height: 22px;
}

.search-input {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-style: italic;
  font-weight: 500;
  color: #0b2239;
  background: transparent;
}

.search-input::placeholder {
  color: #8c9fae;
  font-style: italic;
  font-size: 13px;
}

.search-submit-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  flex-shrink: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.search-submit-btn:hover {
  filter: brightness(1.08);
  transform: scale(1.03);
}

.search-submit-btn:active {
  transform: scale(0.96);
}

.arrow-icon {
  width: 21px;
  height: 21px;
}

/* Autocomplete Suggestions Dropdown */
.suggestions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.suggestion-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  transition: background 0.15s ease;
  color: #0f172a;
}

.suggestion-row:hover {
  background: #f1f5f9;
}

.sugg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #0f2742;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sugg-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sugg-name {
  font-size: 13px;
  font-weight: 700;
  color: #0b1f33;
  letter-spacing: 0.2px;
}

.sugg-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.empty-suggestions {
  padding: 14px;
  text-align: center;
  color: #64748b;
  font-size: 12.5px;
}

/* Category Tags */
.category-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.category-tag.etalon {
  background: #fee2e2;
  color: #b91c1c;
}

.category-tag.jument,
.category-tag.mare {
  background: #ede9fe;
  color: #6d28d9;
}

.category-tag.carriere,
.category-tag.baby {
  background: #dcfce7;
  color: #15803d;
}

/* ===================================================
   THE RESULT BOX (Matches visual reference directly)
   =================================================== */
.result-container {
  width: 100%;
  margin-bottom: 24px;
  animation: resultReveal 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes resultReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-gold-card {
  width: 100%;
  background: linear-gradient(165deg, rgba(14, 38, 62, 0.98) 0%, rgba(4, 18, 30, 0.98) 100%);
  border: 1.5px solid var(--card-border);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(245, 158, 11, 0.05);
  position: relative;
  overflow: hidden;
}

.result-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

/* Horse Portrait (Left Column) */
.horse-portrait-wrap {
  width: 124px;
  height: 124px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: #061524;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.horse-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.portrait-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Horse Metadata (Right Column) */
.horse-meta-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.horse-title-name {
  font-family: var(--font-manrope);
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  line-height: 1.15;
  margin-bottom: 8px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges Row */
.badges-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
}

.badge-pill {
  width: 100%;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-manrope);
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  padding: 0 8px;
  white-space: nowrap;
}

/* Category Pill (Red as shown in visual reference for Etalon) */
.cat-pill.etalon {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.cat-pill.jument,
.cat-pill.mare {
  background: #7c3aed;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.cat-pill.carriere,
.cat-pill.baby {
  background: #16a34a;
  color: #ffffff;
  font-size: 11.5px;
  letter-spacing: -0.1px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

/* Grade Pill (Dark navy with subtle border) */
.grade-pill {
  background: #092238;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 15px;
}

.badge-sub-label {
  font-size: 9.5px;
  color: #8da1b3;
  margin-top: 4px;
  font-weight: 500;
  text-align: center;
}

/* Star System Rating Row */
.stars-row {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

.star-glyph {
  font-size: 26px;
  line-height: 1;
}

.star-full {
  color: var(--gold-primary);
  text-shadow: 0 0 10px rgba(255, 176, 0, 0.35);
}

.star-half {
  background: linear-gradient(90deg, var(--gold-primary) 50%, #3e5063 50%);
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

.star-empty {
  color: #3e5063;
}

/* Bottom "Statistiques détaillées" White Pill Button */
.details-pill-btn {
  width: 100%;
  height: 48px;
  background: #ffffff;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: #0a1f33;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.details-pill-btn:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.details-pill-btn:active {
  transform: translateY(0);
}

.btn-left-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-icon {
  width: 22px;
  height: 22px;
  color: #0a1f33;
  flex-shrink: 0;
}

.btn-title-text {
  font-family: var(--font-manrope);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.chevron-icon {
  width: 20px;
  height: 20px;
  color: #0a1f33;
  transition: transform 0.2s ease;
}

.chevron-open {
  transform: rotate(90deg);
}

/* Expandable Statistics Drawer */
.stats-drawer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  animation: slideDown 0.22s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stats-kicker {
  font-size: 9.5px;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: var(--gold-light);
}

.stats-badge-tag {
  font-size: 9.5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 7px;
  border-radius: 5px;
  color: #cbd5e1;
}

.ranking-badge-line {
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 600;
}

.gold-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.stat-card-box {
  background: rgba(3, 14, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
}

.stat-label {
  display: block;
  font-size: 9.5px;
  color: #8da1b3;
  margin-bottom: 3px;
}

.stat-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.stats-footer-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  color: #8da1b3;
}

.stats-footer-meta strong {
  color: #e2e8f0;
}

/* ===================================================
   TOP 10 - RECHERCHES DU MOIS (Step #2)
   =================================================== */
.top10-section {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 30px;
}

.top10-header-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.top10-title-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-manrope);
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.gold-chart-icon {
  width: 18px;
  height: 18px;
  color: var(--gold-primary);
  flex-shrink: 0;
}

/* Top 10 Card Container */
.top10-card {
  width: 100%;
  background: rgba(5, 20, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top10-row {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #d1dde8;
  text-align: left;
  transition: background 0.15s ease, transform 0.1s ease;
  gap: 12px;
}

.top10-row:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

/* #1 Booster Winner - Highlighted in Gold Gradient */
.top10-row.top10-first {
  background: linear-gradient(90deg, #ffb000 0%, #e08c00 100%);
  color: #07192b;
  box-shadow: 0 4px 14px rgba(255, 176, 0, 0.3);
}

.top10-row.top10-first .rank-badge {
  background: #ffe394;
  color: #07192b;
}

.top10-row.top10-first .rank-horse-name {
  color: #07192b;
  font-weight: 800;
}

.top10-row.top10-first .rank-select-arrow {
  color: #07192b;
}

.rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-manrope);
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
  flex-shrink: 0;
}

.rank-horse-name {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.rank-select-arrow {
  font-size: 16px;
  color: #64748b;
  opacity: 0.6;
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
}

.footer-brand {
  font-family: var(--font-manrope);
  font-weight: 800;
  color: #ffffff;
}

.gold-text {
  color: var(--gold-primary);
}

.footer-dot {
  color: #64748b;
}

.footer-link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--gold-primary);
}

.footer-copy {
  font-size: 10px;
  color: #64748b;
  margin-top: 6px;
}

/* ===================================================
   TECHNICAL DIAGNOSTIC PAGE (/database-check)
   =================================================== */
.tech-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(ellipse at 50% 0%, #123b5b, #06182a 55%, #03111e);
}

.tech-card {
  width: min(100%, 520px);
  border: 1px solid rgba(255, 176, 0, 0.35);
  background: rgba(5, 24, 40, 0.94);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
}

.back-link {
  color: #b6c8d8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.back-link:hover {
  color: var(--gold-primary);
}

.tech-brand {
  font-family: var(--font-manrope);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  margin-top: 20px;
}

.tech-brand span {
  color: var(--gold-primary);
}

.tech-brand small {
  font-size: 12px;
  color: #b8c9d8;
  margin-left: 3px;
}

.tech-kicker {
  color: var(--gold-primary);
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 800;
  margin: 20px 0 6px;
}

.tech-card h1 {
  font-family: var(--font-manrope);
  font-size: 24px;
  letter-spacing: -0.5px;
  margin: 0;
  color: #ffffff;
}

.tech-description {
  color: #a7bacb;
  font-size: 13px;
  line-height: 1.6;
  margin: 10px 0 20px;
}

.tech-description code {
  color: #ffe0a0;
  background: rgba(255, 176, 0, 0.12);
  padding: 2px 5px;
  border-radius: 4px;
}

.tech-status {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.tech-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.tech-status.success .tech-status-dot {
  background: #50d99b;
  box-shadow: 0 0 10px #50d99b;
}

.tech-status.warning .tech-status-dot {
  background: var(--gold-primary);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.5);
}

.tech-status strong {
  font-size: 13px;
  color: #ffffff;
}

.tech-status p {
  font-size: 12px;
  color: #a7bacb;
  margin: 4px 0 0;
  line-height: 1.4;
}

.tech-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  color: #a7bacb;
}

.tech-detail strong {
  color: #e6edf3;
  font-weight: 600;
}

.tech-checklist {
  margin-top: 20px;
}

.tech-checklist > strong {
  font-size: 12.5px;
  color: #ffffff;
}

.tech-checklist ul {
  padding-left: 18px;
  color: #a7bacb;
  font-size: 11.5px;
  line-height: 1.8;
  margin-top: 6px;
}

.tech-checklist li::marker {
  color: var(--gold-primary);
}

.tech-footnote {
  font-size: 10px;
  line-height: 1.5;
  color: #6f879c;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  margin: 20px 0 0;
}