/* ═══════════════════════════════════════════════════════════
   Dasima.fun - Main Stylesheet
   Dark Gaming Theme
═══════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1e1e2a;
  --border: #2a2a3a;
  --border-light: #3a3a4a;
  --accent: #7c3aed;
  --accent-light: #9d5cf6;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --accent2: #06b6d4;
  --accent2-glow: rgba(6, 182, 212, 0.3);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --text-primary: #f1f1f5;
  --text-secondary: #9999aa;
  --text-muted: #666677;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Particles ─────────────────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: float-up linear infinite;
}
@keyframes float-up {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  height: 64px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
  margin-right: 2rem;
}
.logo-icon { font-size: 1.5rem; }
.logo-text .accent { color: var(--accent-light); }
.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-auth, .nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-badge {
  font-size: 0.85rem;
  color: var(--accent-light);
  background: rgba(124, 58, 237, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(124, 58, 237, 0.3);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }
.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.btn-success:hover { background: rgba(16, 185, 129, 0.25); }
.btn-lg { padding: 12px 28px; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Pages ──────────────────────────────────────────────── */
main { padding-top: 64px; position: relative; z-index: 1; }
.page { display: none; }
.page.active { display: block; }

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 6rem;
  gap: 4rem;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { flex: 1; max-width: 560px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--accent-light);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent-light), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual {
  flex: 1;
  max-width: 400px;
  position: relative;
  height: 300px;
}
.floating-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  animation: float 3s ease-in-out infinite;
  min-width: 160px;
}
.floating-card span { font-size: 1.8rem; }
.card-title { font-weight: 600; font-size: 0.9rem; }
.card-sub { font-size: 0.75rem; color: var(--text-muted); }
.card-1 { top: 0; left: 0; animation-delay: 0s; }
.card-2 { top: 50%; right: 0; animation-delay: 1s; }
.card-3 { bottom: 0; left: 20%; animation-delay: 2s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ─── Stats ──────────────────────────────────────────────── */
.stats-section {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 3rem 6rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.stat-card {
  text-align: center;
  padding: 1.5rem 3rem;
}
.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }

/* ─── Features ───────────────────────────────────────────── */
.features-section {
  padding: 5rem 6rem;
}
.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
}
.feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ─── Page Container ─────────────────────────────────────── */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.page-header { text-align: center; margin-bottom: 3rem; }
.page-title { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.page-desc { color: var(--text-secondary); }

/* ─── Generate Page ──────────────────────────────────────── */
.generate-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.generate-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}
.form-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.key-input-wrap { position: relative; }
.key-input { padding-right: 40px; font-family: monospace; font-size: 0.9rem; }
.key-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.type-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.type-card:hover { border-color: var(--accent); }
.type-card.selected {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.1);
}
.type-card.out-of-stock { opacity: 0.4; cursor: not-allowed; }
.type-name { font-weight: 600; font-size: 0.9rem; }
.type-count { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.type-count.available { color: var(--success); }
.type-loading { color: var(--text-muted); font-size: 0.9rem; padding: 1rem; }

/* Result Card */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.1);
}
.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}
.result-icon { font-size: 1.5rem; }
.result-header h3 { font-size: 1.2rem; color: var(--success); }
.result-field { margin-bottom: 1rem; }
.result-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: block;
}
.result-value-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.result-value {
  flex: 1;
  font-family: monospace;
  font-size: 0.95rem;
  word-break: break-all;
}
.result-type {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-light);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}
.copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }
.result-warning {
  margin-top: 1rem;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--warning);
}

/* ─── History ────────────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--transition);
}
.history-item:hover { border-color: var(--border-light); }
.history-info { flex: 1; }
.history-type {
  display: inline-block;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.history-account { font-family: monospace; font-size: 0.9rem; }
.history-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.history-key { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; }
.loading-state, .empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* ─── Modals ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); border-color: var(--border-light); }
.modal-header { text-align: center; margin-bottom: 2rem; }
.modal-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.modal-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.modal-header p { color: var(--text-secondary); font-size: 0.9rem; }
.modal-form .form-group { margin-bottom: 1.25rem; }
.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.form-switch {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.form-switch a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
}
.form-switch a:hover { text-decoration: underline; }

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--error); color: var(--error); }
.toast.info { border-color: var(--accent); color: var(--accent-light); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.type-stock-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--success);
}
select.form-input option:disabled { color: var(--text-muted); }

.hidden { display: none !important; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { padding: 3rem 2rem; flex-direction: column; text-align: center; }
  .hero-title { font-size: 2.5rem; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .stats-section { padding: 2rem; gap: 1rem; flex-wrap: wrap; }
  .features-section { padding: 3rem 2rem; }
  .generate-layout { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; }
}
