/* ============================================================
   UCM HOLLAND — dark premium globe (variant A)
   Brand: orange #E87C24 / charcoal #4A4A4A / sky #65B1E3
   ============================================================ */
:root {
  --orange: #E87C24;
  --orange-dk: #C9661A;
  --sky: #65B1E3;
  --bg: #0d1016;
  --panel: rgba(22, 27, 36, 0.92);
  --panel-border: #2a3340;
  --muted: #8a93a0;
  --white: #f5f7fa;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(ellipse at 30% 18%,
      #1a2230 0%,
      #161d29 22%,
      #11161f 40%,
      #0d1016 58%,
      #0a0c11 78%,
      #05070b 100%);
  color: var(--white);
  overflow: hidden;
  user-select: none;
}
/* subtiele ruis-/dither-laag om kleurbanding (JPG-achtige vlekken) te voorkomen */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

#stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 60%, #cfe, transparent),
    radial-gradient(1px 1px at 40% 80%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 85% 25%, #fff, transparent),
    radial-gradient(1px 1px at 55% 15%, #bcd, transparent),
    radial-gradient(1px 1px at 12% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 92% 78%, #def, transparent);
  opacity: 0.55;
}

/* header */
header {
  position: relative; z-index: 5;
  display: flex; align-items: baseline; gap: 16px;
  padding: 28px 44px 6px;
}
.logo-img { height: 48px; width: auto; display: block; }
.subtitle { color: var(--muted); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.badge {
  position: absolute; top: 28px; right: 44px;
  border: 1px solid var(--orange); color: var(--orange);
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 20px;
}

/* stats */
.stats { position: absolute; left: 44px; bottom: 40px; z-index: 5; display: flex; gap: 44px; }
.stat .num { font-size: 38px; font-weight: 800; color: var(--orange); line-height: 1; }
.stat .lbl { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* globe canvas */
#globe { position: fixed; inset: 0; z-index: 1; cursor: grab; }
#globe:active { cursor: grabbing; }

/* hint */
.hint {
  position: absolute; left: 44px; bottom: 14px; z-index: 5;
  color: var(--muted); font-size: 11px; letter-spacing: 0.5px; text-align: left;
  opacity: 0.8; transition: opacity 0.4s;
}
.hint b { color: var(--white); }
.hint.hidden { opacity: 0; }

/* detail card */
#card {
  position: absolute; top: 50%; right: 44px; transform: translateY(-50%) translateX(30px);
  width: 430px; z-index: 8;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 16px; overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 70px rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
#card.open { opacity: 1; transform: translateY(-50%) translateX(0); pointer-events: auto; }
@keyframes cardGlow {
  0%   { box-shadow: 0 30px 70px rgba(0,0,0,0.55), 0 0 0 0 rgba(232,124,36,0),        0 0 0 0 rgba(232,124,36,0); }
  18%  { box-shadow: 0 30px 70px rgba(0,0,0,0.55), 0 0 0 1.5px rgba(232,124,36,0.6),  0 0 22px 4px rgba(232,124,36,0.75); }
  100% { box-shadow: 0 30px 70px rgba(0,0,0,0.55), 0 0 0 0 rgba(232,124,36,0),        0 0 0 0 rgba(232,124,36,0); }
}
#card.glow { animation: cardGlow 2.1s ease-in-out; }
.card-img-wrap { position: relative; height: 360px; background: #0a0d12; }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(22,27,36,0.9), transparent 45%);
}
.card-body { padding: 18px 22px 22px; }
.card-country { color: var(--orange); font-size: 12px; letter-spacing: 3px; font-weight: 700; text-transform: uppercase; }
.card-title { font-size: 22px; margin: 6px 0 16px; }
.row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid #232c38; font-size: 14px; }
.row span:first-child { color: var(--muted); }
.row b { font-weight: 600; }
.thumbs { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.thumbs img {
  width: 52px; height: 40px; object-fit: cover; border-radius: 6px;
  border: 2px solid transparent; cursor: pointer; opacity: 0.6; transition: 0.15s;
}
.thumbs img:hover { opacity: 1; }
.thumbs img.active { border-color: var(--orange); opacity: 1; }
.card-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,0.4); color: #fff; border: none;
  font-size: 18px; cursor: pointer; line-height: 28px;
}
.card-close:hover { background: var(--orange); }

/* ---- v2: visual-only card (specs hidden via /beheer) ----
   A large, photo-led card: the country name + the crane name, and one big photo.
   The spec rows, the delivered-count and the thumbnail strip are all hidden.
   Most crane photos are landscape, so the card is kept wide (50% of the screen)
   and a bit lower (80% of the height) to give the photo as much width as possible. */
#card.card-nospecs {
  width: 50vw;
  height: 80vh;
  max-height: 80vh;
  display: flex; flex-direction: column;
}
/* photo takes all remaining height after the small title block -> ~90% of screen */
#card.card-nospecs .card-img-wrap { flex: 1 1 auto; height: auto; min-height: 0; }
#card.card-nospecs .row,
#card.card-nospecs #cThumbs { display: none; }
#card.card-nospecs .card-body {
  padding: 16px 22px 20px;
  flex: 0 0 auto;
}
#card.card-nospecs .card-country { font-size: 14px; }
#card.card-nospecs .card-title { display: block; font-size: 24px; margin: 6px 0 0; }

/* country label tooltip on hover */
#tooltip {
  position: fixed; z-index: 7; pointer-events: none;
  background: rgba(10,13,18,0.92); border: 1px solid var(--panel-border);
  color: var(--white); font-size: 12px; padding: 5px 10px; border-radius: 6px;
  opacity: 0; transition: opacity 0.12s; white-space: nowrap;
}
#tooltip .t-count { color: var(--orange); }

/* footer */
footer {
  position: absolute; bottom: 14px; left: 0; right: 44px; z-index: 4;
  text-align: right; color: var(--muted); font-size: 11px; letter-spacing: 0.5px;
}
footer b { color: #b9c0c9; }

/* loading */
#loading {
  position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
  transition: opacity 0.5s; background: var(--bg);
}
#loading.hidden { opacity: 0; pointer-events: none; }

/* tour indicator */
#tourtag {
  position: absolute; top: 28px; left: 50%; transform: translateX(-50%); z-index: 5;
  color: var(--sky); font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  opacity: 0; transition: opacity 0.4s;
}
#tourtag.on { opacity: 0.85; }

/* narrow screens: hide footer label (right) and instruction hint (left) */
@media (max-width: 600px) {
  footer, .hint, .badge { display: none; }

  /* less margin/padding to the left/right edges */
  header { padding-left: 32px; padding-right: 32px; }
  .stats { left: 32px; }

  /* auto-pilot indicator: centred vertically in the 60px gap between the bottom
     of the screen and the bottom of the card. */
  #tourtag {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; height: 60px; transform: none;
    display: flex; align-items: center; justify-content: center;
  }

  /* The detail card becomes a bottom sheet: full width, anchored to the bottom
     of the screen and covering ~60% of its height. The globe (positioned from
     app.js) fills the free top 40%. */
  #card {
    top: auto; bottom: 60px; left: 20px; right: 20px;
    width: auto;
    transform: translateY(calc(100% + 60px));
    border-radius: 16px;
  }
  #card.open { transform: translateY(0); }

  /* Size to the photo + caption (no stretched empty area) and never grow past
     the screen, keeping the 60px gap at the bottom. */
  #card.card-nospecs {
    width: auto;
    height: auto;
    max-height: calc(100vh - 120px);
  }
  /* photo is a shorter landscape banner instead of filling the whole card */
  #card.card-nospecs .card-img-wrap { flex: 0 0 auto; height: 40vh; }
  #card.card-nospecs .card-body { flex: 0 0 auto; }
}
