/* zootrack-profiles: dezelfde profielstijl als de app (#916/#922).
   Maten volgen de app (IconDisc, StatTileGrid, ShowcaseSection, RankMedal).
   App-kleuren (merk, medailles, kaart) komen als variabelen uit badges.css,
   gegenereerd uit apps/ZooTrack/theme/colors.ts. */
:root {
  --brand-tint: #6fd0d6;
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(111, 208, 214, 0.32);
  --item-bg: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.8);
  --radius: 10px;
  --gap: 8px;
}

* { box-sizing: border-box; }

html { background: #041f22; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  background: linear-gradient(160deg, #0b5359 0%, #08373b 45%, #041f22 100%) fixed;
}

a { color: var(--brand-tint); }
img { display: block; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ── Iconen en rondjes (IconDisc) ───────────────────────────── */
.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }

.disc {
  flex: none;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.disc-sm { width: 40px; height: 40px; }
.disc-md { width: 52px; height: 52px; }
.disc-md .icon { width: 28px; height: 28px; }
.disc-flag { background: var(--item-bg); }
.disc-flag img { width: 100%; height: 100%; object-fit: cover; }

.flag {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  flex: none;
}
.country { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.country > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Kop ────────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}
.hero-text { min-width: 0; }
.hero h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; overflow-wrap: anywhere; }
/* Lange namen: kleiner, zodat ze niet midden in het woord afbreken. */
.hero h1.long { font-size: clamp(1rem, 5.2vw, 1.6rem); }
.hero-summary { margin: 6px 0 0; font-weight: 600; }
.hero-meta {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.avatar {
  flex: none;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.6rem;
}

/* ── Cijfertegels (StatTileGrid): 2 / 3 / 6 kolommen ───────── */
.tiles {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 12px;
}
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.tile-label { font-size: 0.78rem; opacity: 0.8; }

/* ── Secties (ShowcaseSection) ─────────────────────────────── */
.showcase { margin-top: 24px; scroll-margin-top: 16px; }
.showcase-head {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.showcase-action {
  flex: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.showcase-action:hover { text-decoration: underline; }
.showcase-title {
  margin: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
}
.title-icon { color: var(--brand-tint); display: inline-flex; }
.title-icon .icon { width: 24px; height: 24px; }
.title-icon.gold { color: var(--medal-gold); }

/* ── Zoo-avontuur: kaart, landen, weetjes ──────────────────── */
.journey { display: grid; gap: var(--gap); }

.map-card { overflow: hidden; background: var(--map-bg); }
.world-map { width: 100%; height: auto; display: block; }
.world-map .land { fill: var(--map-land); stroke: var(--map-land-stroke); }
.world-map .glow { fill: var(--map-glow); }
.world-map .dot { fill: var(--map-dot); }

.panel { padding: 16px; }
.big-stat { display: flex; align-items: center; gap: 12px; }
.big-stat > div { display: flex; flex-direction: column; }
.big-number { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.big-label { font-size: 0.9rem; opacity: 0.85; }
.sub-title { margin: 16px 0 8px; font-size: 0.95rem; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: flex; align-items: center; gap: 8px; }
.bar {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
}
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(16, 160, 170, 0.55);
  border-radius: 6px;
}
.bar .country { position: relative; font-size: 0.85rem; font-weight: 600; }
.bar-count { flex: none; font-weight: 700; font-size: 0.85rem; }
.w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; }
.w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
.w90 { width: 90%; } .w100 { width: 100%; }

.facts {
  margin-top: var(--gap);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.fact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}
.fact-text { display: flex; flex-direction: column; min-width: 0; }
.fact-value { font-weight: 800; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact-label { font-size: 0.78rem; opacity: 0.8; }

/* ── Badges (BadgeStrip): liggende kaartjes ────────────────── */
.badge-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.badge-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  min-height: 76px;
}
.badge-ring {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #606060;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge-ring img { width: 70%; height: 70%; object-fit: contain; }
.badge-overlay {
  position: absolute;
  bottom: -5px;
  right: -6px;
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--brand);
  font-weight: 800;
  font-size: 0.7rem;
  text-align: center;
}
.badge-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.badge-title { font-weight: 700; font-size: 0.85rem; line-height: 1.2; }
.badge-sub { font-size: 0.75rem; opacity: 0.75; }

/* ── Rangmedaille (RankMedal) ──────────────────────────────── */
.medal {
  flex: none;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.18);
}
.medal-gold { background: var(--medal-gold); color: var(--medal-text); }
.medal-silver { background: var(--medal-silver); color: var(--medal-text); }
.medal-bronze { background: var(--medal-bronze); color: var(--medal-text); }

/* ── Favoriete dieren: fotokaarten ─────────────────────────── */
.animal-cards, .zoo-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.animal-card { overflow: hidden; display: flex; flex-direction: column; }
.animal-photo {
  position: relative;
  aspect-ratio: 1 / 0.72;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.animal-photo img { width: 100%; height: 100%; object-fit: cover; }
.animal-photo .placeholder { width: 32px; height: 32px; opacity: 0.6; }
.medal-pos { position: absolute; top: 8px; left: 8px; }
.animal-name {
  padding: 8px 10px 10px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25;
  min-height: calc(2 * 1.25em + 18px);
  overflow-wrap: anywhere;
}

/* ── Favoriete dierentuinen (ZooCard): medaille, grote vlag, naam, stad, land ── */
.zoo-card { position: relative; padding: 12px; min-height: 96px; }
.zoo-medal { position: absolute; top: 8px; left: 8px; }
.zoo-row { display: flex; align-items: center; gap: 12px; padding-top: 28px; }
.flag-lg { width: 40px; height: 30px; border-radius: 4px; object-fit: cover; flex: none; }
.zoo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zoo-name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.zoo-sub { font-size: 0.8rem; color: var(--muted); }

/* ── Bezochte dierentuinen per land ────────────────────────── */
.visited {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
}
.visited { align-items: start; }
.visited-country summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.visited-country summary::-webkit-details-marker { display: none; }
.visited-country summary .country { flex: 1; }
.visited-count { flex: none; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.chevron {
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin: -4px 4px 0 4px;
  transition: transform 0.15s ease;
}
.visited-country[open] .chevron { transform: rotate(-135deg); margin-top: 4px; }
.visited-country summary:focus-visible { outline: 2px solid var(--brand-tint); outline-offset: -2px; border-radius: var(--radius); }
.zoo-list { list-style: none; margin: 0; padding: 0 16px 10px; }
.zoo-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.zoo-list li:first-child { border-top: 0; }
.other { margin: 12px 0 0; }

/* ── Eigen foto's (PhotosSection): 4:3, profiel 6 naast elkaar ── */
.photo-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
.photo-card { overflow: hidden; display: flex; flex-direction: column; }
.photo-img { display: block; aspect-ratio: 4 / 3; background: rgba(255, 255, 255, 0.08); }
.photo-img img { width: 100%; height: 100%; object-fit: cover; }
.photo-caption { padding: 8px 10px 10px; font-weight: 700; font-size: 0.85rem; line-height: 1.25; overflow-wrap: anywhere; }
.photo-card.linked .photo-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.photo-card.linked .photo-caption::after { content: ""; flex: none; width: 7px; height: 7px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); }
.photo-cards-all { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-small .avatar { width: 56px; height: 56px; font-size: 1.15rem; }
.hero-small .hero-meta a { color: var(--brand-tint); text-decoration: none; font-weight: 600; }

/* ── Links naar zoo-/dierpagina's ─────────────────────────── */
.card-link { display: block; height: 100%; color: inherit; text-decoration: none; border-radius: inherit; }
.animal-card .card-link { display: flex; flex-direction: column; }
.card-link:focus-visible { outline: none; }
.card.linked { transition: border-color 0.15s ease, transform 0.15s ease; }
.card.linked:hover { border-color: var(--brand-tint); }
.card.linked:focus-within { outline: 2px solid var(--brand-tint); outline-offset: 2px; }
/* Herkenbaar als link zonder aanwijzen (telefoon): pijltje rechts, zoals de
   ZooCard in de app; in de lijst ook de linkkleur. */
.zoo-card.linked .zoo-row { padding-right: 4px; }
.zoo-card.linked .zoo-text { flex: 1; }
.zoo-card.linked .zoo-row::after { content: ""; flex: none; width: 8px; height: 8px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); }
.animal-card.linked .animal-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.animal-card.linked .animal-name::after { content: ""; flex: none; width: 7px; height: 7px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); }
.zoo-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--brand-tint);
  text-decoration: none;
}
.zoo-list a::after { content: ""; flex: none; width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); opacity: 0.8; }
.zoo-list a:hover, .zoo-list a:focus-visible { text-decoration: underline; }

/* ── Voet ───────────────────────────────────────────────────── */
.footer { margin-top: 32px; text-align: center; }
.footer p { margin: 8px 0; }
.footer .rights { font-size: 0.75rem; opacity: 0.75; max-width: 560px; margin: 8px auto; }
.button {
  display: inline-block;
  background: var(--brand);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 22px;
}

.not-found { text-align: center; padding: 24px 16px; }

/* ── Telefoon: favorieten als zijwaarts scrollende rij (CardRow) ── */
@media (max-width: 767px) {
  .animal-cards, .zoo-cards {
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .animal-cards::-webkit-scrollbar, .zoo-cards::-webkit-scrollbar { display: none; }
  .animal-cards { grid-auto-columns: 42%; }
  .zoo-cards { grid-auto-columns: 72%; }
  .animal-card, .zoo-card { scroll-snap-align: start; }
}

@media (max-width: 767px) {
  .photo-cards:not(.photo-cards-all) {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 40%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .photo-cards:not(.photo-cards-all)::-webkit-scrollbar { display: none; }
  .photo-card { scroll-snap-align: start; }
}

/* ── Tablet en pc (zelfde grenzen als de app: 768 / 1024) ───── */
@media (min-width: 768px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .journey { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .badge-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .animal-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .zoo-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visited { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .photo-cards-all { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .photo-cards:not(.photo-cards-all) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .photo-cards-all { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .badge-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .animal-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .zoo-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .visited { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .tile-value { font-size: 1.35rem; }
  .avatar { width: 64px; height: 64px; font-size: 1.3rem; }
}
