/* ═══════════════════════════════════════════════
   luanon.net — Premium Dark Theme
   ═══════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-1: #667eea;
  --accent-2: #764ba2;
  --accent-3: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.06) 0%, transparent 50%);
}

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

a { color: var(--accent-1); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-2); }

/* ─── Header ──────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}

.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25rem; color: var(--text-primary); }
.logo-img { height: 32px; width: 32px; object-fit: contain; }

.nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 6px 14px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
  transition: var(--transition);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-glass); }
.nav-admin { color: var(--accent-3); }
.nav-admin:hover { color: var(--accent-3); background: rgba(245, 158, 11, 0.1); }

.nav-user { display: flex; align-items: center; gap: 10px; margin-left: 8px; }
.nav-balance {
  background: var(--gradient-gold); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 700; font-size: 0.875rem;
}

.menu-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }

/* ─── Buttons ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); border: none;
  font-family: inherit; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-primary { background: var(--gradient-primary); color: #fff; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); }
.btn-primary:hover { box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5); color: #fff; }
.btn-success { background: var(--gradient-green); color: #fff; }
.btn-gold { background: var(--gradient-gold); color: #111; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent-1); color: var(--accent-1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Cards ───────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.card:hover { border-color: rgba(102, 126, 234, 0.2); box-shadow: var(--shadow-glow); }
.card-header { font-size: 1.125rem; font-weight: 700; margin-bottom: 16px; }
.card-header small { color: var(--text-muted); font-weight: 400; font-size: 0.8rem; }

/* ─── Stats Grid ──────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { font-size: 2rem; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); }
.stat-icon.blue { background: rgba(102, 126, 234, 0.15); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); }
.stat-icon.gold { background: rgba(245, 158, 11, 0.15); }
.stat-icon.purple { background: rgba(118, 75, 162, 0.15); }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.stat-label { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; }

/* ─── Forms ───────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: 0.875rem; font-weight: 600; color: var(--text-secondary);
}
.form-control {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-secondary);
  color: var(--text-primary); font-family: inherit; font-size: 0.9rem;
  transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Tables ──────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th { background: rgba(102, 126, 234, 0.08); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-glass); }

/* ─── Badges ──────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-premium { background: var(--gradient-gold); color: #111; }
.badge-standard { background: rgba(102, 126, 234, 0.15); color: var(--accent-1); }
.badge-budget { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

/* ─── Flash Messages ──────────────────── */
.flash {
  max-width: 700px; margin: 16px auto; padding: 14px 20px;
  border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  animation: slideDown 0.4s ease;
}
.flash-success { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--success); }
.flash-error { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); }
.flash-info { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.3); color: var(--info); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Main Content ────────────────────── */
.main-content { min-height: calc(100vh - 64px - 120px); padding: 24px 0; }

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.75rem; font-weight: 800; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.page-header p { color: var(--text-muted); margin-top: 4px; }

/* ─── Hero Section ────────────────────── */
.hero {
  text-align: center; padding: 80px 0 60px;
  position: relative;
}
.hero::before {
  content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-icon { font-size: 4rem; margin-bottom: 16px; display: block; animation: float 3s ease-in-out infinite; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.hero h1 span { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.125rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ─── Features Grid ───────────────────── */
.features { padding: 60px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  text-align: center; transition: var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); border-color: rgba(102, 126, 234, 0.3); }
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; display: block; }
.feature-card h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.875rem; }

/* ─── Package Cards ───────────────────── */
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.package-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px; text-align: center;
  position: relative; overflow: hidden; transition: var(--transition);
}
.package-card.featured { border-color: var(--accent-1); }
.package-card.featured::before {
  content: 'Phổ biến'; position: absolute; top: 16px; right: -30px;
  background: var(--gradient-primary); color: #fff; padding: 4px 40px;
  font-size: 0.7rem; font-weight: 700; transform: rotate(45deg);
}
.package-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.package-name { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.package-desc { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 20px; }
.package-features { list-style: none; text-align: left; margin-bottom: 24px; }
.package-features li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; display: flex; align-items: center; gap: 8px; }
.package-features li::before { content: '✓'; color: var(--success); font-weight: 700; }
.package-price { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; }
.package-price strong { font-size: 1.5rem; color: var(--accent-3); font-weight: 800; }

/* ─── Server Selection ────────────────── */
.server-selector { margin-bottom: 20px; }
.server-options { display: flex; flex-direction: column; gap: 8px; }
.server-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--border); cursor: pointer;
  transition: var(--transition);
}
.server-option:hover { border-color: var(--accent-1); background: var(--bg-glass); }
.server-option.selected { border-color: var(--accent-1); background: rgba(102, 126, 234, 0.08); }
.server-option input[type="radio"] { accent-color: var(--accent-1); }
.server-info { flex: 1; }
.server-name { font-weight: 600; font-size: 0.9rem; }
.server-desc { font-size: 0.75rem; color: var(--text-muted); }
.server-price { font-weight: 700; color: var(--accent-3); white-space: nowrap; }

/* ─── Reaction Picker ───────────────── */
.reaction-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.reaction-btn {
  width: 44px; height: 44px; font-size: 1.4rem; border: 2px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm); background: rgba(255,255,255,0.05); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s ease; position: relative;
}
.reaction-btn:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.1); transform: scale(1.15); }
.reaction-btn.selected { border-color: var(--accent); background: rgba(59,130,246,0.15); box-shadow: 0 0 12px rgba(59,130,246,0.3); transform: scale(1.1); }
.reaction-btn.selected::after {
  content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}

/* ─── Tone Picker ───────────────────── */
.tone-picker { display: flex; gap: 8px; }
.tone-option {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 8px; border: 2px solid rgba(255,255,255,0.12); border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03); cursor: pointer; transition: all .2s; text-align: center;
}
.tone-option input[type="radio"] { display: none; }
.tone-icon { font-size: 1.5rem; }
.tone-label { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.tone-desc { font-size: 0.7rem; color: var(--text-muted); line-height: 1.2; }
.tone-option:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); }
.tone-option.selected { border-color: var(--accent); background: rgba(59,130,246,0.1); }
.tone-option[data-tone="negative"].selected { border-color: #ef4444; background: rgba(239,68,68,0.1); }
.tone-option[data-tone="mixed"].selected { border-color: #f59e0b; background: rgba(245,158,11,0.1); }

/* ─── Price Display ───────────────────── */
.price-display {
  background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md); padding: 20px; text-align: center; margin: 20px 0;
}
.price-total { font-size: 2rem; font-weight: 800; color: var(--accent-3); }
.price-label { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Deposit Page ────────────────────── */
.deposit-info {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.qr-wrap { text-align: center; margin: 20px 0; }
.qr-wrap img { max-width: 250px; border-radius: var(--radius-md); }
.bank-info { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.9rem; }
.bank-info dt { color: var(--text-muted); font-weight: 500; }
.bank-info dd { font-weight: 600; }

/* ─── Pagination ──────────────────────── */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 0.8rem; font-weight: 600;
}
.pagination a:hover { border-color: var(--accent-1); color: var(--accent-1); }
.pagination .active { background: var(--gradient-primary); color: #fff; border-color: transparent; }

/* ─── Auth Pages ──────────────────────── */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 200px);
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 { text-align: center; font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); font-size: 0.875rem; margin-bottom: 24px; }

/* ─── Footer ──────────────────────────── */
.footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 40px 0 20px; margin-top: 40px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.footer-brand { font-size: 1.25rem; font-weight: 700; }
.footer-desc { color: var(--text-muted); font-size: 0.8rem; margin-top: 6px; font-weight: 400; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-secondary); font-size: 0.875rem; }
.footer-links a:hover { color: var(--text-primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 16px; text-align: center; color: var(--text-muted); font-size: 0.75rem; }

/* ─── Grid Utils ──────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }

/* ─── Responsive ──────────────────────── */
@media (max-width: 992px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .container { padding: 0 12px; }

  .nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 16px; gap: 8px; z-index: 99; }
  .nav.open { display: flex; }
  .nav-user { flex-direction: column; margin: 0; }
  .menu-toggle { display: block; }

  .hero h1 { font-size: 2rem; }
  .hero { padding: 40px 0; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .package-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }

  /* Stats: 1 column on mobile to avoid overflow */
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; gap: 12px; }
  .stat-icon { width: 44px; height: 44px; font-size: 1.5rem; flex-shrink: 0; }
  .stat-value { font-size: 1.1rem; word-break: break-word; }
  .stat-label { font-size: 0.75rem; }

  /* Card spacing */
  .card { padding: 16px; }
  .card-header { font-size: 1rem; margin-bottom: 12px; }

  /* Flex between fix */
  .flex-between { flex-wrap: wrap; gap: 8px; }

  /* Page header */
  .page-header h1 { font-size: 1.35rem; }

  /* Table font */
  th, td { padding: 8px 10px; font-size: 0.8rem; }

  /* Price display */
  .price-total { font-size: 1.5rem; }

  /* Auth card */
  .auth-card { padding: 24px 16px; }
}

@media (min-width: 500px) and (max-width: 768px) {
  /* 2 columns stats on wider mobile, but with smaller min */
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
