/* 
Generelle stilarter

Primær blå = #2AB7FE
Box baggrund 1 = #4e636e , tekst = #181f22
Box baggrund 2 = #3f5058 , tekst = #7e8d96
*/

:root { 
  --page-max: 1200px; 
  --nav-h: 94px;
  --nav-gap: 12px;
}

/* Base reset ---------------------------------------------------------------*/
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body{
  margin: 0;
  font-family: Helvetica, Arial, sans-serif;
  background: #0e1418;
  line-height: 1.45;
}

/* Scrollbar ----------------------------------------------------------------*/
body::-webkit-scrollbar{ width: 11px; }
body::-webkit-scrollbar-track{ background: rgba(43, 42, 42, 0.98); }
body::-webkit-scrollbar-thumb{
  background-color: rgba(53, 53, 53, 0.95);
  border-radius: 20px;
}

/* Baggrund -----------------------------------------------------------------*/
.background{
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.background img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px);
  transform: scale(1.08);
}
.background::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    inset 0 0 90px rgba(0,0,0,.85);
}

/* Layout -------------------------------------------------------------------*/
.container{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Topnav -------------------------------------------------------------------*/
.topnav{
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  background: rgba(43, 42, 42, 0.95);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.topnav .nav-inner{
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* venstre | center | højre */
  align-items: center;
  gap: 12px;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 6px 12px;
  min-height: var(--nav-h);
}

/* Topnav items -------------------------------------------------------------*/
.topnav .nav-actions,
.topnav .nav-content{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.topnav .nav-actions{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;      /* <-- vigtig */
  gap: 4px 8px;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}

.nav-right{
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.topnav a{
  color: #2AB7FE;
  text-decoration: none;
  font-weight: bold;
  font-size: 20px;
  display: block;
  padding: 10px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}
.topnav a:hover{ background: rgba(59, 58, 58, 0.8); }

/* Dropdown i topnav --------------------------------------------------------*/
.topnav .dropdown{ position: relative; }

.topnav .dropdown-toggle{
  background: transparent;
  border: 0;
  color: #2AB7FE;
  font-weight: bold;
  font-size: 20px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.topnav .dropdown-toggle::after{
  content: "▾";
  margin-left: 6px;
  font-size: 0.9em;
}
.topnav .dropdown-toggle:hover,
.topnav .dropdown-toggle:focus-visible{
  background-color: rgba(59, 58, 58, 0.8);
  outline: none;
}

.topnav .dropdown-menu{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  display: none;
  padding: 8px;
  border-radius: 12px;
  background: rgba(43, 42, 42, 0.95);
  border: 2px solid rgba(43, 42, 42, 0.95);
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  z-index: 50;
  flex-direction: column;
  gap: 4px;
}
.topnav .dropdown.open .dropdown-menu{ display: flex; }

.topnav .dropdown-item{
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  color: #2AB7FE;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.topnav .dropdown-item:hover,
.topnav .dropdown-item:focus-visible{
  background: rgba(59, 58, 58, 0.8);
  outline: none;
}

/* Discord login ------------------------------------------------------------*/
.topnav a.discord-login{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  box-sizing: border-box;
  line-height: 1.2;
  font-size: 18px;
  font-weight: bold;
  background-color: #5865F2;
  color: #fff !important;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.2s, background-color 0.2s;
}
.topnav a.discord-login:hover{
  background-color: #4752C4;
  color: #fff !important;
  transform: scale(1.05);
  cursor: pointer;
}
.topnav a.discord-login .discord-icon{ width: auto; height: 1.2em; display: block; }
.topnav a.discord-login:focus-visible{ outline: none; box-shadow: 0 0 0 3px rgba(42,183,254,.35); }

/* Avatar i topnav ----------------------------------------------------------*/
.navbar-avatar{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  padding: 0;
  margin: 0 8px;
}
.topnav a.navbar-avatar:hover{ background: none !important; }
.navbar-avatar .avatar-img{
  width: 60px;
  height: auto;
  display: block;
  border-radius: 25%;
  border: 1.5px solid #344249;
  object-fit: cover;
  transition: transform 0.2s;
}
.navbar-avatar .avatar-img:hover{ transform: scale(1.1); cursor: pointer; }
.topnav a.navbar-avatar{ color: inherit; font-size: inherit; text-decoration: none; }

/* -------------------------------------------------------------------------- */
/* SERVER STATUS POPUP (hele boksen slider ud, tab bliver tilbage)            */
/* -------------------------------------------------------------------------- */

.server-status-popup{
  position: fixed;
  right: 16px;
  top: calc(var(--nav-h) + var(--nav-gap));
  z-index: 3000;

  display: flex;
  align-items: stretch;

  background: rgba(43, 42, 42, 0.95);
  border: 2px solid rgba(43, 42, 42, 0.95);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(4px);

  overflow: hidden;

  /* KUN slide */
  transform: translateX(0);
  transition: transform 220ms ease;
}

/* Indhold */
.server-status-popup .server-status{
  width: 270px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  color: #fff;
}

/* Pil er en FAST del af boksen */
.server-status-popup .ssp-toggle{
  width: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;

  display: grid;
  place-items: center;

  color: rgba(255,255,255,.75);
  font-weight: 900;
  font-size: 22px;

  border-left: 1px solid rgba(255,255,255,.06);
}
.server-status-popup .ssp-toggle:hover{
  background: rgba(59, 58, 58, 0.35);
  color: #fff;
}

/* Collapsed: hele boksen kører ud til højre, men efterlader en tab (pilen) */
.server-status-popup.collapsed{
  transform: translateX(calc(100% - 44px));
}

/* Når collapsed: pilen skal visuelt ligge i venstre side af tab’en */
.server-status-popup.collapsed .ssp-toggle{
  border-left: 0;
  border-right: 1px solid rgba(255,255,255,.06);
}

/* Når collapsed: pilen skal stå i venstre side af tab’en */
.server-status-popup.collapsed{
  transform: translateX(calc(100% - 44px));
  flex-direction: row-reverse; /* <-- VIGTIG: flytter pilen til venstre */
}

/* Når collapsed: byt separator-linje så den ligger korrekt */
.server-status-popup.collapsed .ssp-toggle{
  border-left: 0;
  border-right: 1px solid rgba(255,255,255,.06);
}

/* Normal state: separatoren er til venstre for pilen */
.server-status-popup .ssp-toggle{
  border-left: 1px solid rgba(255,255,255,.06);
  border-right: 0;
}

/* Server status indhold (genbruges) */
.ss-top{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 8px;
  opacity: .85;
}
.ss-dot{
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52,211,153,.85);
}
.server-status.offline .ss-dot{
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239,68,68,.85);
}
.ss-title{
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 12px;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
}
.ss-count{
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 8px;
}
.ss-now,
.ss-max{
  font-size: 22px;
  font-weight: 900;
  color: rgba(255,255,255,.85);
}
.ss-sub{
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,.55);
}

/* Mobil: gem popuppen */
@media (max-width: 900px){
  .server-status-popup{ display: none; }
}

/* Grid span ------------------------------------------------------------ */
.topnav, .dashboard-content, .footer { grid-column: 1 / -1; }

/* Main wrapper -------------------------------------------------------------*/
.dashboard-content {
  grid-row: 2;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
}
.cl-wrap {
  width: min(92vw, var(--page-max));
  margin: 3% auto;
  background: rgba(43, 42, 42, 0.95);
  border: 4px solid rgba(43, 42, 42, 0.95);
  box-shadow: 0 6px 18px rgba(0,0,0,.35), inset 0 1px rgba(43, 42, 42, 0.95);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 0 10px #000a;
}

/* Titel + meta (matcher forsiden) ------------------------------------------*/
.cl-title {
  margin: 0 0 6px;
  color: #2AB7FE;
  text-shadow: 2px 2px 3px #000;
  font-size: 28px;
  font-weight: 800;
  font-style: italic;
}
.pin {
  background:#2AB7FE; color:#0e1418; margin-left:8px; border-radius:6px; padding:1px 6px; font-size:12px;
}
.cl-meta {
  font-size: 14px;
  color: #7e8d96;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Tags ---------------------------------------------------------------------*/
.cl-tags { margin: 8px 0 14px; display:flex; gap:6px; flex-wrap:wrap; }
.cl-tag  { background:#3f5058; color:#7e8d96; border-radius:999px; padding:2px 8px; font-size:12px; }

/* Selve “kortet” med indhold (matcher boksene) -----------------------------*/
.cl-body {
  background: rgba(83, 83, 83, 0.9);
  border: 1px solid rgba(65, 65, 65, 0.9);
  border-radius: 16px;
  padding: 16px 18px 22px;
  color: #fff;
  position: relative;
}

/* Sektion-overskrifter som på forsiden -------------------------------------*/
.cl-body h1, .cl-body h2, .cl-body h3 {
  color: #2AB7FE;
  font-weight: 800;
  font-style: italic;
  text-shadow: 2px 2px 3px #000;
  margin: 18px 0 10px;
  font-size: 20px;   /* omtrent som .overskrift på forsiden */
}
.cl-body h1:first-child, .cl-body h2:first-child, .cl-body h3:first-child { margin-top: 0; }

/* Lister: fjern default bullets for ren emoji/ikon-liste -------------------*/
.cl-body ul { list-style: none; padding-left: 20px; margin: 6px 0 16px; }
.cl-body li { margin: 8px 0; position: relative; }

/* OBS: emojierne (✅ 🔧 ❌) kommer fra markdown -> replaceEmotes, 
   så vi tilføjer ikke pseudo-bullets her (for at undgå dobbelt-ikoner). */

/* “Udgivet: …” i nederste højre hjørne (som på forsiden) -------------------*/
.cl-footer {
  font-size: 12px;
  color: #7e8d96;
  font-weight: bold;
  margin-top: 10px;
  text-align: right;
}

/* Tilbage-link --------------------------------------------------------------*/
.back { display:inline-block; margin-top: 14px; }
.back a { color:#2AB7FE; text-decoration:none; font-weight:bold; }

/* Footer -----------------------------------------------------------------*/

.footer {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 5%;
  height: 100px;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  color: #fff;
  background: rgba(32, 32, 32, 0.95);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.footer p { margin: 0; }

/* Responsive ---------------------------------------------------------------*/
@media (max-width: 900px) {
  .topnav .brand-logo { height: 64px; }
  .topnav a { font-size: 18px; padding: 8px; }
}
