/* =========================================================
   RESOCORE — GLOBAL THEME + LAYOUT (SILVERY TIME-PRO)
   Consolidated + sidebar-collapse ready
   (Fixes: header/logo “bump”, adds right-sidebar collapsible styling)
   Works with site-ui.js: toggleSidebar(), toggleRightSidebar()
   ========================================================= */

/* === THEME TOKENS === */
:root{
  /* Time-silver accent palette */
  --accent: rgba(123,211,255,0.95);
  --accentSoft: rgba(123,211,255,0.10);
  --accentMid: rgba(123,211,255,0.22);

  /* Text palette */
  --textBright: rgba(236,242,250,0.96);
  --text: rgba(236,242,250,0.84);
  --muted: rgba(236,242,250,0.72);
  --dim: rgba(236,242,250,0.58);

  /* Panels (silvery glass) */
  --panel: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  --panel2: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));

  /* Lines / shadows */
  --border: rgba(255,255,255,0.12);
  --shadow: 0 18px 54px rgba(0,0,0,0.45);

  /* Legacy amber tokens (kept so older pages do not break) */
  --amber: rgba(255, 191, 120, 0.92);
  --amberSoft: rgba(255,159,67,0.10);
  --amberMid: rgba(255,159,67,0.45);
  --amberShadow: 0 0 18px rgba(255,159,67,0.08);

  /* New: "shiny silver" theme for right sidebar (replaces amber look) */
  --silver: rgba(236,242,250,0.92);
  --silverSoft: rgba(236,242,250,0.10);
  --silverMid: rgba(236,242,250,0.28);
  --silverShadow: 0 0 18px rgba(236,242,250,0.08);

  /* Radii */
  --r-pill: 14px;
  --r-card: 18px;

  /* Common surfaces */
  --glassDark: rgba(10, 12, 16, 0.88);
  --glassBtn: rgba(10, 12, 16, 0.60);

  /* Particle colors (canvas background sprites) */
  --particleA: rgba(123,211,255,0.95);     /* cyan accent */
  --particleB: rgba(236,242,250,0.92);     /* shiny silver */

  /* Sidebar sizing */
  --sidebarW: 250px;
  --sidebarCollapsedW: 62px;
}

/* === BASE / RESETS === */
*,
*::before,
*::after{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #000;
  color: var(--text);
  overflow-x: hidden;
}

p, li{ color: var(--muted); }
small, .sub, .meta{ color: var(--dim); }

h1, h2, h3, h4, h5, h6{
  color: var(--textBright);
  text-shadow: none;
}

a{ color: inherit; }
button{ font-family: inherit; }

:focus-visible{
  outline: 2px solid rgba(123,211,255,0.55);
  outline-offset: 3px;
  border-radius: 10px;
}

/* =========================================================
   BACKGROUNDS
   ========================================================= */

.universe-bg{
  position: fixed;
  inset: 0;
  background: url('/images/universe.jpg') center/cover no-repeat;
  opacity: 0.65;
  z-index: 1;

  /* IMPORTANT: never steal taps/clicks on mobile */
  pointer-events: none;
}

#background{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;

  /* IMPORTANT: never steal taps/clicks on mobile */
  pointer-events: none;

  opacity: 0.45;
}

/* =========================================================
   SIDEBARS (Shared base + left/right specifics)
   ========================================================= */

/* Glossy glass sidebars (less silvery + slightly more see-through) */
.sidebar,
.sidebar-right{
  height: 100%;
  width: var(--sidebarW);
  position: fixed;
  top: 0;
  padding-top: 60px;
  z-index: 10;
  overflow-y: auto;
  overflow-x: hidden;

  /* Slightly more transparent base (was 0.92) */
  background: rgba(10, 12, 16, 0.82);

  /* Softer gloss to reduce “silver” look */
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
    radial-gradient(1200px 600px at 20% 0%, rgba(123,211,255,0.10), transparent 55%);

  /* Keep glass effect consistent */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(10px);

  transition: width 0.25s ease, transform 0.25s ease;
}

/* Left */
.sidebar{
  left: 0;
  border-right: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 54px rgba(0,0,0,0.35);
}

/* Right (cool silver, but softened) */
.sidebar-right{
  right: 0;
  border-left: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--silverShadow);

  /* Slightly cooler, but less bright than before */
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    radial-gradient(1200px 600px at 80% 0%, rgba(236,242,250,0.10), transparent 55%);
}


/* Sidebar links */
.sidebar a,
.sidebar-right a{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  font-size: 1.03em;
  text-decoration: none;
  transition: 0.2s ease;
  white-space: nowrap;
}

/* Left link theme */
.sidebar a{
  color: rgba(236,242,250,0.82);
  border-left: 2px solid transparent;
}
.sidebar a:hover{
  background: rgba(123,211,255,0.08);
  color: #fff;
  border-left-color: rgba(123,211,255,0.55);
}

/* Right link theme (SILVER) */
.sidebar-right a{
  color: var(--silver);
  border-right: 2px solid transparent;
}
.sidebar-right a:hover{
  background: var(--silverSoft);
  color: #fff;
  border-right-color: rgba(236,242,250,0.70);
}

/* Section titles (non-collapsible legacy titles) */
.hub-title,
.hub-title-right{
  padding: 14px 20px 6px;
  font-size: 0.85em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hub-title{ color: rgba(236,242,250,0.50); }
.hub-title-right{ color: rgba(236,242,250,0.58); }

/* Dividers */
.sidebar-divider{
  height: 1px;
  margin: 14px 20px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.20), transparent);
  opacity: 0.9;
}
.sidebar-divider-right{
  height: 1px;
  margin: 14px 20px;
  background: linear-gradient(to right, transparent, var(--silverMid), transparent);
  opacity: 0.85;
}

/* Badges */
.badge,
.badge-right{
  font-size: 0.75em;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge{
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(236,242,250,0.90);
}
.badge-right{
  border: 1px solid rgba(236,242,250,0.22);
  background: rgba(236,242,250,0.08);
  color: rgba(236,242,250,0.92);
}

/* Premium: emphasize key nav links (apply class="nav-strong" on the <a>) */
.sidebar a.nav-strong{
  background: rgba(255,255,255,0.06);
  border-left-color: rgba(123,211,255,0.45);
}
.sidebar a.nav-strong:hover{
  background: rgba(123,211,255,0.10);
}
.sidebar-right a.nav-strong{
  background: rgba(236,242,250,0.06);
  border-right-color: rgba(236,242,250,0.45);
}
.sidebar-right a.nav-strong:hover{
  background: rgba(236,242,250,0.10);
}

/* =========================================================
   SIDEBAR COLLAPSIBLE GROUPS (Shared for Left + Right)
   Requires:
   - <button class="nav-group-toggle" data-target="...">
   - <div class="nav-group" id="..." hidden>...</div>
   ========================================================= */

.nav-group-toggle{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 12px 20px;
  background: transparent;
  border: 0;
  cursor: pointer;

  font-size: 0.92em;
  letter-spacing: 0.14em;
  text-transform: uppercase;

  transition: 0.2s ease;
}

/* Left toggle theme */
.sidebar .nav-group-toggle{
  color: rgba(236,242,250,0.58);
}
.sidebar .nav-group-toggle:hover{
  background: rgba(123,211,255,0.06);
  color: rgba(236,242,250,0.90);
}

/* Right toggle theme (SILVER) */
.sidebar-right .nav-group-toggle{
  color: rgba(236,242,250,0.62);
}
.sidebar-right .nav-group-toggle:hover{
  background: rgba(236,242,250,0.06);
  color: rgba(236,242,250,0.92);
}

.nav-group-title{ font-weight: 800; }

.nav-group-icon{
  font-size: 0.9em;
  opacity: 0.8;
  transform: rotate(-90deg);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

/* Open state */
.nav-group-toggle[aria-expanded="true"] .nav-group-icon{
  transform: rotate(0deg);
  opacity: 1;
}

/* Group container */
.nav-group{
  padding: 4px 0 8px;
}

/* Left group guide + indent */
.sidebar .nav-group{
  border-left: 1px solid rgba(255,255,255,0.07);
  margin-left: 20px;
  margin-right: 12px;
}
.sidebar .nav-group a{
  padding-left: 28px;
  font-size: 1.0em;
  border-left: 2px solid transparent;
}

/* Right group guide + indent (SILVER) */
.sidebar-right .nav-group{
  border-right: 1px solid rgba(236,242,250,0.14);
  margin-right: 20px;
  margin-left: 12px;
}
.sidebar-right .nav-group a{
  padding-right: 28px;
  font-size: 1.0em;
  border-right: 2px solid transparent;
}

/* Buttons should not get default focus border weirdness */
.nav-group-toggle:focus-visible{
  outline-offset: -2px;
  border-radius: 12px;
}
/* Left focus ring */
.sidebar .nav-group-toggle:focus-visible{
  outline: 2px solid rgba(123,211,255,0.45);
}
/* Right focus ring (SILVER) */
.sidebar-right .nav-group-toggle:focus-visible{
  outline: 2px solid rgba(236,242,250,0.35);
}

/* =========================================================
   DESKTOP + TABLET: OPEN/CLOSE (works with site-ui.js toggling .is-open)
   IMPORTANT:
   - Default state on desktop should be OPEN (no .is-open needed).
   - When .is-open is ADDED (toggle click), sidebar becomes OPEN on mobile (off-canvas).
   - When .is-open is REMOVED on mobile, sidebar is hidden off-canvas.
   - On desktop, when .is-open is REMOVED we want FULLY OPEN.
   - On desktop, when .is-open is ADDED we want FULLY CLOSED.
   ========================================================= */

/* Desktop/tablet: FULLY CLOSED when NOT open (when .is-open is missing)
   We implement "closed" as: width:0 + no padding + no scroll */
@media screen and (min-width: 769px){
  /* === Default open === */
  .sidebar,
  .sidebar-right{
    width: var(--sidebarW);
  }

  /* === When toggled CLOSED (no .is-open) ===
     NOTE: site-ui.js toggles .is-open, so CLOSED = not(.is-open) */
  .sidebar:not(.is-open){
    width: 0;
    padding: 0;
    overflow: hidden;
  }
  .sidebar-right:not(.is-open){
    width: 0;
    padding: 0;
    overflow: hidden;
  }

  /* Main margins respond to sidebar presence */
  body:has(.sidebar:not(.is-open)) #main{
    margin-left: 0;
  }
  body:has(.sidebar-right:not(.is-open)) #main{
    margin-right: 0;
  }

  /* When open, main gets full margins */
  body:has(.sidebar.is-open) #main{
    margin-left: var(--sidebarW);
  }
  body:has(.sidebar-right.is-open) #main{
    margin-right: var(--sidebarW);
  }
}

/* =========================================================
   TOGGLE BUTTONS
   ========================================================= */

.openbtn,
.openbtn-right{
  font-size: 22px;
  cursor: pointer;
  background: var(--glassBtn);
  border-radius: 12px;
  position: fixed;
  top: 15px;
  z-index: 10000;
  padding: 10px 12px;
  backdrop-filter: blur(10px);
  transition: 0.2s ease;
}

.openbtn{
  left: 15px;
  color: rgba(236,242,250,0.82);
  border: 1px solid rgba(255,255,255,0.12);
}
.openbtn:hover{
  background: rgba(123,211,255,0.08);
  border-color: rgba(123,211,255,0.22);
  color: #fff;
}

.openbtn-right{
  right: 15px;
  color: var(--silver);
  border: 1px solid rgba(236,242,250,0.20);
}
.openbtn-right:hover{
  background: rgba(236,242,250,0.08);
  border-color: rgba(236,242,250,0.30);
  color: #fff;
}

/* =========================================================
   MAIN CONTENT FRAME
   ========================================================= */

#main{
  margin-left: var(--sidebarW);
  margin-right: var(--sidebarW);

  /* Keep main padding, but don’t force extra top space */
  padding: 10px;
  padding-top: 0;

  position: relative;
  z-index: 5;
  transition: margin-left 0.25s ease, margin-right 0.25s ease;
}

/* ===== HEADER: hug the very top (logo sits ~4px from edge) ===== */
#main > .header{
  margin: 0;
  text-align: center;

  /* tighter than before */
  padding: 4px 10px 2px;
}

/* Prevent margin-collapse / inconsistent first-block spacing from affecting header */
#main > .header + *{
  margin-top: 0 !important;
}

/* Make logo link itself not introduce baseline/line-height quirks */
.logo-link{
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  margin: 0;
  padding: 0;
}

/* Make sure the logo itself doesn’t add hidden top gap */
#main > .header img,
.header img{
  max-width: 285px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Tagline tightened so it doesn’t push the logo area down */
.tagline{
  font-size: 1.45em;
  margin-top: 2px;  /* was -2px, can create odd spacing on some pages */
  margin-bottom: 0;
  color: var(--textBright);
}

/* Tighten header -> first panel spacing */
#main > .panel-wrap{ margin-top: 4px; }


/* =========================================================
   PANELS + BUTTONS
   ========================================================= */

.panel-wrap{
  max-width: 1050px;
  margin: 5px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 5px;
}

.panel-pill-primary{
  font-size: 1.15em;
  padding: 12px 20px;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 14px 34px rgba(0,0,0,0.30);
  border-radius: var(--r-pill);
}

.panel-card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 15px 15px 13px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  min-height: 210px;
}

.panel-card:hover{
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.22);
  background: var(--panel2);
}

.panel-card.welcome-card{
  text-align: center;
  min-height: unset;
  padding: 20px 22px 18px;
}
.panel-card.welcome-card .panel-desc{ margin-bottom: 0; }

.panel-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.80em;
  letter-spacing: 0.06em;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  padding: 6px 10px;
  border-radius: var(--r-pill);
}

.panel-title{
  margin: 12px 0 8px;
  font-size: 1.25em;
  color: var(--textBright);
  font-weight: 800;
}

.panel-desc{
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98em;
  margin: 0 0 14px;
}

.panel-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  font-size: 0.98em;
}

.panel-link:hover{
  color: #fff;
  text-decoration: underline;
}

/* CTA row */
.cta-row{
  max-width: 1050px;
  margin: 10px auto 0;
  padding: 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn{
  display: inline-block;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.10);
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  transition: 0.25s ease;
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
}

.btn:hover{
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(123,211,255,0.35);
  box-shadow: 0 0 0 2px rgba(123,211,255,0.10);
}

.btn-secondary{
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.18);
  font-weight: 800;
}

.btn-secondary:hover{
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer{
  margin-top: 34px;
  padding: 20px;
  text-align: center;
  font-size: 0.9em;
  color: rgba(236,242,250,0.55);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media screen and (max-width: 1100px){
  .sidebar-right{ width: 0 !important; }
  .sidebar{ width: 0 !important; }

  #main{
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
}


@media screen and (max-width: 980px){
  .panel-wrap{ grid-template-columns: 1fr; }
  .tagline{ font-size: 1.25em; }
}

/* =========================
   MOBILE: OFF-CANVAS SIDEBARS
   Default CLOSED on mobile, open only when .is-open exists
   ========================= */
@media screen and (max-width: 768px){
  #main{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Default CLOSED off-canvas */
  .sidebar,
  .sidebar-right{
    width: var(--sidebarW) !important;
    transition: transform 0.25s ease;
  }

  .sidebar{ transform: translateX(-105%); }
  .sidebar-right{ transform: translateX(105%); }

  /* Open only when .is-open exists */
  .sidebar.is-open{ transform: translateX(0); }
  .sidebar-right.is-open{ transform: translateX(0); }
}

/* FORCE the welcome card to span the full grid width */
#main .panel-wrap-welcome > .welcome-card{
  grid-column: 1 / -1 !important;
  width: 100% !important;
  justify-self: stretch !important;
}
#main .panel-wrap:first-of-type > .welcome-card{
  grid-column: 1 / -1 !important;
  width: 100% !important;
  justify-self: stretch !important;
}

/* =========================
   Report Metrics (Views / Likes)
   ========================= */

.metrics{
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap: wrap;
  font-size: 0.86em;
  color: rgba(236,242,250,0.62);
}

.report-actions{
  display:flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  min-width: 170px;
}

.metrics.under-open{
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 180px;
}

.metric-pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  white-space: nowrap;
  font-weight: 800;
  font-size: 0.84em;
}

.like-btn{
  padding: 4px 8px;
  font-size: 0.72em;
  font-weight: 800;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  color: rgba(236,242,250,0.90);
}

.like-btn:hover{
  background: rgba(255,255,255,0.14);
  color:#fff;
}

.like-btn.liked{
  background: rgba(255,255,255,0.20);
  border-color: rgba(123,211,255,0.35);
  color:#fff;
}
/* =========================================================
   GLOBAL SPIRAL / HALO OVERLAY FOR FRAMES
   Applies to: welcome-card panels and section frames.
   Random offsets are controlled via CSS variables set by JS.
   ========================================================= */

.panel-card.welcome-card,
.section{
  position: relative;
  overflow: hidden;
}

/* the halo itself */
.panel-card.welcome-card::before,
.section::before{
  content:"";
  position:absolute;

  /* Default base position (matches your public.php look),
     plus variable offsets that JS will randomize per element */
  left: calc(-280px + var(--halo-ox, 0px));
  top:  calc(-260px + var(--halo-oy, 0px));

  width:720px;
  height:720px;
  border-radius:999px;

  background:
    radial-gradient(circle at center, rgba(123,211,255,.28), transparent 72%),
    repeating-radial-gradient(circle at center,
      rgba(255,255,255,.24) 0 1px,
      transparent 2px 14px);

  opacity: var(--halo-opacity, .50);
  pointer-events:none;
  z-index: 0;
}

/* keep real content above the halo */
.panel-card.welcome-card > *,
.section > *{
  position: relative;
  z-index: 1;
}
