:root {
  --bg-primary: #07090e;
  --bg-card: rgba(14, 20, 31, 0.75);
  --bg-card-hover: rgba(22, 31, 48, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.25);
  --accent-cyan: #00f0ff;
  --accent-green: #34c759;
  --accent-purple: #af52de;
  --accent-amber: #ffcc00;
  --accent-red: #ff3b30;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(175, 82, 222, 0.04) 0%, transparent 45%);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
}

.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

/* Header */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-radius: 0 0 16px 16px;
  border-top: none;
}

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

.logo-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-cyan), #007aff);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.nav-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
}

.nav-btn.admin-link {
  color: var(--accent-amber);
  border-color: rgba(255, 204, 0, 0.2);
  text-decoration: none;
}

.nav-btn.admin-link:hover {
  background: rgba(255, 204, 0, 0.1);
}

.user-auth-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.primary-btn {
  background: linear-gradient(135deg, #00f0ff, #007aff);
  color: #050b14;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.25);
}

.primary-btn:hover {
  box-shadow: 0 6px 18px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px 4px 6px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 26px;
  height: 26px;
  background: var(--accent-cyan);
  color: #050b14;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 48px;
}

.hero-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

/* Playgrounds Grid */
.playgrounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.playground-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.playground-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.card-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.card-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.bg-purple-glow { background: rgba(175, 82, 222, 0.15); border: 1px solid rgba(175, 82, 222, 0.3); }
.bg-cyan-glow { background: rgba(0, 240, 255, 0.15); border: 1px solid rgba(0, 240, 255, 0.3); }
.bg-amber-glow { background: rgba(255, 204, 0, 0.15); border: 1px solid rgba(255, 204, 0, 0.3); }

.playground-card h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.playground-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-bottom: 20px;
}

.card-stats strong {
  color: var(--text-primary);
}

.launch-btn {
  text-decoration: none;
}

/* Dashboard & Keys */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.alert-box {
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

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

.keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.keys-table th {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
}

.keys-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Status Badges */
.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-active {
  background: rgba(52, 199, 89, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.status-pending {
  background: rgba(255, 204, 0, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 204, 0, 0.3);
}

.status-revoked {
  background: rgba(255, 59, 48, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 59, 48, 0.3);
}

/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.sandbox-card, .code-snippets-card {
  padding: 28px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.cyber-input, .cyber-select, .cyber-textarea {
  width: 100%;
  background: rgba(5, 11, 20, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.2s ease;
}

.cyber-input:focus, .cyber-select:focus, .cyber-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.result-box {
  margin-top: 20px;
  background: rgba(5, 11, 20, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.code-output {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
}

.code-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.code-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.code-tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.snippet-box {
  background: rgba(5, 11, 20, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #34d399;
  overflow-x: auto;
  margin-bottom: 24px;
}

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

.features-list h4 {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.features-list ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  width: 440px;
  max-width: 90vw;
  padding: 32px;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding-bottom: 8px;
}

.auth-tab.active {
  color: var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
}

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-green); }
.text-purple { color: var(--accent-purple); }
.text-amber { color: var(--accent-amber); }
.text-muted { color: var(--text-muted); }
