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

:root {
  --bg: #0a0e1a;
  --surface: #111827;
  --surface2: #1a2236;
  --border: rgba(255,255,255,0.07);
  --primary: #3b82f6;
  --primary-glow: rgba(59,130,246,0.25);
  --accent: #f59e0b;
  --accent-glow: rgba(245,158,11,0.2);
  --success: #10b981;
  --danger: #ef4444;
  --text: #f1f5f9;
  --muted: #64748b;
  --muted2: #94a3b8;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  line-height: 1.2;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--accent);
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.glow {
  position: relative;
}

.glow::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--text);
  margin-bottom: 12px;
}

.section-title p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: 16px;
}

.glass-hover {
  transition: all 0.3s ease;
}

.glass-hover:hover {
  border-color: var(--primary);
  box-shadow: 0 0 30px var(--primary-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
  background: #2563eb;
  box-shadow: 0 0 40px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-accent:hover {
  box-shadow: 0 0 40px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 30px var(--primary-glow);
  transform: translateY(-4px);
}

/* Scroll animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.navbar-logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--muted2);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.nav-links .dropdown {
  position: relative;
}

.nav-links .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  z-index: 100;
}

.nav-links .dropdown:hover .dropdown-menu {
  display: block;
}

.nav-links .dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.nav-links .dropdown-menu a:hover {
  background: rgba(59,130,246,0.1);
  color: var(--primary);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-auth .btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 24px;
}

.hero h1 {
  font-size: 4.5rem;
  margin-bottom: 8px;
  color: var(--text);
  min-height: 1.2em;
}

.hero h1::after {
  content: '|';
  animation: blink 0.7s steps(1) infinite;
  font-weight: 100;
}

.hero h1.typed::after {
  display: none;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero .tagline {
  font-size: 1.6rem;
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  margin-bottom: 8px;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--muted2);
  margin-bottom: 36px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.section-padding {
  padding: 100px 0;
}

/* ===== GRIDS ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 24px;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 40px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: var(--muted2);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-input, .form-select, textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s;
  outline: none;
}

.form-input:focus, .form-select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.form-input.error {
  border-color: var(--danger);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 4px;
}

.form-success {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 4px;
}

.form-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.auth-card {
  max-width: 460px;
  margin: 120px auto 40px;
  padding: 40px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 32px;
}

.auth-card .auth-link {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
}

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

table tr:hover td {
  background: rgba(59,130,246,0.03);
}

table tr.highlight td {
  background: rgba(59,130,246,0.08);
  color: var(--primary);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #b45309, #92400e); color: #fff; }

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-easy { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-medium { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-hard { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ===== FOOTER ===== */
.footer {
  padding: 48px 0 24px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand h3 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.footer-brand h3 span { color: var(--primary); }
.footer-brand p { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted2);
  transition: all 0.3s;
  font-size: 1.1rem;
}

.footer-social a:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color 0.3s;
}

.footer-col a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }

/* ===== COMING SOON ===== */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 24px;
}

.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: 24px;
  opacity: 0.5;
}

.coming-soon h2 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.coming-soon p {
  color: var(--muted);
  max-width: 500px;
  font-size: 1.1rem;
}

/* ===== MISC ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  font-size: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navbar .container { flex-wrap: wrap; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 16px 24px 8px;
    gap: 4px;
    background: rgba(10,14,26,0.98);
    border-bottom: 1px solid var(--border);
    position: static;
  }
  .nav-links.open { display: flex; }
  .nav-links .dropdown-menu {
    position: static;
    display: none;
    background: var(--surface2);
    margin-top: 4px;
  }
  .nav-links .dropdown.open .dropdown-menu { display: block; }
  .nav-auth { display: none; width: 100%; padding: 8px 24px 16px; background: rgba(10,14,26,0.98); border-bottom: 1px solid var(--border); }
  .nav-auth.open { display: flex; flex-direction: column; gap: 8px; }
  .nav-auth.open .btn-sm { width: 100%; text-align: center; justify-content: center; }

  .hero h1 { font-size: 2.8rem; }
  .hero .tagline { font-size: 1.2rem; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }

  .section-title h2 { font-size: 1.8rem; }
  .section-padding { padding: 60px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .auth-card { padding: 24px; margin-top: 100px; }

  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { padding: 8px 16px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: 1rem; }
  .navbar-logo { font-size: 1.1rem; }
}
