/* Cloude Hack — Dark Purple Theme */
:root {
  --bg: #08060e;
  --bg-card: #0f0b18;
  --bg-input: #151020;
  --border: #1f1a2e;
  --border-hover: #2d2540;
  --text: #e8e4f0;
  --text-muted: #7a7090;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-glow: rgba(124, 58, 237, 0.3);
  --green: #10b981;
  --red: #ef4444;
  --radius: 12px;
  --font: 'Inter', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }

.noise-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; opacity: 0.5; }

/* Toast */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; color: #fff; animation: slideIn 0.3s; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 0 20px var(--primary-glow); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: var(--red); color: #fff; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(8,6,14,0.85); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 32px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { width: 32px; height: 32px; }
.logo-text { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: 0.5px; }
.accent { color: var(--primary); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-badge { font-size: 12px; color: var(--primary); font-weight: 600; }

/* Pages */
.page { display: none; padding: 60px 24px; max-width: 1200px; margin: 0 auto; min-height: 70vh; }
.page.active { display: block; }
.page-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.page-desc { color: var(--text-muted); margin-bottom: 32px; font-size: 14px; }

/* Hero */
.hero { text-align: center; padding: 80px 0 60px; position: relative; }
.hero-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 500px; height: 500px; background: var(--primary-glow); border-radius: 50%; filter: blur(150px); pointer-events: none; }
.hero-logo { width: 80px; height: 80px; margin-bottom: 24px; position: relative; filter: drop-shadow(0 0 30px var(--primary-glow)); }
.hero-title { font-size: 48px; font-weight: 900; position: relative; text-shadow: 0 0 40px var(--primary-glow); }
.hero-sub { color: var(--text-muted); margin: 16px auto 32px; max-width: 500px; font-size: 15px; position: relative; }
.hero-buttons { display: flex; justify-content: center; gap: 16px; position: relative; }

/* Features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 60px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: border-color 0.3s; }
.feature-card:hover { border-color: var(--primary); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(124,58,237,0.1); display: flex; align-items: center; justify-content: center; color: var(--primary); margin-bottom: 16px; font-size: 20px; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 13px; }

/* Products */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.product-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: all 0.3s; }
.product-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 40px var(--primary-glow); }
.product-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.product-card .desc { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.product-card .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.product-card .price { font-size: 20px; font-weight: 800; color: var(--primary); }
.product-card .days { font-size: 12px; color: var(--text-muted); }
.product-card .status { font-size: 11px; color: var(--green); display: flex; align-items: center; gap: 4px; }
.product-card .status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* Auth */
.auth-panel { max-width: 420px; margin: 0 auto; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 12px; background: none; border: none; color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-form { display: none; flex-direction: column; gap: 12px; }
.auth-form.active { display: flex; }
.auth-form input { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; color: var(--text); font-size: 14px; outline: none; transition: border-color 0.2s; }
.auth-form input:focus { border-color: var(--primary); }
.captcha-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.captcha-row input { flex: 1; }

/* Dashboard */
.dashboard { display: grid; grid-template-columns: 240px 1fr; gap: 24px; min-height: 500px; }
.dash-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 16px; display: flex; flex-direction: column; }
.dash-user { text-align: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.dash-avatar { width: 48px; height: 48px; border-radius: 12px; background: rgba(124,58,237,0.15); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 20px; margin: 0 auto 8px; }
.dash-name { display: block; font-weight: 700; font-size: 14px; }
.dash-balance { display: block; font-size: 12px; color: var(--green); margin-top: 4px; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.dash-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 500; transition: all 0.2s; }
.dash-link:hover { background: rgba(124,58,237,0.08); color: var(--text); }
.dash-link.active { background: rgba(124,58,237,0.15); color: var(--primary); }
.dash-link.admin-only { display: none; }
.is-admin .dash-link.admin-only { display: flex; }
.dash-logout { margin-top: auto; }

.dash-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.dash-content h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.dash-content .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { background: var(--bg-input); border-radius: 8px; padding: 14px; }
.info-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.info-item .value { font-size: 15px; font-weight: 600; margin-top: 4px; }

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 12px; color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.admin-table tr:hover td { background: rgba(124,58,237,0.03); }

/* Key gen */
.key-gen { background: var(--bg-input); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.key-gen h4 { font-size: 14px; margin-bottom: 12px; }
.key-gen .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.key-gen select, .key-gen input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 13px; }
.key-gen select { min-width: 160px; }
.generated-key { margin-top: 12px; padding: 10px; background: var(--bg); border-radius: 8px; font-family: monospace; font-size: 14px; color: var(--green); display: none; }

/* Upload */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; transition: border-color 0.3s; cursor: pointer; }
.upload-area:hover { border-color: var(--primary); }
.upload-area i { font-size: 32px; color: var(--primary); margin-bottom: 12px; }

/* Activate key */
.activate-form { display: flex; gap: 8px; }
.activate-form input { flex: 1; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 12px; color: var(--text); font-family: monospace; font-size: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 24px; margin-top: 60px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; }
.footer-logo { width: 20px; height: 20px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
  .dash-sidebar { flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 12px; }
  .dash-nav { flex-direction: row; flex-wrap: wrap; }
  .hero-title { font-size: 32px; }
  .features { grid-template-columns: 1fr; }
}

/* Admin tabs bar */
.admin-tabs-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.admin-nav-link { color: var(--primary) !important; font-weight: 600 !important; }

/* Styled select & file input for admin */
.styled-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7090' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  min-width: 140px;
}
.styled-select:focus { border-color: var(--primary); }
.styled-select option { background: var(--bg-card); color: var(--text); }

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.file-label:hover { border-color: var(--primary); color: var(--text); }
