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

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

:root {
  --bg: #08080d;
  --surface: #111118;
  --surface-2: #1a1a24;
  --surface-3: #222233;
  --fire: #ff4400;
  --fire-glow: rgba(255, 68, 0, 0.15);
  --fire-hover: #ff5511;
  --gold: #ffc800;
  --gold-dim: rgba(255, 200, 0, 0.1);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.1);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.1);
  --text: #f0f0f5;
  --text-dim: #8888a0;
  --text-muted: #555566;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

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

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

a { color: var(--fire); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--fire-hover); }

/* NAV */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 8, 13, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo span { color: var(--fire); }

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

.nav-link {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--text); }

.nav-link.active { color: var(--fire); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fire-glow);
  border: 2px solid var(--fire);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fire);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--fire-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(255, 68, 0, 0.25);
  color: white;
}

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

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 8px 16px;
}

.btn-ghost:hover { color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.btn-success {
  background: var(--green);
  color: white;
}
.btn-success:hover { background: #16a34a; color: white; }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #dc2626; color: white; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-select option {
  background: var(--surface);
  color: var(--text);
}

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

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

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

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-clickable:hover {
  transform: translateY(-2px);
  cursor: pointer;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-fire { background: var(--fire-glow); color: var(--fire); }
.badge-gold { background: var(--gold-dim); color: var(--gold); }
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-dim { background: rgba(136, 136, 160, 0.1); color: var(--text-dim); }

/* LAYOUT */
.page {
  padding-top: 80px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.container-sm {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 32px;
}

.page-header {
  padding: 40px 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 4px;
}

/* GRID */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* TABS */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--fire); border-bottom-color: var(--fire); }

/* PRIZE TIER */
.prize-tier {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.prize-views {
  font-weight: 600;
  color: var(--gold);
  min-width: 100px;
}

.prize-amount {
  font-weight: 700;
  color: var(--green);
  font-size: 1.1rem;
}

.prize-arrow {
  color: var(--text-muted);
}

/* NICHE FILTER */
.niche-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.niche-btn {
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.niche-btn:hover { border-color: var(--border-hover); color: var(--text); }
.niche-btn.active { background: var(--fire-glow); color: var(--fire); border-color: var(--fire); }

/* STATS */
.stat-row {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--fire);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

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

/* APPLICATION ROW */
.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.app-row:hover { border-color: var(--border-hover); }

.app-info { flex: 1; }
.app-info h4 { font-size: 0.95rem; margin-bottom: 2px; }
.app-info p { font-size: 0.85rem; color: var(--text-dim); }

.app-actions {
  display: flex;
  gap: 8px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ROLE TOGGLE */
.role-toggle {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.role-option {
  flex: 1;
  padding: 14px 20px;
  text-align: center;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.2s;
  border: none;
  background: none;
  font-family: inherit;
}

.role-option:hover { color: var(--text); background: var(--surface-2); }
.role-option.active {
  background: var(--fire-glow);
  color: var(--fire);
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav { padding: 12px 16px; }
  .nav-links { gap: 12px; }
  .container, .container-sm { padding: 0 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .stat-row { flex-direction: column; gap: 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .app-row { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--fire);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-center {
  display: flex;
  justify-content: center;
  padding: 60px;
}
