/* ============================================================
   AstralPH SMP — Galaxy Moon Cloud Theme
   Purple aesthetic, soft glows, dreamy vibes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Quicksand:wght@400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #07051a;
  --bg-2:         #0b0820;
  --bg-3:         #100e28;
  --bg-card:      #0f0d25;
  --bg-card-2:    #13103080;
  --bg-hover:     #1a1640;
  --border:       #2a2460;
  --border-hi:    #3d3580;
  --border-glow:  #7c5cfc55;

  --purple:       #7c5cfc;
  --purple-2:     #a78bfa;
  --purple-3:     #c4b5fd;
  --purple-soft:  #d8b4fe;
  --purple-dim:   #3d2e7a;
  --purple-glow:  #7c5cfc22;
  --purple-glow2: #a78bfa15;
  --pink:         #e879f9;
  --pink-soft:    #f0abfc;

  --text:         #e2d9f3;
  --text-muted:   #8b7faa;
  --text-faint:   #3d3563;

  --success:      #34d399;
  --error:        #f87171;
  --warning:      #fbbf24;
  --info:         #60a5fa;

  --radius:       .9rem;
  --radius-sm:    .5rem;
  --radius-pill:  2rem;
  --shadow:       0 8px 32px #00000066;
  --shadow-glow:  0 0 40px #7c5cfc20;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--purple-2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--purple-3); }
img { display: block; max-width: 100%; }
input, textarea, select {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-3);
  border: 1px solid var(--border-hi);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  font-size: .9rem;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
button { font-family: 'Nunito', sans-serif; cursor: pointer; }
h1,h2,h3,h4 { font-family: 'Quicksand', sans-serif; line-height: 1.2; font-weight: 700; }
label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .35rem; font-weight: 600; }

/* ── Stars Canvas ────────────────────────────────────────────── */
#starsCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }
.page-wrap  { padding-top: 5rem; min-height: 100vh; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header { text-align: center; margin-bottom: 3rem; }
.page-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--text); }
.page-header h1 span, .page-header h1 em { color: var(--purple-2); font-style: normal; }
.page-header p  { color: var(--text-muted); margin-top: .5rem; font-size: .95rem; }
.page-header .divider {
  width: 50px; height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 2px; margin: 1rem auto 0;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple)40, transparent);
  opacity: 0;
  transition: opacity .3s;
}
.card:hover { border-color: var(--border-glow); box-shadow: var(--shadow-glow); }
.card:hover::before { opacity: 1; }

.card-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-title i { width: 16px; height: 16px; color: var(--purple-2); }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--border-glow); transform: translateY(-2px); }
.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--purple-glow);
  border: 1px solid var(--border-glow);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
}
.stat-card-icon i { width: 18px; height: 18px; color: var(--purple-2); }
.stat-big {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--purple-3);
  line-height: 1;
}
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: .88rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  border: none;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn i { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(135deg, var(--purple), #5b3fd4);
  color: #fff;
  box-shadow: 0 4px 16px var(--purple-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px #7c5cfc44;
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--purple-2);
  border: 1px solid var(--border-glow);
}
.btn-outline:hover {
  background: var(--purple-glow);
  border-color: var(--purple);
  color: var(--purple-3);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-3);
  color: var(--text);
  transform: translateY(-1px);
}
.btn-danger {
  background: #7f1d1d;
  color: var(--error);
  border: 1px solid #ef444430;
}
.btn-danger:hover { background: #991b1b; transform: translateY(-1px); }

/* ── Section title ───────────────────────────────────────────── */
.section-title {
  display: flex; align-items: center; gap: .45rem;
  font-family: 'Quicksand', sans-serif;
  font-size: .95rem; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
}
.section-title i { width: 15px; height: 15px; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: .35rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: .3rem;
}
.tab-btn {
  padding: .45rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: .82rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.tab-btn:hover { color: var(--text); background: var(--bg-hover); }
.tab-btn.active {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 2px 12px var(--purple-glow);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  padding: .9rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem;
  border-radius: var(--radius-pill);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .03em;
}
.role-owner     { background:#4c1d95; color:#c4b5fd; border:1px solid #7c3aed40; }
.role-manager   { background:#1e3a5f; color:#93c5fd; border:1px solid #3b82f640; }
.role-admin     { background:#7f1d1d; color:#fca5a5; border:1px solid #ef444440; }
.role-developer { background:#064e3b; color:#6ee7b7; border:1px solid #10b98140; }
.role-moderator { background:#1e1b4b; color:#a5b4fc; border:1px solid #6366f140; }
.role-helper    { background:#1c1917; color:#d6d3d1; border:1px solid #78716c40; }
.role-user      { background:var(--bg-3); color:var(--text-muted); border:1px solid var(--border); }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: .3rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.page-btn {
  padding: .4rem .8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .82rem;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: all .15s;
}
.page-btn:hover { border-color: var(--border-glow); color: var(--text); }
.page-btn.active { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ── Loading ─────────────────────────────────────────────────── */
.loading-row { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form groups ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--text-faint); margin-top: .3rem; }
.form-error { font-size: .78rem; color: var(--error); margin-top: .3rem; }

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  display: flex; align-items: center; gap: .5rem;
}
.alert-error   { background: #7f1d1d30; border: 1px solid #ef444440; color: #fca5a5; }
.alert-success { background: #064e3b30; border: 1px solid #10b98140; color: #6ee7b7; }
.alert-info    { background: #1e3a5f30; border: 1px solid #3b82f640; color: #93c5fd; }

/* ── Navbar ──────────────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #07051aee;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 1.5rem;
  height: 4rem;
  display: flex; align-items: center; gap: 1rem;
  overflow: visible;
}
.nav-brand { display: flex; align-items: center; gap: .55rem; flex-shrink: 0; }
.nav-logo   { width: 34px; height: 34px; border-radius: 50%; object-fit: contain; }
.nav-brand-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.1rem; font-weight: 800;
  color: var(--text); letter-spacing: -.01em;
}
.nav-brand-text em { color: var(--purple-2); font-style: normal; }

.nav-links {
  display: flex; align-items: center; gap: .05rem;
  flex: 1; justify-content: center; overflow: visible;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  display: flex; align-items: center; gap: .3rem;
  color: var(--text-muted); font-size: .82rem; font-weight: 600;
  padding: .35rem .65rem; border-radius: var(--radius-pill);
  white-space: nowrap; transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-hover); }
.nav-active { color: var(--purple-2) !important; background: var(--purple-glow) !important; }
.nav-icon { width: 13px; height: 13px; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex; align-items: center; gap: .3rem;
  color: var(--text-muted); font-size: .82rem; font-weight: 600;
  padding: .35rem .65rem; border-radius: var(--radius-pill);
  white-space: nowrap; cursor: pointer;
  transition: color .15s, background .15s;
  background: none; border: none; font-family: 'Nunito', sans-serif;
}
.nav-dropdown-toggle:hover { color: var(--text); background: var(--bg-hover); }
.nav-dropdown-toggle.nav-active { color: var(--purple-2); background: var(--purple-glow); }
.nav-dropdown-arrow { width: 10px; height: 10px; transition: transform .2s; flex-shrink: 0; stroke: currentColor; }
.nav-dropdown.open .nav-dropdown-arrow { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + .4rem); left: 0;
  background: #131030; border: 1px solid var(--border-hi);
  border-radius: var(--radius); padding: .35rem;
  min-width: 160px; display: none; z-index: 9999;
  box-shadow: 0 8px 32px #000000cc, 0 0 20px var(--purple-glow);
}
.nav-dropdown.open .nav-dropdown-menu { display: block !important; }
.nav-dropdown-item {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .65rem; border-radius: var(--radius-sm);
  color: var(--text-muted) !important; font-size: .82rem; font-weight: 600;
  transition: color .15s, background .15s; white-space: nowrap; text-decoration: none;
}
.nav-dropdown-item:hover { color: var(--text) !important; background: var(--bg-hover); }
.nav-dropdown-item.nav-active { color: var(--purple-2) !important; background: var(--purple-glow); }
.nav-dropdown-item i { width: 14px; height: 14px; }

/* Nav right */
.nav-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.nav-user  { display: flex; align-items: center; gap: .5rem; }
.nav-head  { width: 28px; height: 28px; border-radius: .35rem; border: 1px solid var(--border-glow); }
.nav-username { font-size: .82rem; font-weight: 700; color: var(--text); }
.nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-3);
  color: var(--text-muted); cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.nav-btn:hover { border-color: var(--border-glow); color: var(--purple-2); background: var(--bg-hover); }
.nav-btn i { width: 14px; height: 14px; }
.nav-btn-login {
  width: auto; padding: .3rem .9rem;
  font-size: .8rem; font-weight: 700;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
}
.nav-btn-register {
  width: auto; padding: .3rem .9rem;
  font-size: .8rem; font-weight: 700;
  background: var(--purple); color: #fff;
  border-color: var(--purple);
  font-family: 'Nunito', sans-serif;
}
.nav-btn-register:hover { background: #6d4ee8; color: #fff; }
.nav-btn-dash, .nav-btn-out { width: 28px; height: 28px; }

/* Mobile burger */
.nav-burger {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); padding: .3rem;
  cursor: pointer; transition: all .15s;
}
.nav-burger:hover { border-color: var(--border-glow); color: var(--purple-2); }
.nav-burger i { width: 18px; height: 18px; }

/* Overlay */
.nav-overlay {
  display: none; position: fixed; inset: 0; background: #000000bb; z-index: 99;
}
.nav-overlay.open { display: block; }

/* Mobile drawer */
.nav-mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 85vw);
  background: #100e28;
  border-left: 1px solid var(--border);
  z-index: 200; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  padding: 1rem;
}
.nav-mobile-drawer.open { transform: translateX(0); }
.nav-mobile-drawer-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem;
}
.nav-mobile-header-brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: 'Quicksand', sans-serif; font-size: 1rem; font-weight: 800; color: var(--text);
}
.nav-mobile-header-brand img { width: 28px; height: 28px; border-radius: 50%; }
.nav-mobile-header-brand em { color: var(--purple-2); font-style: normal; }
.nav-mobile-close {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); padding: .3rem; cursor: pointer;
}
.nav-mobile-close i { width: 16px; height: 16px; }
.nav-mobile-drawer-links {
  display: flex; flex-direction: column; gap: .2rem; flex: 1; overflow-y: auto;
}
.nav-mobile-drawer-links .nav-link,
.nav-mobile-drawer-links .nav-dropdown-toggle {
  width: 100%; justify-content: flex-start; border-radius: var(--radius-sm);
  padding: .6rem .75rem; font-size: .88rem;
}
.nav-mobile-drawer-links .nav-dropdown { width: 100%; }
.nav-mobile-drawer-links .nav-dropdown-menu {
  position: static; box-shadow: none;
  border: none; background: var(--bg-3);
  margin: .2rem 0 .2rem .5rem;
}
.nav-mobile-auth { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2rem 0; margin-top: 4rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: .6rem; }
.footer-logo  { width: 30px; height: 30px; border-radius: 50%; }
.footer-name  {
  font-family: 'Quicksand', sans-serif;
  font-size: .95rem; font-weight: 800; color: var(--text);
}
.footer-name em { color: var(--purple-2); font-style: normal; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-nav a { font-size: .83rem; color: var(--text-muted); transition: color .15s; }
.footer-nav a:hover { color: var(--purple-2); }
.footer-copy { font-size: .78rem; color: var(--text-faint); }

/* ── Role prefix ─────────────────────────────────────────────── */
.role-prefix {
  font-size: .72rem; font-weight: 800;
  margin-right: .25rem; letter-spacing: .02em;
}
.rp-owner     { color: #c4b5fd; }
.rp-manager   { color: #93c5fd; }
.rp-admin     { color: #fca5a5; }
.rp-developer { color: #6ee7b7; }
.rp-moderator { color: #a5b4fc; }
.rp-helper    { color: #d6d3d1; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links  { display: none; }
  .nav-burger { display: flex; }
  .form-row   { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-nav   { justify-content: center; }
}
