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

* { box-sizing: border-box; }

:root {
  --bg: #030304;
  --bg-elevated: #0d0d12;
  --bg-card: #131318;
  --bg-card-hover: #1a1a22;
  --border: #24242e;
  --border-glow: #a855f7;
  --text: #f8f8fb;
  --text-muted: #85859a;
  --accent: #a855f7;
  --accent2: #ff2fb8;
  --accent3: #22d3ee;
  --accent4: #fbbf24;
  --success: #34e29c;
  --danger: #ff4869;
  --radius: 18px;
}

@keyframes hueShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}
@keyframes floatBg1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(5%, -8%) scale(1.1); }
  66% { transform: translate(-6%, 4%) scale(0.95); }
}
@keyframes floatBg2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(-8%, 6%) scale(1.05); }
  66% { transform: translate(4%, -5%) scale(0.9); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(168,85,247,0.3), 0 0 40px rgba(255,47,184,0.1); }
  50% { box-shadow: 0 0 30px rgba(168,85,247,0.5), 0 0 60px rgba(255,47,184,0.2); }
}
@keyframes borderRotate {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 10px;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -15%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(168,85,247,0.35) 0%, transparent 65%);
  filter: blur(80px);
  animation: floatBg1 25s ease-in-out infinite, hueShift 40s linear infinite;
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  right: -15%;
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle, rgba(34,211,238,0.25) 0%, transparent 65%);
  filter: blur(80px);
  animation: floatBg2 30s ease-in-out infinite reverse;
  z-index: 0;
  pointer-events: none;
}

.nav {
  display: flex;
  gap: 4px;
  padding: 18px 34px;
  background: rgba(10, 10, 14, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent) 1;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 21px;
  margin-right: 30px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3), var(--accent));
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  animation: shimmer 6s linear infinite;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 17px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav a:hover {
  color: var(--text);
  background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(255,47,184,0.1));
  transform: translateY(-2px);
}

.nav form { margin-left: auto; }

.content {
  padding: 44px;
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 30px 0;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--text) 20%, var(--accent) 50%, var(--accent2) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 8s linear infinite;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 40px 0 16px 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

h2::before {
  content: '';
  width: 5px;
  height: 20px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: 5px;
  display: inline-block;
  box-shadow: 0 0 12px rgba(168,85,247,0.6);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}

.card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
  padding: 24px 28px;
  border-radius: var(--radius);
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent3), var(--accent2), transparent 60%);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  background: linear-gradient(160deg, var(--bg-card-hover), var(--bg-elevated));
  box-shadow: 0 16px 40px rgba(168, 85, 247, 0.2), 0 0 0 1px rgba(168,85,247,0.1);
}

.card:hover::before {
  opacity: 1;
  animation: borderRotate 3s linear infinite;
}

.card h3 {
  margin: 0 0 8px 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  margin-bottom: 30px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  background: transparent;
}

th, td {
  text-align: left;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.07em;
  background: var(--bg-elevated);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(168, 85, 247, 0.05); }

input, textarea, select {
  padding: 12px 16px;
  margin: 4px 4px 4px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.25s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
}

button {
  padding: 12px 22px;
  margin: 4px 4px 4px 0;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  background-size: 200% auto;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
  position: relative;
  overflow: hidden;
}

button:hover {
  transform: translateY(-2px);
  background-position: right center;
  box-shadow: 0 8px 26px rgba(168, 85, 247, 0.5), 0 0 20px rgba(255,47,184,0.3);
}

button:active { transform: translateY(0) scale(0.98); }

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

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  position: relative;
}

.login-box {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
  padding: 44px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  width: 350px;
  gap: 8px;
  position: relative;
  z-index: 1;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: pulseGlow 4s ease-in-out infinite;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 22px;
  font-size: 30px;
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin: 0 0 10px 0;
  padding: 10px 14px;
  background: rgba(255, 72, 105, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255,72,105,0.2);
}

.badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success { background: rgba(52, 226, 156, 0.15); color: var(--success); box-shadow: 0 0 12px rgba(52,226,156,0.15); }
.badge-danger { background: rgba(255, 72, 105, 0.15); color: var(--danger); box-shadow: 0 0 12px rgba(255,72,105,0.15); }
.badge-muted { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.achievement {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin: 3px;
  transition: transform 0.2s ease;
}
.achievement:hover { transform: scale(1.05); }
.achievement.earned {
  background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(255,47,184,0.25));
  color: var(--text);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 16px rgba(168,85,247,0.25);
}
.achievement.locked {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

@media (max-width: 720px) {
  .nav { flex-wrap: wrap; padding: 15px 20px; gap: 6px; row-gap: 8px; }
  .nav .brand { width: 100%; margin-right: 0; margin-bottom: 4px; }
  .nav a { padding: 8px 13px; font-size: 13px; }
  .nav form { margin-left: 0; order: 99; width: 100%; }
  .nav form button { width: 100%; }
  .content { padding: 22px; }
  h1 { font-size: 26px; }
  h2 { font-size: 18px; margin-top: 30px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 13px; }
  .card { padding: 18px 20px; }
  .card h3 { font-size: 26px; }
  table { min-width: 500px; }
  th, td { padding: 12px 15px; font-size: 13px; }
  input, textarea, select, button { width: 100%; margin: 4px 0; font-size: 16px; }
  form { display: flex; flex-direction: column; }
  form[style*="inline"], form[style*="display:inline"] { display: inline-block !important; width: auto; }
  .login-box { width: 90vw; max-width: 350px; padding: 30px; }
}

@media (max-width: 400px) {
  .cards { grid-template-columns: 1fr; }
}
