/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --gold: #f0b90b;
  --gold-dark: #c99a08;
  --green: #0ecb81;
  --red: #f6465d;
  --bg-dark: #0b0e11;
  --bg-card: rgba(30, 35, 45, 0.75);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --text-primary: #eaecef;
  --text-secondary: #848e9c;
  --border-glass: rgba(255, 255, 255, 0.06);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
a { color: var(--gold); text-decoration: none; }
::selection { background: rgba(240, 185, 11, 0.3); }

/* ===== BACKGROUND PARTICLES ===== */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* ===== GLASS ===== */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 14, 17, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 185, 11, 0.1);
  border-radius: 10px;
}
.brand-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), #f5d742);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang-switcher {
  display: flex;
  gap: 4px;
}
.lang-btn {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
}
.lang-btn:hover, .lang-btn.active {
  background: rgba(240, 185, 11, 0.15);
  color: var(--gold);
  border-color: var(--gold);
}
.admin-link {
  color: var(--text-secondary);
  transition: color 0.2s;
  display: flex;
}
.admin-link:hover { color: var(--gold); }
.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--gold); }

/* ===== MAIN CONTENT ===== */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 60px;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 60px 0 50px;
}
.hero-badge {
  display: inline-block;
  padding: 8px 20px;
  background: rgba(240, 185, 11, 0.1);
  border: 1px solid rgba(240, 185, 11, 0.2);
  border-radius: 50px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.gold-text {
  background: linear-gradient(135deg, var(--gold), #f5d742);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

/* ===== PACKAGES GRID ===== */
.packages-section, .trial-section { margin-bottom: 60px; }
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.package-card {
  position: relative;
  padding: 32px 24px;
  text-align: center;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.package-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(240, 185, 11, 0.1);
}
.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 0%, rgba(240, 185, 11, 0.06), transparent 60%);
  pointer-events: none;
}
.card-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(240, 185, 11, 0.12);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 16px;
}
.card-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.card-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.feature-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}
.btn-buy {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: #0b0e11;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-buy:hover { opacity: 0.9; transform: scale(1.02); }

/* ===== TRIAL ===== */
.trial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.trial-card {
  padding: 28px 20px;
  text-align: center;
  transition: transform 0.3s;
}
.trial-card:hover { transform: translateY(-4px); }
.trial-icon { margin-bottom: 12px; }
.trial-card h3 { font-size: 18px; margin-bottom: 8px; }
.trial-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.btn-trial {
  padding: 12px 32px;
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-trial:hover { background: var(--gold); color: #0b0e11; }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  border-top: 1px solid var(--border-glass);
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
  padding: 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
}
.modal-qr { max-width: 400px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
}
.modal-content h3 { margin-bottom: 20px; }
.qr-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.qr-container canvas, .qr-container img {
  border-radius: 12px;
  background: white;
  padding: 8px;
}
.qr-amount { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.qr-expiry { color: var(--text-secondary); font-size: 13px; margin-bottom: 16px; }
.qr-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gold);
  font-size: 14px;
}

/* ===== SPINNER ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-glass);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-glass);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESULT PAGE ===== */
.result-container {
  max-width: 520px;
  margin: 0 auto;
  padding-top: 20px;
}
.result-card {
  padding: 40px 32px;
  text-align: center;
}
.result-icon { margin-bottom: 16px; }
.result-icon.pending svg { filter: drop-shadow(0 0 20px rgba(240, 185, 11, 0.3)); }
.result-icon.success svg { filter: drop-shadow(0 0 20px rgba(14, 203, 129, 0.3)); }
.result-card h2 { font-size: 24px; margin-bottom: 8px; }
.result-amount { font-size: 32px; font-weight: 800; color: var(--gold); margin-bottom: 20px; }
.result-peer { margin-bottom: 8px; }
.result-expiry { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }
.qr-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.qr-wrapper canvas, .qr-wrapper img {
  border-radius: 12px;
  background: white;
  padding: 8px;
}
.result-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gold);
  margin-bottom: 20px;
}
.btn-check {
  padding: 12px 32px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: #0b0e11;
  font-weight: 600;
  cursor: pointer;
}
.config-box {
  text-align: left;
  margin-top: 20px;
}
.config-box h3 { font-size: 16px; margin-bottom: 12px; }
.config-box textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 12px;
  resize: none;
  margin-bottom: 12px;
}
.btn-copy, .btn-download {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
}
.btn-copy {
  background: var(--gold);
  border: none;
  color: #0b0e11;
}
.btn-download {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

/* ===== ERROR PAGE ===== */
.error-container {
  max-width: 400px;
  margin: 60px auto;
  text-align: center;
}
.error-card { padding: 40px; }
.error-icon { margin-bottom: 16px; }
.error-card h2 { font-size: 24px; margin-bottom: 12px; }
.error-card p { color: var(--text-secondary); margin-bottom: 24px; }
.btn-back-home {
  display: inline-block;
  padding: 12px 32px;
  background: var(--gold);
  border-radius: var(--radius-sm);
  color: #0b0e11;
  font-weight: 600;
}

/* ===== LOGIN PAGE ===== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  padding: 40px;
  max-width: 400px;
  width: 100%;
}
.login-header {
  text-align: center;
  margin-bottom: 32px;
}
.login-header svg { margin-bottom: 12px; }
.login-header h2 { font-size: 24px; }
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--gold); }
.form-group input:disabled { opacity: 0.5; }
.form-error {
  color: var(--red);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 20px;
}
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: #0b0e11;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-login:hover { opacity: 0.9; }

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 240px;
  background: rgba(20, 24, 30, 0.95);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-glass);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}
.sidebar-brand {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), #f5d742);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 32px;
  padding: 0 8px;
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-item:hover { background: rgba(240, 185, 11, 0.08); color: var(--text-primary); }
.nav-item.active {
  background: rgba(240, 185, 11, 0.12);
  color: var(--gold);
}
.btn-logout {
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
}
.btn-logout:hover { background: rgba(246, 70, 93, 0.1); }

.admin-main {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.admin-header h1 { font-size: 28px; font-weight: 700; }
.admin-user { color: var(--text-secondary); font-size: 14px; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.stat-icon.peers { background: rgba(240, 185, 11, 0.12); color: var(--gold); }
.stat-icon.active { background: rgba(14, 203, 129, 0.12); color: var(--green); }
.stat-icon.revenue { background: rgba(14, 203, 129, 0.12); color: var(--green); }
.stat-icon.pending { background: rgba(240, 185, 11, 0.12); color: var(--gold); }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ===== TABLE ===== */
.table-container {
  padding: 0;
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-glass);
}
.admin-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}
.badge-paid, .badge-active, .badge-premium { background: rgba(14, 203, 129, 0.15); color: var(--green); }
.badge-pending, .badge-trial { background: rgba(240, 185, 11, 0.15); color: var(--gold); }
.badge-failed, .badge-expired { background: rgba(246, 70, 93, 0.15); color: var(--red); }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 40px; }
.settings-section h2 { font-size: 20px; margin-bottom: 16px; }
.settings-form { padding: 24px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.btn-save {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: #0b0e11;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-save:hover { opacity: 0.9; }
.btn-sm {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-sm:hover { opacity: 0.8; }
.btn-primary { background: var(--gold); color: #0b0e11; }
.btn-danger { background: var(--red); color: white; }
.edit-input {
  width: 100%;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.edit-input:focus { border-color: var(--gold); }
.add-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-glass);
}
.add-form h4 { font-size: 14px; margin-bottom: 12px; color: var(--text-secondary); }
.add-form .form-row {
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  margin-bottom: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .admin-sidebar { width: 60px; padding: 16px 8px; }
  .admin-sidebar .sidebar-brand { font-size: 0; }
  .admin-sidebar .sidebar-brand::after { content: 'V'; font-size: 20px; -webkit-text-fill-color: var(--gold); }
  .admin-sidebar .nav-item span { display: none; }
  .admin-main { margin-left: 60px; padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .add-form .form-row { grid-template-columns: 1fr; }
  .packages-grid { grid-template-columns: 1fr; }
  .trial-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}