/* ===============================
   IVO Core – Base Style
   =============================== */

:root{
  --bg:#000;
  --ui-bg: rgba(0,0,0,0.6);
  --ui-border: rgba(255,255,255,0.12);
  --ui-text:#fff;
  --ui-muted: rgba(255,255,255,0.7);
}

*{ box-sizing:border-box; }

html, body{
  margin:0;
  height:100%;
  background:var(--bg);
  overflow:hidden;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--ui-text);
}

/* Canvas */
canvas{
  position:fixed;
  inset:0;
  display:block;
}

/* Hover reveal zone (desktop) */
#hoverZone{
  position:fixed;
  left:0;
  top:0;
  width:18px;
  height:100vh;
  z-index:50;
  background:transparent;
}

/* UI container */
#ui{
  position:fixed;
  top:12px;
  left:12px;
  z-index:10;
  width:280px;
  max-width:80vw;
  padding:12px;

  background:var(--ui-bg);
  backdrop-filter: blur(8px);
  border:1px solid var(--ui-border);
  border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,0.35);

  transition: transform 160ms ease, opacity 160ms ease;
  will-change: transform, opacity;
}

#ui.hidden{
  transform: translateX(calc(-100% - 14px));
  opacity:0;
  pointer-events:none;
}

/* UI header */
#uiHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

#uiTitle{
  font-size:14px;
  font-weight:600;
  letter-spacing:0.2px;
  opacity:0.95;
  user-select:none;
}

#uiBtns{
  display:flex;
  gap:8px;
}

/* Buttons */
.btn{
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--ui-text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size:12px;
  user-select:none;
}
.btn:hover{
  background: rgba(255,255,255,0.18);
}

.btnPrimary{
  background: rgba(255,255,255,0.14);
}
.btnPrimary:hover{
  background: rgba(255,255,255,0.22);
}

/* Section headers */
.section{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,0.10);
  font-size:12px;
  font-weight:600;
  color:rgba(255,255,255,0.85);
  letter-spacing:0.3px;
}
.section:first-of-type{
  border-top:none;
  padding-top:0;
  margin-top:0;
}

/* Row layout: label line above the slider */
.row{
  display:block;
  margin:10px 0;
}

.labelLine{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin-bottom:6px;
}

.labelLine .label{
  font-size:12px;
  color:rgba(255,255,255,0.75);
}

.labelLine .val{
  font-size:12px;
  color:rgba(255,255,255,0.65);
  font-variant-numeric: tabular-nums;
}

/* Inputs */
input[type="range"]{
  width:100%;
  accent-color: rgba(255,255,255,0.75);
}

select{
  width:100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color:#fff;
  padding:8px 10px;
  border-radius:10px;
  outline:none;
}
select:focus{
  border-color: rgba(255,255,255,0.28);
}

/* Bottom-right Start + Screenshot */
#startControls{
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Mobile (mag blijven, maar project is desktop-only) */
@media (max-width:680px){
  #ui{
    width: calc(100vw - 16px);
    left: 8px;
    top: 8px;
    max-width: none;
  }
}
/* ===============================
   Collapsible Groups + UI Scroll
   =============================== */

/* Zorg dat het paneel intern kan scrollen op kleine schermen */
#ui{
  max-height: calc(100vh - 24px); /* top 12px + bottom 12px */
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Maak scrollbars subtiel (werkt in moderne browsers) */
#ui{
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}
#ui::-webkit-scrollbar{ width: 10px; }
#ui::-webkit-scrollbar-track{ background: transparent; }
#ui::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
#ui::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.26);
  background-clip: padding-box;
}

/* Klikbare section headers + pijltje */
.section.collapsible{
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section.collapsible::after{
  content: "▾";
  opacity: 0.6;
  font-size: 12px;
  line-height: 1;
}

/* Dichtgeklapt: andere pijl + content verbergen */
.group[data-open="false"] .section.collapsible::after{
  content: "▸";
}

.group[data-open="false"] .groupContent{
  display: none;
}
/* ===============================
   Select / Dropdown dark fix
   =============================== */

/* De select zelf (gesloten) */
#ui select{
  background: #0b0b0b;
  color: #e6e6e6;
  border: 1px solid rgba(255,255,255,0.18);
}

/* De opties (opengeklapt menu) */
#ui select option{
  background: #0b0b0b;
  color: #e6e6e6;
}

/* Hover / geselecteerde optie */
#ui select option:hover,
#ui select option:checked{
  background: #1a1a1a;
  color: #ffffff;
}
