/* ── Space Test — Shared Theme ──────────────────────────────────────────────── */

:root {
    --bg-base:    #0E0C1A;
    --bg-card:    #1C1930;
    --bg-hover:   #252240;
    --cyan:       #A78BFA;
    --cyan-dim:   #5B3DAE;
    --purple:     #C084FC;
    --text:       #E8E0FF;
    --text-muted: #9088BB;
    --border:     #2D2A46;
    --success:    #4ADE80;
    --warn:       #FBBF24;
    --danger:     #F87171;
    --radius:     8px;
    --radius-lg:  14px;
    --font-mono:  'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --font-ui:    'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ── Reset ── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-base);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--purple); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ── Nav bar ── */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 32px;
    height: 58px;
    background: rgba(14, 12, 26, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.03em;
    text-decoration: none;
}

.nav-logo svg { width: 28px; height: 28px; flex-shrink: 0; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--bg-card);
    text-decoration: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--cyan-dim);
    object-fit: cover;
}

.nav-username {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: var(--radius);
    border: none;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--cyan-dim), var(--cyan));
    color: #fff;
    box-shadow: 0 0 14px rgba(167, 139, 250, 0.35);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover { background: rgba(248, 113, 113, 0.25); filter: none; }

.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ── Cards ── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ── Badges ── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-admin  { background: rgba(167, 139, 250, 0.2); color: var(--cyan);    border: 1px solid rgba(167,139,250,0.35); }
.badge-dev    { background: rgba(192, 132, 252, 0.2); color: var(--purple);  border: 1px solid rgba(192,132,252,0.35); }
.badge-user   { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid rgba(148,163,184,0.2); }

.badge-release { background: rgba(74, 222, 128, 0.15); color: var(--success); border: 1px solid rgba(74,222,128,0.3); }
.badge-beta    { background: rgba(251, 191, 36, 0.15); color: var(--warn);    border: 1px solid rgba(251,191,36,0.3);  }
.badge-alpha   { background: rgba(167, 139, 250, 0.15); color: var(--cyan);   border: 1px solid rgba(167,139,250,0.3); }
.badge-test    { background: rgba(192, 132, 252, 0.15); color: var(--purple); border: 1px solid rgba(192,132,252,0.3); }
.badge-indev   { background: rgba(248, 113, 113, 0.15); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }

/* ── Tables ── */

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child { border-bottom: none; }

tbody td {
    padding: 11px 14px;
    vertical-align: middle;
}

/* ── Forms ── */

.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
select,
textarea {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 9px 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--cyan-dim);
    box-shadow: 0 0 0 3px rgba(91, 61, 174, 0.25);
}

input[type="file"] {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    padding: 9px 12px;
    cursor: pointer;
    width: 100%;
}

select option { background: var(--bg-card); }

/* ── Progress bar ── */

.progress-wrap {
    height: 8px;
    background: var(--bg-base);
    border-radius: 999px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
    width: 0;
    transition: width 0.15s linear;
}

.progress-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

/* ── Stat tiles ── */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    text-align: center;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--cyan);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* ── Hero ── */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 96px 32px 72px;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% -10%, rgba(91,61,174,0.25) 0%, transparent 70%);
    pointer-events: none;
}

.hero-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cyan);
}

.hero-title {
    font-size: clamp(36px, 7vw, 72px);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text) 0%, var(--cyan) 60%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 520px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── Section ── */

.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 32px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Alert/toast ── */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-error   { background: rgba(248,113,113,0.1);  color: var(--danger);  border-color: rgba(248,113,113,0.25); }
.alert-success { background: rgba(74,222,128,0.1);   color: var(--success); border-color: rgba(74,222,128,0.25);  }
.alert-info    { background: rgba(167,139,250,0.1);  color: var(--cyan);    border-color: rgba(167,139,250,0.25); }

/* ── Upload section ── */

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .upload-section { grid-template-columns: 1fr; }
    .nav { padding: 0 16px; gap: 12px; }
    .section { padding: 32px 16px; }
    .hero { padding: 64px 16px 48px; }
}

/* ── Spinner ── */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(167, 139, 250, 0.3);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── User card ── */

.user-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--cyan-dim);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-base);
}

.user-info { display: flex; flex-direction: column; gap: 6px; }

.user-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.user-email { font-size: 14px; color: var(--text-muted); }

.user-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Footer ── */

footer {
    border-top: 1px solid var(--border);
    padding: 28px 32px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Space background canvas ── */

/* html provides the solid fallback colour before the canvas renders */
html { background: var(--bg-base); }

/* body must be transparent so the z-index:-1 canvas shows through */
body { background: transparent; }

/* Full-viewport fixed canvas — !important wins over any inline or other rule */
#space-bg {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: -1 !important;
    pointer-events: none !important;
    display: block !important;
}

/* ── Utility ── */

.hidden   { display: none !important; }
.mono     { font-family: var(--font-mono); font-size: 13px; }
.text-muted { color: var(--text-muted); }
.text-sm  { font-size: 13px; }
.gap-8    { display: flex; gap: 8px; align-items: center; }
.mt-8     { margin-top: 8px; }
.mt-16    { margin-top: 16px; }
.mt-24    { margin-top: 24px; }
.mb-8     { margin-bottom: 8px; }
.mb-16    { margin-bottom: 16px; }
.w-full   { width: 100%; }
