/* ═══════════════════════════════════════════
   Noze Minecraft Server – style.css
   ═══════════════════════════════════════════ */

:root {
  --bg-base:    #0d1117;
  --bg-card:    #161b22;
  --bg-hover:   #1c2333;
  --bg-input:   #1c2333;
  --border:     #30363d;
  --border-hi:  #3d444d;
  --green:      #3fb950;
  --green-dim:  #1a4a24;
  --green-glow: rgba(63,185,80,0.15);
  --gold:       #d29922;
  --blue:       #58a6ff;
  --purple:     #bc8cff;
  --orange:     #d18616;
  --red:        #f85149;
  --text-1:     #e6edf3;
  --text-2:     #8b949e;
  --text-3:     #484f58;
  --radius:     10px;
  --radius-lg:  16px;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;
  --font-ui:    'Inter', system-ui, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── BACKGROUND GRID ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

/* ── TOP GLOW ── */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 1px;
  background: var(--green);
  box-shadow: 0 0 80px 20px rgba(63,185,80,0.18);
  pointer-events: none;
  z-index: 1;
}

/* ══════════════════════════════
   HEADER
══════════════════════════════ */
header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,0.9);
  backdrop-filter: blur(12px);
  padding: 2rem 2rem 1.75rem;
  text-align: center;
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.logo-svg {
  width: 52px; height: 52px;
  filter: drop-shadow(0 0 12px rgba(63,185,80,0.35));
  animation: float 4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes float {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-5px) rotate(2deg); }
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
}

h1 span { color: var(--green); }

.tagline {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-top: 0.3rem;
  font-weight: 400;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-2);
  transition: border-color 0.2s;
}

.badge.online { border-color: var(--green-dim); color: var(--green); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.4; transform:scale(0.8); }
}

/* ══════════════════════════════
   NAV
══════════════════════════════ */
nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem 2rem 0;
}

.tab-btn {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  outline: none;
}

.tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  border-color: var(--border);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-1);
  border-color: var(--border);
  box-shadow: inset 0 -2px 0 var(--green);
}

/* ══════════════════════════════
   MAIN / LAYOUT
══════════════════════════════ */
main {
  position: relative;
  z-index: 5;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.2s ease; }

@keyframes fadeUp {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ══════════════════════════════
   OVERVIEW STRIP
══════════════════════════════ */
.overview-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.ov-item {
  background: var(--bg-card);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background 0.15s;
}
.ov-item:hover { background: var(--bg-hover); }

.ov-icon { font-size: 1rem; }

.ov-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.ov-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.ov-value.green  { color: var(--green); }
.ov-value.gold   { color: var(--gold); }
.ov-value.blue   { color: var(--blue); }
.ov-value.purple { color: var(--purple); }

/* ══════════════════════════════
   TOOLBAR
══════════════════════════════ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 0.2rem;
}

.pill-btn {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pill-btn:hover { border-color: var(--border-hi); color: var(--text-1); }
.pill-btn.active {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

.search-box { margin-left: auto; position: relative; }

.search-box::before {
  content: '⌕';
  position: absolute;
  left: 0.7rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 0.36rem 0.9rem 0.36rem 2rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-1);
  outline: none;
  width: 200px;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus { border-color: var(--green); }

/* ══════════════════════════════
   SECTION HEADER
══════════════════════════════ */
.section-hd {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ══════════════════════════════
   PLAYER GRID
══════════════════════════════ */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

/* ══════════════════════════════
   PLAYER CARD
══════════════════════════════ */
.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.player-card::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--green), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.player-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.player-card:hover::before { opacity: 1; }

.card-top {
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.skin-wrap { position: relative; width: 48px; height: 48px; flex-shrink: 0; }

.skin-img {
  width: 48px; height: 48px;
  border-radius: 8px;
  image-rendering: pixelated;
  background: var(--bg-base);
  border: 1px solid var(--border);
  display: block;
}

.status-dot {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--text-3); }

.card-identity { flex: 1; min-width: 0; }

.player-name {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-rank {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rank-admin   { background: rgba(248,81,73,0.12);  color: var(--red);    border: 1px solid rgba(248,81,73,0.25); }
.rank-parent  { background: rgba(210,153,34,0.12); color: var(--gold);   border: 1px solid rgba(210,153,34,0.25); }
.rank-kid     { background: rgba(63,185,80,0.1);   color: var(--green);  border: 1px solid rgba(63,185,80,0.2); }
.rank-mod     { background: rgba(210,153,34,0.12); color: var(--gold);   border: 1px solid rgba(210,153,34,0.25); }
.rank-vip     { background: rgba(88,166,255,0.1);  color: var(--blue);   border: 1px solid rgba(88,166,255,0.2); }
.rank-default { background: rgba(139,148,158,0.1); color: var(--text-2); border: 1px solid var(--border); }

.last-seen {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-3);
  text-align: right;
  white-space: nowrap;
  align-self: flex-start;
}
.last-seen.is-online { color: var(--green); }

/* ══════════════════════════════
   STAT GRID IN CARD
══════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat-cell {
  padding: 0.65rem 0.85rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.stat-cell:hover { background: var(--bg-hover); }
.stat-cell:nth-child(4n)       { border-right: none; }
.stat-cell:nth-last-child(-n+4){ border-bottom: none; }

.sc-icon  { font-size: 0.75rem; display: block; margin-bottom: 0.15rem; }
.sc-label { font-size: 0.57rem; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.sc-value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 0.18rem;
  color: var(--text-1);
}
.sc-value.green  { color: var(--green); }
.sc-value.gold   { color: var(--gold); }
.sc-value.blue   { color: var(--blue); }
.sc-value.purple { color: var(--purple); }
.sc-value.orange { color: var(--orange); }

/* ══════════════════════════════
   LOADING & ERROR
══════════════════════════════ */
.loading-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 5rem 2rem; gap: 0.75rem;
}

.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

.warn-box {
  background: rgba(210,153,34,0.06);
  border: 1px solid rgba(210,153,34,0.25);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  font-size: 0.82rem;
  color: var(--gold);
}
.warn-box--mb { margin-bottom: 1rem; }

/* ══════════════════════════════
   MAP
══════════════════════════════ */
.map-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: calc(100vh - 260px);
  min-height: 500px;
  position: relative;
}
.map-wrap iframe { width:100%; height:100%; border:none; display:block; }

.map-badge {
  position: absolute;
  top: 1rem; left: 1rem;
  background: rgba(13,17,23,0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--green);
  backdrop-filter: blur(8px);
  pointer-events: none;
  display: flex; align-items: center; gap: 0.5rem;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(4n)        { border-right: 1px solid var(--border); }
  .stat-cell:nth-child(2n)        { border-right: none; }
  .stat-cell:nth-last-child(-n+4) { border-bottom: 1px solid var(--border); }
  .stat-cell:nth-last-child(-n+2) { border-bottom: none; }
  .overview-strip { grid-template-columns: repeat(2, 1fr); }
  .player-grid    { grid-template-columns: 1fr; }
  .search-input   { width: 140px; }
  header { padding: 1.5rem 1rem 1.25rem; }
  main   { padding: 1rem 1rem 4rem; }
}

/* ══════════════════════════════
   WHITELIST TAB
══════════════════════════════ */
.wl-card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.wl-card-header {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.wl-card-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 0.4rem;
}

.wl-card-header p {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.6;
}

.wl-card-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wl-info-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-2);
}

.wl-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.wl-info-item span:first-child { flex-shrink: 0; }

.wl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.wl-btn-ms {
  background: #2f7fef;
  color: #fff;
  box-shadow: 0 2px 8px rgba(47,127,239,0.3);
}
.wl-btn-ms:hover {
  background: #1a6fd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47,127,239,0.4);
}

.wl-btn-ms svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Status cards */
.wl-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1rem 0;
}

.wl-status-icon { font-size: 3rem; line-height: 1; }

.wl-status-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-1);
}

.wl-status-text {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 360px;
}

.wl-player-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  width: 100%;
}

.wl-player-row img {
  width: 40px; height: 40px;
  border-radius: 6px;
  image-rendering: pixelated;
  border: 1px solid var(--border);
}

.wl-player-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.wl-player-uuid {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 0.1rem;
}

.wl-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.wl-badge-pending  { background: rgba(210,153,34,0.12);  color: var(--gold);  border: 1px solid rgba(210,153,34,0.3); }
.wl-badge-approved { background: rgba(63,185,80,0.12);   color: var(--green); border: 1px solid rgba(63,185,80,0.3); }
.wl-badge-rejected { background: rgba(248,81,73,0.12);   color: var(--red);   border: 1px solid rgba(248,81,73,0.3); }

.wl-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

.wl-note {
  font-size: 0.75rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}

/* Whitelist form input row */
.wl-input-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.wl-skin-preview {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid var(--border);
  image-rendering: pixelated;
  flex-shrink: 0;
  margin-top: 2px;
}

.wl-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wl-name-input {
  width: 100%;
  background: var(--bg-input, #010409);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.wl-name-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(63,185,80,0.1);
}

.wl-name-input::placeholder { color: var(--text-3); }

.wl-error-text {
  font-size: 0.78rem;
  color: var(--red);
  min-height: 1rem;
}

.wl-btn-primary {
  background: var(--green);
  color: #0d1117;
  font-weight: 700;
  border: none;
}
.wl-btn-primary:hover {
  background: #3dd668;
  transform: translateY(-1px);
}
.wl-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.wl-btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
}
.wl-btn-ghost:hover {
  border-color: var(--text-2);
  color: var(--text-1);
}
