/* ══════════════════════════════════════════
   MC DASHBOARD v2 — Dark Gaming Theme
   ══════════════════════════════════════════ */

/* ── Reset & Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { overflow-x: hidden; }
img.pixelated, .pixelated { image-rendering: pixelated; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ── Scrollbar ── */
.custom-scroll::-webkit-scrollbar, main::-webkit-scrollbar { width: 5px; }
.custom-scroll::-webkit-scrollbar-track, main::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb, main::-webkit-scrollbar-thumb { background: #1a1a30; border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb:hover, main::-webkit-scrollbar-thumb:hover { background: #2a2a4a; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px var(--glow-color, #22c55e80); }
  50% { box-shadow: 0 0 20px var(--glow-color, #22c55ea0); }
}
@keyframes gradient-x {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes border-spin {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}
@keyframes countUp { from { opacity: 0.5; } to { opacity: 1; } }

.animate-float { animation: float 4s ease-in-out infinite; }
.animate-slideUp { animation: slideUp 0.4s ease-out; }
.animate-blink { animation: blink 1.2s ease-in-out infinite; }

/* Stagger children entrance */
.stagger-children > * {
  opacity: 0;
  animation: slideUp 0.5s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* ── Navigation ── */
.nav-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.8rem; border-radius: 0.6rem;
  font-size: 0.8rem; font-weight: 500;
  color: #64748b; text-decoration: none;
  transition: all 0.25s ease; position: relative;
  overflow: hidden;
}
.nav-link::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(0,212,255,0.06));
  opacity: 0; transition: opacity 0.25s;
  border-radius: inherit;
}
.nav-link:hover { color: #e2e8f0; }
.nav-link:hover::before { opacity: 1; }
.nav-link.active { color: #a78bfa; }
.nav-link.active::before { opacity: 1; }
.nav-link.active::after {
  content: ''; position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #7c3aed, #00d4ff);
}
.nav-icon { font-size: 1rem; width: 1.4rem; text-align: center; flex-shrink: 0; }

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.35s ease-out; }
.page-title { font-size: 1.4rem; font-weight: 800; color: #f1f5f9; }

/* ── Glass Cards ── */
.glass-card {
  background: linear-gradient(135deg, rgba(17,17,34,0.8), rgba(12,12,26,0.9));
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.glass-card:hover {
  border-color: rgba(255,255,255,0.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* ── Glow Cards (stat cards with colored glow) ── */
.glow-card {
  position: relative; border-radius: 1rem; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.glow-card:hover { transform: translateY(-2px); }
.glow-card-inner {
  position: relative; z-index: 1;
  background: linear-gradient(135deg, rgba(17,17,34,0.95), rgba(8,8,18,0.98));
  border-radius: 1rem; padding: 1.25rem;
  border: 1px solid rgba(255,255,255,0.04);
}
.glow-card::before {
  content: ''; position: absolute; inset: -1px;
  border-radius: 1rem; padding: 1px;
  background: var(--glow-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.5; transition: opacity 0.3s;
}
.glow-card:hover::before { opacity: 1; }
.glow-card.green  { --glow-gradient: linear-gradient(135deg, #22c55e, #06b6d4); }
.glow-card.purple { --glow-gradient: linear-gradient(135deg, #7c3aed, #a78bfa); }
.glow-card.blue   { --glow-gradient: linear-gradient(135deg, #3b82f6, #00d4ff); }
.glow-card.cyan   { --glow-gradient: linear-gradient(135deg, #06b6d4, #7c3aed); }
.glow-card.green:hover  { box-shadow: 0 0 30px rgba(34,197,94,0.1); }
.glow-card.purple:hover { box-shadow: 0 0 30px rgba(124,58,237,0.1); }
.glow-card.blue:hover   { box-shadow: 0 0 30px rgba(59,130,246,0.1); }
.glow-card.cyan:hover   { box-shadow: 0 0 30px rgba(6,182,212,0.1); }

/* ── Stat Labels ── */
.stat-label {
  font-size: 0.65rem; font-weight: 700; color: #475569;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.card-title {
  font-size: 0.75rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Status Dot ── */
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  transition: all 0.3s;
}
.status-dot.online {
  background: #22c55e;
  --glow-color: rgba(34,197,94,0.6);
  animation: pulse-glow 2s ease-in-out infinite;
}
.status-dot.offline {
  background: #ef4444;
  --glow-color: rgba(239,68,68,0.4);
  box-shadow: 0 0 8px rgba(239,68,68,0.4);
}

/* ── Progress Bars ── */
.bar-track {
  width: 100%; background: rgba(8,8,18,0.8);
  border-radius: 999px; height: 6px; overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.bar-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

/* ── Login Cards ── */
.login-card {
  position: relative; border-radius: 1rem; overflow: hidden;
  background: linear-gradient(135deg, rgba(17,17,34,0.9), rgba(8,8,18,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s ease;
}
.login-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.12);
}
.login-card.selected {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 30px rgba(124,58,237,0.15);
}
.login-card-glow {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity 0.3s;
}
.login-card:hover .login-card-glow { opacity: 1; }
.admin-glow { background: radial-gradient(circle at 50% 100%, rgba(124,58,237,0.15), transparent 70%); }
.goose-glow { background: radial-gradient(circle at 50% 100%, rgba(0,255,136,0.12), transparent 70%); }

/* ── Control Buttons ── */
.ctl-btn {
  padding: 0.7rem 1.8rem; border-radius: 0.75rem;
  font-weight: 700; font-size: 0.85rem;
  cursor: pointer; transition: all 0.25s;
  border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 0.5rem;
  position: relative; overflow: hidden;
}
.ctl-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.ctl-btn:hover::before { opacity: 1; }
.ctl-btn:active { transform: scale(0.96); }
.ctl-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.ctl-btn-icon { font-size: 0.9rem; }
.ctl-start { background: rgba(34,197,94,0.12); color: #22c55e; border-color: rgba(34,197,94,0.2); }
.ctl-start:hover { background: rgba(34,197,94,0.2); box-shadow: 0 0 20px rgba(34,197,94,0.15); }
.ctl-stop { background: rgba(239,68,68,0.12); color: #ef4444; border-color: rgba(239,68,68,0.2); }
.ctl-stop:hover { background: rgba(239,68,68,0.2); box-shadow: 0 0 20px rgba(239,68,68,0.15); }
.ctl-restart { background: rgba(245,158,11,0.12); color: #f59e0b; border-color: rgba(245,158,11,0.2); }
.ctl-restart:hover { background: rgba(245,158,11,0.2); box-shadow: 0 0 20px rgba(245,158,11,0.15); }

/* ── Console ── */
.console-bg { background: #04040a; }
#console-output .log-line { padding: 1px 0; word-break: break-all; }
#console-output .log-line.error { color: #f87171; }
#console-output .log-line.warn  { color: #fbbf24; }
#console-output .log-line.info  { color: #6b7280; }
#console-output .log-line.cmd   { color: #a78bfa; }
#console-output .log-line.response { color: #34d399; }

/* ── Player Card ── */
.player-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: linear-gradient(135deg, rgba(15,15,25,0.8), rgba(10,10,18,0.9));
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 0.75rem; padding: 0.75rem 1rem;
  transition: all 0.25s;
}
.player-card:hover {
  border-color: rgba(255,255,255,0.08);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.player-card img { width: 40px; height: 40px; border-radius: 6px; }

/* ── Mod Row ── */
.mod-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.9rem;
  background: linear-gradient(135deg, rgba(15,15,25,0.6), rgba(10,10,18,0.8));
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 0.6rem; font-size: 0.82rem;
  transition: all 0.25s;
}
.mod-row:hover {
  border-color: rgba(124,58,237,0.2);
  background: linear-gradient(135deg, rgba(20,20,35,0.8), rgba(15,15,28,0.9));
  transform: translateX(3px);
}
.mod-name { color: #e2e8f0; font-weight: 500; }
.mod-size { color: #475569; font-size: 0.7rem; font-family: 'JetBrains Mono', monospace; }

/* ── Properties ── */
.prop-row { display: flex; gap: 0.5rem; padding: 0.3rem 0.5rem; border-radius: 0.3rem; transition: background 0.2s; }
.prop-row:hover { background: rgba(124,58,237,0.06); }
.prop-key { color: #7c3aed; min-width: 200px; }
.prop-val { color: #64748b; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600;
  background: linear-gradient(135deg, rgba(17,17,34,0.8), rgba(12,12,26,0.9));
  border: 1px solid rgba(255,255,255,0.06);
  color: #94a3b8;
}

/* ── Toast Notifications ── */
.toast {
  padding: 0.75rem 1.25rem; border-radius: 0.75rem;
  font-size: 0.82rem; font-weight: 500;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.06);
  animation: slideUp 0.3s ease-out;
  transition: all 0.3s;
  max-width: 350px;
}
.toast.success { background: rgba(34,197,94,0.15); color: #22c55e; border-color: rgba(34,197,94,0.2); }
.toast.error { background: rgba(239,68,68,0.15); color: #ef4444; border-color: rgba(239,68,68,0.2); }
.toast.info { background: rgba(124,58,237,0.15); color: #a78bfa; border-color: rgba(124,58,237,0.2); }

/* ── Spinner ── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #a78bfa;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Chat Bubbles ── */
#chat-feed .flex { transition: background 0.2s; padding: 0.35rem 0.5rem; border-radius: 0.5rem; }
#chat-feed .flex:hover { background: rgba(124,58,237,0.04); }

/* ── Backup Rows ── */
#backup-list > div { transition: all 0.2s; }
#backup-list > div:hover { border-color: rgba(255,255,255,0.08) !important; }

/* ── Stat Bubbles (Player Stats) ── */
#stats-container .glass-card { transition: all 0.3s; }
#stats-container .glass-card:hover { border-color: rgba(124,58,237,0.15); }

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar { width: 56px; }
  #sidebar h1 span:last-child, .nav-text, #sidebar .text-xs,
  #sidebar #sidebar-status-text, #sidebar #user-name, #sidebar #btn-logout,
  #sidebar #sidebar-restart { display: none; }
  .nav-link { justify-content: center; padding: 0.6rem; }
  .nav-icon { font-size: 1.1rem; }
  main { margin-left: 56px !important; padding: 1rem !important; }
  .page-title { font-size: 1.1rem; }
  .glass-card { padding: 0.9rem; }
  .glow-card-inner { padding: 0.9rem; }
  .ctl-btn { padding: 0.5rem 1.2rem; font-size: 0.75rem; }
}

@media (max-width: 480px) {
  main { padding: 0.75rem !important; }
  .page-title { font-size: 1rem; }
  #login-overlay .text-7xl { font-size: 3.5rem; }
  #login-overlay h1 { font-size: 1.8rem; }
}
