/* ==========================================================================
   Restock Monitor — speels cartoon-landschap, volledig in CSS.
   Bewegende wolken, een zonnetje, glooiende heuvels en boompjes.
   ========================================================================== */

* { box-sizing: border-box; }

:root {
  --sky-top: #8fd3ff;
  --card: rgba(255, 255, 255, 0.94);
  --ink: #2b2f45;
  --grass: #6fc24a;
  --grass-dark: #4a9e2f;
  /* Pokémon-palet */
  --poke-red: #ee1515;
  --poke-red-dark: #b30f0f;
  --poke-yellow: #ffcb05;
  --poke-yellow-dark: #d9a900;
  --poke-blue: #3b4cca;
  --poke-blue-dark: #2a37a0;
  /* accent = Pikachu-geel, primary = Pokéball-rood */
  --accent: #ffcb05;
  --accent-dark: #d9a900;
  --primary: #ee1515;
  --primary-dark: #b30f0f;
  --shadow: 0 8px 24px rgba(40, 40, 80, 0.2);
  --radius: 18px;
  font-family: "Comic Sans MS", "Baloo 2", "Segoe UI", system-ui, sans-serif;
}

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  color: var(--ink);
  background: linear-gradient(180deg, #7cc7ff 0%, #a8e0ff 45%, #d6f3ff 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ----- Het decor ---------------------------------------------------------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Zonnetje met zachte gloed dat langzaam pulseert */
.sun {
  position: absolute;
  top: 6vh;
  right: 8vw;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff6a8, #ffd93b 70%);
  box-shadow: 0 0 60px 20px rgba(255, 217, 59, 0.55);
  animation: sun-pulse 6s ease-in-out infinite;
}

@keyframes sun-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Wolken: witte pluizen die van links naar rechts drijven */
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 100px;
  opacity: 0.95;
  filter: drop-shadow(0 6px 10px rgba(120, 160, 200, 0.25));
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
/* Bewust heel verschillende snelheden: cloud--1 scheurt voorbij, cloud--3 sloft. */
.cloud--1 { top: 12vh; width: 120px; height: 40px; animation: drift 26s linear infinite; }
.cloud--2 { top: 24vh; width: 90px;  height: 32px; animation: drift 70s linear infinite; animation-delay: -20s; transform: scale(0.85); }
.cloud--3 { top: 8vh;  width: 150px; height: 48px; animation: drift 115s linear infinite; animation-delay: -60s; }
.cloud--4 { top: 32vh; width: 70px;  height: 26px; animation: drift 44s linear infinite; animation-delay: -30s; opacity: 0.85; }

.cloud::before { width: 55%; height: 160%; top: -55%; left: 12%; }
.cloud::after  { width: 45%; height: 140%; top: -45%; right: 15%; }

@keyframes drift {
  from { left: -220px; }
  to   { left: 110vw; }
}

/* Bergketen achter de grond: een hazige verre keten + een scherpere voorste
   keten met besneeuwde toppen (witte band = sneeuwgrens). */
.mountains { position: absolute; bottom: 118px; left: 0; right: 0; height: 300px; }
.range {
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 110%;
}
/* verre keten — blauwig en vaag, voor diepte */
.range--back {
  height: 250px;
  bottom: 34px;
  background: linear-gradient(180deg, #eef4fa 0 9%, #a9bdd4 9% 55%, #8ea7c2 100%);
  clip-path: polygon(
    0% 100%, 6% 52%, 14% 74%, 24% 40%, 33% 66%, 44% 30%, 54% 62%,
    64% 38%, 74% 68%, 85% 46%, 94% 66%, 100% 48%, 100% 100%);
  opacity: 0.9;
  filter: blur(0.4px);
}
/* voorste keten — grijs-blauw gesteente met sneeuwtoppen */
.range--front {
  height: 240px;
  background: linear-gradient(180deg,
    #ffffff 0 13%, #8091a3 13% 34%, #6b7d90 34% 70%, #556579 100%);
  clip-path: polygon(
    0% 100%, 9% 46%, 17% 72%, 27% 22%, 38% 64%, 50% 12%, 62% 60%,
    73% 32%, 82% 66%, 91% 44%, 100% 62%, 100% 100%);
  filter: drop-shadow(0 6px 8px rgba(40, 60, 90, 0.18));
}

/* De grasgrond onderaan */
.ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 130px;
  background: linear-gradient(180deg, var(--grass) 0%, var(--grass-dark) 100%);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.18);
}

/* Boompjes in Pokémon/RPG-stijl: bossige gelaagde kroon met donkere rand,
   op een kort stammetje met een graspol eronder. Wiegt zachtjes. */
.tree {
  position: absolute;
  bottom: 95px;
  width: 96px;
  height: 132px;
  transform-origin: bottom center;
  animation: sway 5s ease-in-out infinite;
}
.tree .trunk {
  position: absolute;
  bottom: 0; left: 50%;
  width: 20px; height: 40px;
  margin-left: -10px;
  background:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,0.10) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, #8a5a2f, #a67141 55%, #7a4a24);
  border: 2px solid #5a3a1c;
  border-radius: 4px;
  z-index: 1;
}
.tree .trunk::after {  /* graspol aan de voet */
  content: "";
  position: absolute;
  bottom: -4px; left: 50%;
  width: 46px; height: 16px;
  margin-left: -23px;
  background: radial-gradient(circle at 50% 20%, #6fc24a, #4a9e2f);
  border-radius: 50% 50% 45% 45%;
  z-index: -1;
}
.tree .leaves {
  position: absolute;
  bottom: 34px; left: 50%;
  width: 88px; height: 84px;
  margin-left: -44px;
  background:
    radial-gradient(circle at 72% 74%, rgba(0,0,0,0.14) 0 18%, transparent 40%),
    radial-gradient(circle at 30% 66%, rgba(255,255,255,0.10) 0 14%, transparent 34%),
    radial-gradient(circle at 40% 32%, #86cf57, #59a637 66%, #4c8f2e 100%);
  border: 3px solid #37671f;
  border-radius: 48% 48% 46% 46%;
  box-shadow: 0 8px 14px rgba(40, 90, 30, 0.25);
  z-index: 2;
}
/* twee extra bladerkwabben erachter, voor een bossige, bobbelige omtrek */
.tree::before,
.tree::after {
  content: "";
  position: absolute;
  width: 52px; height: 52px;
  background: #5aa838;
  border: 3px solid #37671f;
  border-radius: 50%;
  z-index: 1;
}
.tree::before { top: 4px; left: 6px; }
.tree::after  { top: 8px; right: 6px; }
.tree--1 { left: 6vw;  transform: scale(1.1);  animation-delay: 0s; }
.tree--2 { left: 22vw; transform: scale(0.8);  animation-delay: -1.5s; }
.tree--3 { right: 10vw; transform: scale(1.25); animation-delay: -3s; }

@keyframes sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* Struikjes */
.bush {
  position: absolute;
  bottom: 100px;
  width: 90px; height: 45px;
  background: radial-gradient(circle at 50% 30%, #86d158, #5bb03a);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.bush--1 { left: 40vw; }
.bush--2 { right: 28vw; width: 70px; height: 36px; }

/* ----- CSS huisje 🏡 ------------------------------------------------------- */
.house {
  position: absolute;
  bottom: 92px;
  left: 47vw;
  width: 200px;
  height: 172px;
}

/* romp: houten muren met plank-lijnen */
.house__body {
  position: absolute;
  bottom: 0; left: 25px;
  width: 150px; height: 92px;
  background:
    repeating-linear-gradient(0deg,
      rgba(0,0,0,0.06) 0 1px, transparent 1px 15px),
    linear-gradient(180deg, #e0be80, #cda863);
  border: 3px solid #7a5a2a;
  border-radius: 3px;
  z-index: 2;
}

/* dak: oranje pannendak met tegel-textuur */
.house__roof {
  position: absolute;
  top: 0; left: 0;
  width: 200px; height: 84px;
  background:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,0.10) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(0deg,
      rgba(0,0,0,0.08) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, #f0813a, #d5621e);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  z-index: 3;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.18));
}

/* schoorsteen met rook */
.house__chimney {
  position: absolute;
  top: 6px; right: 46px;
  width: 22px; height: 56px;
  background: linear-gradient(90deg, #6b5750, #52413b);
  border: 3px solid #3a2d29;
  border-radius: 3px 3px 0 0;
  z-index: 2;
}
.house__chimney::after {  /* rand bovenop */
  content: "";
  position: absolute;
  top: -6px; left: -5px; right: -5px;
  height: 8px;
  background: #4a3b35;
  border-radius: 3px;
}
.smoke {
  position: absolute;
  top: -10px; left: 4px;
  width: 12px; height: 12px;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  opacity: 0;
  animation: puff 4s ease-in infinite;
}
.smoke--1 { animation-delay: 0s; }
.smoke--2 { animation-delay: 1.3s; left: 8px; }
.smoke--3 { animation-delay: 2.6s; left: 2px; }
@keyframes puff {
  0%   { transform: translate(0, 0) scale(0.5); opacity: 0; }
  20%  { opacity: 0.85; }
  100% { transform: translate(-14px, -55px) scale(1.6); opacity: 0; }
}

/* ramen: blauwe ruitjes met wit kruis */
.window {
  position: absolute;
  top: 14px;
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #bfe6fb 0 50%, #8fd0f0 50% 100%);
  border: 3px solid #f4f0e6;
  border-radius: 3px;
  box-shadow: 0 0 0 2px #5a4326;
  z-index: 3;
}
.window::before, .window::after {  /* het witte kruis */
  content: "";
  position: absolute;
  background: #f4f0e6;
}
.window::before { top: 50%; left: 0; right: 0; height: 3px; margin-top: -1.5px; }
.window::after  { left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; }
.window--l { left: 16px; }
.window--r { right: 16px; }

/* garagedeur (rood) */
.garage {
  position: absolute;
  bottom: 0; left: 18px;
  width: 52px; height: 42px;
  background:
    repeating-linear-gradient(0deg,
      rgba(0,0,0,0.12) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, #d84a3a, #b83322);
  border: 3px solid #7a2016;
  border-radius: 3px 3px 0 0;
  z-index: 3;
}

/* voordeur */
.door {
  position: absolute;
  bottom: 0; right: 24px;
  width: 28px; height: 42px;
  background: linear-gradient(180deg, #9a6a37, #7a5128);
  border: 3px solid #5a3c1e;
  border-radius: 5px 5px 0 0;
  z-index: 3;
}
.door::after {  /* deurknop */
  content: "";
  position: absolute;
  top: 50%; left: 5px;
  width: 5px; height: 5px;
  background: var(--poke-yellow);
  border-radius: 50%;
}

/* ----- Content-laag ------------------------------------------------------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 18px 200px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.topnav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { color: #2c3a4b; background: rgba(255,255,255,0.75); padding: 6px 12px; border-radius: 999px; }

.logo {
  margin: 0;
  font-size: 1.9rem;
  color: var(--poke-yellow);
  /* Blauwe outline zoals het klassieke Pokémon-logo */
  text-shadow:
     2px 2px 0 var(--poke-blue), -2px 2px 0 var(--poke-blue),
     2px -2px 0 var(--poke-blue), -2px -2px 0 var(--poke-blue),
     0 3px 0 var(--poke-blue-dark), 0 6px 10px rgba(0,0,0,0.25);
  letter-spacing: 0.5px;
  -webkit-text-stroke: 0.5px var(--poke-blue);
}
.subtitle { color: #5b6b7d; margin: 4px 0 18px; text-align: center; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 3px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
}
.card--center {
  max-width: 380px;
  margin: 10vh auto 0;
  text-align: center;
}
.card h2 { margin: 0 0 12px; font-size: 1.25rem; }
.hint { color: #6b7a8c; font-size: 0.9rem; margin: -4px 0 14px; }

/* Formulieren */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.row-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-form input { flex: 1 1 160px; }
.row-form input[type="number"] { flex: 0 0 90px; }

input {
  font: inherit;
  padding: 11px 14px;
  border: 2px solid #d7e3ee;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25); }

.btn {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: none;
  padding: 11px 18px;
  border-radius: 999px;
  transition: transform 0.08s ease, filter 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}
.btn:active { transform: translateY(2px); }
.btn--primary { background: linear-gradient(180deg, var(--primary), var(--primary-dark)); box-shadow: 0 4px 0 var(--primary-dark); }
.btn--primary:hover { filter: brightness(1.05); }
.btn--danger { background: linear-gradient(180deg, #ff7b7b, #e84f4f); box-shadow: 0 4px 0 #c53d3d; padding: 11px 14px; }
.btn--ghost { background: rgba(255,255,255,0.85); color: var(--ink); box-shadow: 0 3px 0 rgba(120,150,180,0.3); }
.btn--ghost:hover { background: #fff; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.alert--error { background: #ffe0e0; color: #b02a2a; }
.alert--ok { background: #dcf7dc; color: #2e7d32; }

/* Watch-lijst */
.watch-list { display: flex; flex-direction: column; gap: 12px; }
.watch {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: #fbfdff;
  border: 2px solid #e6eff7;
  flex-wrap: wrap;
}
.watch--paused { opacity: 0.6; }
.watch__status {
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 0.9rem;
}
.status--in_stock { background: #dcf7dc; color: #1f7a2e; }
.status--out_of_stock { background: #ffe2e2; color: #b02a2a; }
.status--unknown { background: #eef2f6; color: #6b7a8c; }
.watch__main { flex: 1 1 220px; min-width: 0; }
.watch__title { font-weight: 700; margin-bottom: 6px; word-break: break-word; }
.watch__meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.chip {
  font-size: 0.75rem;
  background: #eef4fa;
  color: #5b6b7d;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip--price { background: #fff2d6; color: #9a6b00; font-weight: 700; }
.chip--warn { background: #ffe0e0; color: #b02a2a; }
.chip--toggle { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.watch__url { font-size: 0.8rem; color: var(--primary-dark); word-break: break-all; text-decoration: none; }
.watch__url:hover { text-decoration: underline; }
.watch__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.watch__actions form { margin: 0; }

.empty { color: #7b8a9c; text-align: center; padding: 20px; }

.soft-hr { border: none; border-top: 2px dashed #e6eff7; margin: 18px 0 12px; }

/* Catalogus */
.catalog-set { margin-bottom: 18px; }
.catalog-set__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.catalog-set__head h3 { margin: 0; font-size: 1.05rem; }
.catalog-set__head form { margin: 0; }
.catalog-list { display: flex; flex-direction: column; gap: 6px; }
.catalog-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; background: #fbfdff; border: 2px solid #e6eff7; border-radius: 10px;
}
.catalog-item form { margin: 0; }
.catalog-item__label { font-weight: 600; color: var(--ink); text-decoration: none; word-break: break-word; }
.catalog-item__label:hover { text-decoration: underline; }
.btn--sm { padding: 6px 12px; }
.chip--ok { background: #dcf7dc; color: #2e7d32; font-weight: 700; }
.test-result { font-size: 0.88rem; font-weight: 600; color: #6b7a8c; }
.test-result--ok { color: #2e7d32; }
.test-result--err { color: #b02a2a; }

/* Speelse tabjes */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab-btn {
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  border: 3px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.7);
  color: #5b6b7d;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(120,150,180,0.25);
  transition: transform 0.08s ease, background 0.15s, color 0.15s;
}
.tab-btn:hover { background: #fff; }
.tab-btn:active { transform: translateY(2px); }
.tab-btn.is-active {
  background: linear-gradient(180deg, var(--poke-yellow), var(--poke-yellow-dark));
  color: var(--ink);
  border-color: var(--poke-blue);
  box-shadow: 0 4px 0 var(--poke-yellow-dark);
}
.tab-panel { display: none; animation: pop-in 0.25s ease; }
.tab-panel.is-active { display: block; }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Duidelijk interval-veld met inline label */
.interval-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef4fa;
  border: 2px solid #d7e3ee;
  border-radius: 12px;
  padding: 4px 12px 4px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #5b6b7d;
  white-space: nowrap;
}
.interval-field input {
  width: 68px;
  border: none;
  background: transparent;
  padding: 7px 4px;
  text-align: center;
  font-weight: 700;
}
.interval-field input:focus { box-shadow: none; }

/* Respecteer gebruikers die minder beweging willen */
@media (prefers-reduced-motion: reduce) {
  .cloud, .sun, .tree, .tab-panel, .smoke { animation: none !important; }
  .smoke { opacity: 0; }
}

/* Log-viewer */
.logbox {
  margin-top: 14px;
  background: #1e2a38;
  color: #d7e3ee;
  border-radius: 14px;
  padding: 14px;
  max-height: 55vh;
  overflow-y: auto;
  font-family: "Consolas", "SF Mono", monospace;
  font-size: 0.82rem;
}
.logline { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.log-ts { color: #8aa0b6; flex: 0 0 155px; }
.log-level { flex: 0 0 60px; text-transform: uppercase; font-weight: 700; }
.log-msg { flex: 1; word-break: break-word; }
.level--info .log-level { color: #7fb3ff; }
.level--change .log-level { color: #ffd93b; }
.level--alert .log-level { color: #6bff9d; }
.level--error .log-level { color: #ff8a8a; }

@media (max-width: 560px) {
  .log-ts { flex-basis: 110px; font-size: 0.7rem; }
  .logo { font-size: 1.5rem; }
}
