/* =========================
   Reality Node Community Dashboard
   ========================= */

:root{
  --bg0: #06101f;
  --bg1: rgba(255,255,255,0.04);
  --bg2: rgba(255,255,255,0.06);
  --bd1: rgba(255,255,255,0.10);
  --bd2: rgba(255,255,255,0.16);
  --txt: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --muted2: rgba(255,255,255,0.58);

  --good: #2ecc71;
  --bad: #ff4d4d;
  --warn: #f7c948;

  --shadow: 0 18px 60px rgba(0,0,0,0.38);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(46,204,113,0.08), transparent 60%),
    radial-gradient(900px 520px at 80% 0%, rgba(247,201,72,0.06), transparent 55%),
    var(--bg0);
  color: var(--txt);
}

a{ color: inherit; }
.small{ font-size: 12px; color: var(--muted2); }
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

/* =========================
   TOPBAR
   ========================= */

.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(6,16,31,0.72);
  backdrop-filter: blur(10px);
}

.title{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 320px;
}

.titleMain{
  font-weight: 900;
  letter-spacing: .1px;
}

.dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(247,201,72,0.9), rgba(46,204,113,0.85));
  box-shadow: 0 0 0 4px rgba(247,201,72,0.08);
}

.actions{ flex: 0 0 auto; }

.actionsRow{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.times{
  text-align:right;
  line-height:1.25;
  margin-top: 2px;
}

/* =========================
   CENTER NAV (single source of truth)
   ========================= */

.topnav{
  flex: 1 1 auto;
  display:flex;
  justify-content:center;
  align-items:center;
  min-width: 220px;
}

.topnavInner{
  display:inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
}

/* default = inactive (neutral) */
.navLink{
  position: relative;
  display:inline-flex;
  align-items:center;
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none !important;
  font-weight: 900;
  font-size: 13px;
  color: rgba(255,255,255,0.68);
  border: 1px solid transparent;
  background: transparent;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
}

.navLink:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
}

/* active = green */
.navLink.isActive{
  background: rgba(46,204,113,0.12);
  border-color: rgba(46,204,113,0.35);
  color: rgba(255,255,255,0.96);
}

/* optional: tiny separator dot look between items */
.topnavInner .navLink + .navLink::before{
  content:"";
  position:absolute;
  left: -2px;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  transform: translate(-50%, -50%);
}

/* =========================
   CONTAINER / SECTIONS
   ========================= */

main.container{
  padding-bottom: 160px;
}

.container{
  max-width: 1240px;
  margin: 18px auto 28px auto;
  padding: 0 16px;
}

.pageSection{
  scroll-margin-top: 92px;
  margin-bottom: 22px;
}

.sectionTitle{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 12px;
  margin: 14px 0 10px;
  font-weight: 900;
}

.sectionTitle > div:first-child{ font-size: 16px; }

.sectionHint{
  font-size: 12px;
  color: var(--muted2);
  font-weight: 700;
}

/* =========================
   GRID / CARDS
   ========================= */

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1100px){
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px){
  .grid{ grid-template-columns: 1fr; }
}

.card{
  position: relative; /* needed for glow pseudo */
  background: var(--bg1);
  border: 1px solid var(--bd1);
  border-radius: 12px;
  overflow:hidden;
  box-shadow: 0 8px 26px rgba(0,0,0,0.22);
}

.cardHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 12px 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cardBody{ padding: 10px 12px 12px; }

.hostLine{
  display:flex;
  flex-direction:column;
  gap: 2px;
  min-width: 0;
}
.hostName{
  font-weight: 950;
  letter-spacing: .1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hostSub{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hostUrl{
  font-size: 12px;
  color: var(--muted2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================
   DETAILS
   ========================= */

details{
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow:hidden;
}

summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 10px;
}

summary::-webkit-details-marker{ display:none; }

.sumLeft{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap: 2px;
}
.sumTitle{
  font-weight: 900;
  font-size: 13px;
}

/* allow chip + version wrap */
.sumMeta{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted2);
}

.sumSep{
  color: rgba(255,255,255,0.35);
  font-weight: 900;
}

.chev{
  color: var(--muted2);
  font-weight: 900;
  transform: translateY(-1px);
}
details[open] summary .chev{ transform: rotate(180deg); }

.content{ padding: 0 10px 10px 10px; }

pre{
  margin: 10px 0 0 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  overflow:auto;
  max-height: 320px;
}

/* =========================
   KV
   ========================= */

.kv{
  display:grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.18);
}
.k{
  font-size: 12px;
  color: var(--muted2);
  font-weight: 800;
}
.v{
  font-size: 12px;
  color: rgba(255,255,255,0.88);
  word-break: break-word;
}

/* =========================
   FOOTER LINE ON CARDS
   ========================= */

.footer{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  margin-top: 10px;
}

.tag{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

/* =========================
   STATUS PILL + LED
   ========================= */

.statusPill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.86);
  font-size: 12px;
  user-select:none;
  white-space: nowrap;
}

.statusPillTight{
  padding: 6px 10px;
  gap: 8px;
}

.pillStrong{ font-weight: 900; }

.led{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.led.good{
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.12);
}
.led.bad{
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(255,77,77,0.12);
}
.led.warn{
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(247,201,72,0.14);
}
.ledGlow{
  box-shadow: 0 0 0 4px rgba(46,204,113,0.10);
}

/* Spinner control via class */
.spinIcon{
  display:inline-grid;
  place-items:center;
  width: 14px;
  height: 14px;
}
.isSpinning{
  animation: rnSpin .9s linear infinite;
}

/* =========================
   ERROR BOX / NOTE BOX
   ========================= */

.errorBox{
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,77,77,0.35);
  background: rgba(255,77,77,0.06);
}
.errorTitle{
  font-weight: 900;
  margin-bottom: 4px;
}

.noteBox{
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(247,201,72,0.30);
  background: rgba(247,201,72,0.06);
}
.noteTitle{
  font-weight: 900;
  margin-bottom: 6px;
}

.hintLine{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted2);
}

/* =========================
   FOOTER BAR
   ========================= */

.footerBar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.20);
}

.footerLeft, .footerRight{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted2);
  font-size: 12px;
}

.footerTag{
  display:inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight: 800;
}

/* =========================
   FAB + MODAL
   ========================= */

.luukFab{
  position: fixed;
  right: 16px;
  bottom: 80px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  cursor:pointer;
  display:grid;
  place-items:center;
  transition: transform .12s ease, background .12s ease;
  z-index: 60;
}
.luukFab:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,0.09);
}
.luukFab img{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
}

.luukModal{
  position: fixed;
  inset: 0;
  display:none;
  z-index: 80;
}
.luukModal.isOpen{ display:block; }

.luukModalOverlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

.luukModalCard{
  position:absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 28px));
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(6,16,31,0.92);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.luukModalClose{
  position:absolute;
  right: 10px;
  top: 8px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.86);
  font-size: 20px;
  cursor:pointer;
}

.luukModalHeader{
  display:flex;
  gap: 12px;
  padding: 14px;
  align-items:center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.luukModalAvatar{
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.12);
}

.luukModalHeaderText{
  display:flex;
  flex-direction:column;
  gap: 2px;
}

.luukModalName{
  font-weight: 950;
  font-size: 16px;
}

.luukModalBadge{
  display:inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(46,204,113,0.28);
  background: rgba(46,204,113,0.08);
  color: rgba(255,255,255,0.86);
  font-size: 12px;
  font-weight: 900;
}

.luukModalText{
  padding: 12px 14px 0 14px;
  color: rgba(255,255,255,0.82);
  font-size: 13px;
}

.luukModalMedia{ padding: 12px 14px; }
.luukModalMedia video{
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.35);
}

.luukModalActions{
  padding: 0 14px 14px 14px;
  display:flex;
  gap: 10px;
}

.luukModalBtn{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  text-decoration:none;
  font-weight: 900;
  font-size: 13px;
  transition: transform .12s ease, background .12s ease;
}
.luukModalBtn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.09);
}

/* =========================
   ANIMATIONS
   ========================= */

@keyframes rnSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* =========================
   SHIMMER / GLOW BY STATE (tone-*)
   ========================= */

.card.tone-good{
  border-color: rgba(46,204,113,0.22);
  box-shadow:
    0 8px 26px rgba(0,0,0,0.22),
    0 0 0 1px rgba(46,204,113,0.06) inset;
}
.card.tone-warn{
  border-color: rgba(247,201,72,0.20);
  box-shadow:
    0 8px 26px rgba(0,0,0,0.22),
    0 0 0 1px rgba(247,201,72,0.06) inset;
}
.card.tone-bad{
  border-color: rgba(255,77,77,0.22);
  box-shadow:
    0 8px 26px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,77,77,0.06) inset;
}

.card.tone-good::before,
.card.tone-warn::before,
.card.tone-bad::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: 12px;
  pointer-events:none;
  opacity: 0.0;
  transition: opacity .18s ease;
}

.card.tone-good::before{ box-shadow: 0 0 28px rgba(46,204,113,0.18); }
.card.tone-warn::before{ box-shadow: 0 0 28px rgba(247,201,72,0.16); }
.card.tone-bad::before{  box-shadow: 0 0 28px rgba(255,77,77,0.16); }

.card.tone-good:hover::before,
.card.tone-warn:hover::before,
.card.tone-bad:hover::before{
  opacity: 1;
}

/* =========================
   State chip in summary
   ========================= */

.stateChip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  font-weight: 900;
  font-size: 12px;
  color: rgba(255,255,255,0.88);
}

.stateChip .dotMini{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
}

.stateChip.good{
  border-color: rgba(46,204,113,0.25);
  background: rgba(46,204,113,0.10);
}
.stateChip.good .dotMini{ background: var(--good); }

.stateChip.warn{
  border-color: rgba(247,201,72,0.22);
  background: rgba(247,201,72,0.10);
}
.stateChip.warn .dotMini{ background: var(--warn); }

.stateChip.bad{
  border-color: rgba(255,77,77,0.25);
  background: rgba(255,77,77,0.10);
}
.stateChip.bad .dotMini{ background: var(--bad); }

/* =========================
   Getting Started image + Info text
   ========================= */

.soonImg{
  max-width: 700px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  display:block;
}

.soonHint{ margin-top: 30px; }

.infoBox{ padding: 14px; }

.infoText{
  margin: 8px 0;
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  line-height: 1.55;
}

/* =========================
   TOPBAR: Mobile Fix
   ========================= */

/* allow children to actually shrink (important for flex overflow) */
.title, .actions, .topnav, .topnavInner, .times { min-width: 0; }

/* make topbar wrap on small screens */
@media (max-width: 900px){
  .topbar{
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  /* row 1: title full width */
  .title{
    flex: 1 1 100%;
    min-width: 0;
  }

  /* row 2: nav takes full width, centered */
  .topnav{
    flex: 1 1 100%;
    order: 3;
    justify-content: center;
  }

  /* row 3: actions full width, right aligned */
  .actions{
    flex: 1 1 100%;
    order: 4;
  }

  .actionsRow{
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  /* times should not force overflow */
  .times{
    text-align: right;
    white-space: nowrap;
  }
}

/* tighter phones: stack actions nicely + allow nav to scroll if needed */
@media (max-width: 520px){
  .topnavInner{
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topnavInner::-webkit-scrollbar{ display:none; }

  .navLink{
    flex: 0 0 auto;
    padding: 8px 12px;
  }

  /* make title not too wide */
  .title{
    min-width: 0;
  }
  .titleMain{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* actions: badges wrap and don't push out */
  .statusPill{
    max-width: 100%;
  }
}

/* =========================
   Topbar wrap ab 1450px
   ========================= */

@media (max-width: 1450px){
  .topbar{
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  /* Title full row */
  .title{
    flex: 1 1 100%;
    min-width: 0;
  }

  /* Nav centered, own row */
  .topnav{
    flex: 1 1 100%;
    order: 3;
    justify-content: center;
  }

  /* Actions below */
  .actions{
    flex: 1 1 100%;
    order: 4;
  }

  .actionsRow{
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    row-gap: 8px;
  }
}


/* =========================
   Mobile: compact topbar
   ========================= */

@media (max-width: 900px){
  .topbar{
    padding: 10px 12px;
  }

  /* title row tighter */
  .title{
    gap: 8px;
  }
  .dot{
    width: 10px;
    height: 10px;
  }
  .titleMain{
    font-size: 15px;
    line-height: 1.15;
  }
  #lastUpdated{
    margin-top: 2px;
  }

  /* nav tighter */
  .topnavInner{
    padding: 3px;
  }
  .navLink{
    padding: 7px 11px;
    font-size: 12px;
  }

  /* actions tighter */
  .statusPill{
    padding: 7px 10px;
  }
  .statusPillTight{
    padding: 6px 10px;
  }
  .times{
    font-size: 11px;
    line-height: 1.15;
    margin-top: 0;
  }
}

/* very small phones: hide times to reduce header height a lot */
@media (max-width: 520px){
  .times{ display:none; }
}

