/* ============================================================
   VibeCodes.co.za — FPS HUD Design System
   Fonts: Orbitron, Share Tech Mono, Rajdhani
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --bg:          #050a0f;
  --bg2:         #080f18;
  --bg3:         #0b1520;
  --panel:       rgba(8,15,28,0.92);
  --border:      rgba(0,255,209,0.18);
  --border-hi:   rgba(0,255,209,0.55);
  --accent:      #00FFD1;
  --accent2:     #FF3A6E;
  --accent3:     #FFB800;
  --text:        #c8dde8;
  --text-dim:    #4a6a7e;
  --text-bright: #e8f4ff;
  --card-color:  #00FFD1;
  --user-color:  #00FFD1;
  --mono:        'Share Tech Mono', monospace;
  --hud:         'Orbitron', sans-serif;
  --body:        'Rajdhani', sans-serif;
  --glow: 0 0 12px var(--accent), 0 0 30px rgba(0,255,209,0.2);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }
.dim { color: var(--text-dim); font-style: italic; }

/* ── Atmosphere ───────────────────────────────────────────── */
.scanlines {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0px, transparent 2px,
    rgba(0,0,0,0.18) 2px, rgba(0,0,0,0.18) 4px
  );
  animation: scanFlicker 6s infinite;
}
@keyframes scanFlicker {
  0%,94%,100% { opacity: 1; }
  95% { opacity: .85; }
  96% { opacity: 1; }
  97% { opacity: .9; }
}

.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,255,209,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,209,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 20s linear infinite;
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 0 48px; }
}

/* ── HUD Header ───────────────────────────────────────────── */
.hud-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .6rem 2rem;
  background: rgba(5,10,15,.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.hud-logo {
  font-family: var(--hud);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: .1em;
  color: var(--text-bright);
  text-decoration: none;
}
.logo-bracket { color: var(--text-dim); }
.logo-accent  { color: var(--accent); text-shadow: var(--glow); }
.hud-meta { display: flex; gap: 1.5rem; margin-left: auto; }
.hud-stat { font-family: var(--mono); font-size: .72rem; color: var(--text-dim); }
.hud-val  { color: var(--text); }
.hud-val.online { color: var(--accent); animation: blink 2s step-start infinite; }
@keyframes blink { 50% { opacity: .4; } }

.hud-nav { display: flex; gap: .75rem; }
.btn-hud {
  font-family: var(--mono); font-size: .75rem;
  padding: .35rem .9rem;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  letter-spacing: .05em;
}
.btn-hud:hover, .btn-hud.active {
  border-color: var(--accent);
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
  box-shadow: 0 0 12px rgba(0,255,209,.15);
  background: rgba(0,255,209,.04);
}
.btn-hud.accent { border-color: var(--accent3); color: var(--accent3); }
.btn-hud.accent:hover { text-shadow: 0 0 8px var(--accent3); box-shadow: 0 0 12px rgba(255,184,0,.2); }
.btn-hud.danger { border-color: var(--accent2); color: var(--accent2); }
.btn-hud.danger:hover { text-shadow: 0 0 8px var(--accent2); }

/* ── Flash ────────────────────────────────────────────────── */
.flash {
  position: relative; z-index: 50;
  font-family: var(--mono); font-size: .8rem;
  padding: .75rem 2rem;
  display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid;
  animation: flashIn .4s ease;
}
@keyframes flashIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.flash-success { background: rgba(0,255,100,.07); border-color: rgba(0,255,100,.3); color: #00ff64; }
.flash-warning { background: rgba(255,184,0,.07); border-color: rgba(255,184,0,.3); color: var(--accent3); }
.flash-info    { background: rgba(0,255,209,.07); border-color: var(--border); color: var(--accent); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative; z-index: 1;
  padding: 4rem 2rem 2rem;
  text-align: center;
}
.hero-pre {
  font-family: var(--mono); font-size: .78rem;
  color: var(--accent); letter-spacing: .12em;
  margin-bottom: 1rem;
  animation: fadeUp .6s ease both;
}
.hero-title {
  font-family: var(--hud); font-weight: 900;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.05;
  color: var(--text-bright);
  letter-spacing: .05em;
  animation: fadeUp .7s .1s ease both;
}
.hero-accent {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent), 0 0 60px rgba(0,255,209,.3);
  display: block;
}
.hero-sub {
  margin-top: 1rem;
  font-size: 1.05rem; color: var(--text-dim);
  max-width: 540px; margin-inline: auto;
  animation: fadeUp .7s .2s ease both;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:none; }
}

/* Crosshair */
.hero-crosshair {
  position: absolute; top: 2.5rem; right: 10%;
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.ch-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--accent);
}
.ring1 { width: 60px; height: 60px; opacity: .3; animation: rotate 8s linear infinite; }
.ring2 { width: 80px; height: 80px; opacity: .15; animation: rotate 12s linear infinite reverse; border-style: dashed; }
.ch-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); animation: blink 1.2s step-start infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

/* ── Class Grid ───────────────────────────────────────────── */
.class-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 2rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.class-card {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.06);
  padding: 2rem 1.75rem 1.75rem;
  cursor: pointer;
  text-decoration: none;
  display: flex; flex-direction: column; gap: .75rem;
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  animation: fadeUp .5s calc(var(--index, 0) * .08s + .3s) ease both;
}
.class-card:nth-child(1) { --index:0; }
.class-card:nth-child(2) { --index:1; }
.class-card:nth-child(3) { --index:2; }
.class-card:nth-child(4) { --index:3; }
.class-card:nth-child(5) { --index:4; }
.class-card:nth-child(6) { --index:5; }

.class-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-color);
  box-shadow: 0 0 30px rgba(0,0,0,.5), 0 0 20px color-mix(in srgb, var(--card-color) 20%, transparent);
}
.class-card:hover .card-glow { opacity: 1; }
.class-card:hover .stat-fill { box-shadow: 0 0 8px var(--card-color); }

/* Card corners */
.card-corner {
  position: absolute; width: 14px; height: 14px;
  border-color: var(--card-color); border-style: solid; opacity: .7;
}
.tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.card-index { font-family: var(--mono); font-size: .7rem; color: var(--text-dim); margin-bottom: .25rem; }
.card-icon  { font-size: 2.25rem; line-height: 1; }
.card-label { font-family: var(--hud); font-size: 1.2rem; font-weight: 700; color: var(--card-color); letter-spacing: .05em; text-shadow: 0 0 10px var(--card-color); }
.card-desc  { font-size: .88rem; color: var(--text-dim); line-height: 1.5; flex: 1; }

/* Stat bars */
.card-stats { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.stat-row   { display: flex; align-items: center; gap: .5rem; }
.stat-name  { font-family: var(--mono); font-size: .65rem; color: var(--text-dim); width: 70px; flex-shrink: 0; }
.stat-bar   { flex: 1; height: 3px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: hidden; }
.stat-fill  { height: 100%; background: var(--card-color); border-radius: 2px; transition: width .8s ease; }
.stat-num   { font-family: var(--mono); font-size: .65rem; color: var(--text-dim); width: 24px; text-align: right; }

.card-action {
  font-family: var(--mono); font-size: .78rem;
  color: var(--card-color); letter-spacing: .08em;
  margin-top: .5rem;
  opacity: .7; transition: opacity .2s;
}
.class-card:hover .card-action { opacity: 1; }
.arrow { display: inline-block; transition: transform .2s; }
.class-card:hover .arrow { transform: translateX(6px); }

.card-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--card-color) 10%, transparent) 0%, transparent 70%);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}

/* ── Footer ───────────────────────────────────────────────── */
.hud-footer {
  position: relative; z-index: 1;
  font-family: var(--mono); font-size: .7rem;
  color: var(--text-dim);
  text-align: center; padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: center; gap: 1rem;
}
.sep { opacity: .3; }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-page body, body.auth-page {
  display: flex; flex-direction: column; min-height: 100vh;
}
.auth-container {
  position: relative; z-index: 1;
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 2.5rem;
  width: 100%; max-width: 560px;
  position: relative;
  animation: fadeUp .5s ease;
}
.auth-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-color, var(--accent)), transparent);
}
.auth-breadcrumb { font-family: var(--mono); font-size: .7rem; color: var(--text-dim); margin-bottom: .5rem; }
.auth-title {
  font-family: var(--hud); font-weight: 900; font-size: 1.8rem;
  color: var(--text-bright); letter-spacing: .08em; margin-bottom: 1rem;
}
.auth-title .accent { color: var(--accent); }
.selected-class-badge {
  display: inline-block; font-family: var(--mono); font-size: .75rem;
  padding: .3rem .9rem; border: 1px solid; margin-bottom: 1.25rem;
  letter-spacing: .06em;
}

/* Login anim */
.login-anim {
  position: relative; width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.la-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--accent); opacity: .4;
}
.la-ring { width: 40px; height: 40px; animation: rotate 4s linear infinite; }
.la-ring.r2 { width: 50px; height: 50px; opacity: .2; animation: rotate 7s linear infinite reverse; border-style: dashed; }
.la-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }

/* Form errors */
.form-error {
  font-family: var(--mono); font-size: .8rem;
  background: rgba(255,58,110,.08);
  border: 1px solid rgba(255,58,110,.3);
  color: var(--accent2); padding: .75rem 1rem;
  margin-bottom: 1.25rem;
}

/* ── Forms ────────────────────────────────────────────────── */
.hud-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-label { font-family: var(--mono); font-size: .72rem; color: var(--text-dim); letter-spacing: .06em; }
.form-input {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text-bright);
  font-family: var(--mono); font-size: .88rem;
  padding: .6rem .9rem;
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0,255,209,.1);
  background: rgba(0,255,209,.03);
}
.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { resize: vertical; min-height: 80px; }
.file-input { padding: .5rem; cursor: pointer; }
.file-input::-webkit-file-upload-button {
  background: rgba(0,255,209,.08); border: 1px solid var(--border);
  color: var(--accent); font-family: var(--mono); font-size: .75rem;
  padding: .3rem .8rem; cursor: pointer; margin-right: .75rem;
}

/* Category Selector */
.cat-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.cat-option {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .75rem .5rem;
  border: 1px solid var(--border);
  cursor: pointer; transition: all .2s;
  text-align: center;
}
.cat-option input { display: none; }
.cat-option:hover, .cat-option.selected {
  border-color: var(--opt-color, var(--accent));
  background: rgba(0,255,209,.04);
  box-shadow: 0 0 14px rgba(0,255,209,.1);
}
.cat-option.selected .opt-label { color: var(--opt-color, var(--accent)); text-shadow: 0 0 8px var(--opt-color, var(--accent)); }
.opt-icon  { font-size: 1.5rem; line-height: 1; }
.opt-label { font-family: var(--mono); font-size: .68rem; color: var(--text-dim); letter-spacing: .04em; }

/* Primary button */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  background: rgba(0,255,209,.08);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--hud); font-size: .9rem; font-weight: 700;
  letter-spacing: .1em;
  padding: .85rem 1.5rem;
  cursor: pointer; width: 100%;
  transition: all .25s; margin-top: .5rem;
}
.btn-primary:hover {
  background: rgba(0,255,209,.15);
  box-shadow: 0 0 20px rgba(0,255,209,.2), inset 0 0 20px rgba(0,255,209,.05);
  transform: translateY(-2px);
}
.btn-primary .btn-icon { font-size: 1.1rem; transition: transform .2s; }
.btn-primary:hover .btn-icon { transform: translateX(6px); }
.btn-primary.small { padding: .6rem 1.2rem; font-size: .8rem; margin-top: 0; }

.auth-switch { font-family: var(--mono); font-size: .78rem; color: var(--text-dim); text-align: center; margin-top: 1.25rem; }

/* ── Profile Layout ───────────────────────────────────────── */
body.profile-page { display: flex; flex-direction: column; }
.profile-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  grid-template-rows: auto;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  max-width: 1400px; width: 100%; margin: 0 auto;
  flex: 1;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  position: relative;
}
.panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--user-color), transparent);
  opacity: .5;
}
.panel-header {
  font-family: var(--mono); font-size: .72rem;
  color: var(--accent); letter-spacing: .08em;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.panel-header-right { color: var(--text-dim); font-size: .65rem; }
.mt { margin-top: .5rem; }

/* Identity panel */
.panel-identity { padding-bottom: 1.5rem; text-align: center; }
.avatar-container {
  position: relative; width: 100px; height: 100px;
  margin: 1.5rem auto 1rem;
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-placeholder {
  width: 100%; height: 100%; border-radius: 50%;
  background: rgba(0,255,209,.08);
  border: 2px solid var(--user-color);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--hud); font-size: 1.75rem; font-weight: 900;
  color: var(--user-color);
}
.avatar-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid var(--user-color); opacity: .4;
  animation: rotate 8s linear infinite;
}

.id-name    { font-size: 1.1rem; font-weight: 600; color: var(--text-bright); padding: 0 1rem; }
.id-callsign{ font-family: var(--mono); font-size: .85rem; color: var(--user-color); padding: .1rem 0; }
.id-email   { font-family: var(--mono); font-size: .7rem; color: var(--text-dim); padding: 0 .5rem; word-break: break-all; }

.class-badge {
  display: inline-block; font-family: var(--mono); font-size: .72rem;
  padding: .3rem .9rem; border: 1px solid; margin: .75rem auto;
  letter-spacing: .06em;
}

.xp-section { padding: 0 1.5rem; margin-top: .5rem; }
.xp-label   { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .7rem; color: var(--text-dim); margin-bottom: .4rem; }
.xp-track   { position: relative; height: 4px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: visible; }
.xp-fill    { height: 100%; background: var(--user-color); border-radius: 2px; transition: width 1s ease; box-shadow: 0 0 8px var(--user-color); }
.xp-glow    { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--user-color); }
.xp-sub     { font-family: var(--mono); font-size: .66rem; color: var(--text-dim); text-align: right; margin-top: .3rem; }
.member-since { font-family: var(--mono); font-size: .65rem; color: var(--text-dim); margin-top: 1rem; padding: 0 1rem; }

/* Main panel */
.panel-main { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.profile-section { display: flex; flex-direction: column; gap: .6rem; }
.section-label { font-family: var(--mono); font-size: .72rem; color: var(--accent); letter-spacing: .08em; }
.bio-text { font-size: .95rem; color: var(--text); line-height: 1.6; }

/* Achievements */
.achievement-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.achievement-badge {
  display: flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  padding: .35rem .8rem;
  font-family: var(--mono); font-size: .72rem;
  cursor: default; transition: border-color .2s;
}
.achievement-badge:hover { border-color: var(--accent); }
.ach-icon { font-size: 1rem; }
.ach-name { color: var(--text); }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-top: .25rem; }
.stat-card {
  background: rgba(0,255,209,.04); border: 1px solid var(--border);
  padding: 1rem .75rem; text-align: center;
}
.sc-val  { font-family: var(--hud); font-size: 1.6rem; font-weight: 700; color: var(--user-color); }
.sc-label{ font-family: var(--mono); font-size: .62rem; color: var(--text-dim); margin-top: .2rem; letter-spacing: .06em; }

/* Activity panel */
.panel-activity { padding: 0; display: flex; flex-direction: column; }
.activity-list  { flex: 1; padding: .75rem 1.25rem; list-style: none; display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; max-height: 240px; }
.activity-item  { display: flex; flex-direction: column; gap: .1rem; padding: .5rem; border-left: 2px solid var(--border); background: rgba(255,255,255,.02); }
.act-action { font-family: var(--mono); font-size: .68rem; color: var(--accent); letter-spacing: .06em; }
.act-detail { font-size: .82rem; color: var(--text-dim); }
.act-time   { font-family: var(--mono); font-size: .63rem; color: var(--text-dim); opacity: .6; }

.panel-activity .hud-form { padding: .75rem 1.25rem 1.25rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .profile-grid { grid-template-columns: 240px 1fr; grid-template-rows: auto auto; }
  .panel-activity { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .profile-grid { grid-template-columns: 1fr; padding: 1rem; }
  .class-grid { grid-template-columns: 1fr 1fr; padding: 1rem; gap: 1rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .cat-selector { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .hud-meta { display: none; }
  .auth-card { padding: 1.5rem 1.25rem; }
}
@media (max-width: 480px) {
  .class-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.5rem; }
  .hud-header { padding: .6rem 1rem; gap: .75rem; }
}
