/* ============ SHARED STYLES — Xì Dách Online ============ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-main: #F0F4F8;
  --bg-card: #FFFFFF;
  --bg-dark: #0F172A;
  --bg-header: linear-gradient(135deg, #1E3A5F 0%, #0F172A 100%);
  --blue-primary: #3B82F6;
  --blue-dark: #1E40AF;
  --blue-light: #DBEAFE;
  --blue-glow: rgba(59, 130, 246, 0.25);
  --gold: #F59E0B;
  --gold-light: #FEF3C7;
  --green: #10B981;
  --green-light: #D1FAE5;
  --red: #EF4444;
  --purple: #8B5CF6;
  --purple-light: #EDE9FE;
  --text-dark: #0F172A;
  --text-mid: #475569;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(59,130,246,0.12);
  --shadow-lg: 0 8px 30px rgba(59,130,246,0.15);
  --shadow-xl: 0 12px 40px rgba(15,23,42,0.2);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ============ HEADER ============ */
.header {
  background: var(--bg-header);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 24px; font-weight: 900; color: #fff; letter-spacing: -0.5px; }
.logo span { color: var(--blue-primary); }
.logo-badge {
  background: linear-gradient(135deg, var(--gold), #D97706);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.5px;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,0.6); font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; transition: all 0.2s; cursor: pointer;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link.active {
  color: #fff; background: var(--blue-primary);
  box-shadow: 0 2px 10px rgba(59,130,246,0.4);
}
.header-right { display: flex; align-items: center; gap: 14px; }
.chip-balance {
  display: flex; align-items: center; gap: 6px;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25);
  padding: 6px 14px 6px 10px; border-radius: 30px;
}
.chip-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #D97706);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.chip-amount { font-size: 14px; font-weight: 700; color: var(--gold); }
.chip-plus {
  background: var(--green); color: #fff; border: none;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.header-icon {
  position: relative; width: 36px; height: 36px;
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: rgba(255,255,255,0.7);
  cursor: pointer; transition: all 0.2s;
}
.header-icon:hover { color: #fff; background: rgba(255,255,255,0.08); }
.badge {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 9px;
  font-weight: 700; display: flex; align-items: center;
  justify-content: center; border: 2px solid var(--bg-dark);
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #1E3A5F, #0F172A);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-weight: 700; font-size: 14px;
  border: 2px solid var(--gold); cursor: pointer;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.2), 0 2px 8px rgba(0,0,0,0.3);
  position: relative; overflow: hidden;
}
.avatar svg, .avatar img { width: 100%; height: 100%; }
.avatar::after {
  content: ''; position: absolute; bottom: -1px; right: -1px;
  width: 10px; height: 10px; background: var(--green);
  border-radius: 50%; border: 2px solid var(--bg-dark);
  box-shadow: 0 0 6px rgba(16,185,129,0.6); z-index: 2;
}

/* ============ PIXEL AVATAR SVG ============ */
.pixel-avatar-svg {
  display: block;
}

/* ============ SECTION HEADERS ============ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 16px; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
}
.section-title .icon {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.section-link {
  font-size: 12px; font-weight: 600; color: var(--blue-primary);
  cursor: pointer; transition: opacity 0.2s;
}
.section-link:hover { opacity: 0.7; }

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* ============ BUTTONS ============ */
.btn {
  padding: 10px 20px; border-radius: 10px; font-weight: 700;
  font-size: 13px; border: none; cursor: pointer;
  transition: all 0.2s; display: inline-flex;
  align-items: center; gap: 6px;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
  color: #fff; box-shadow: 0 2px 10px rgba(59,130,246,0.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(59,130,246,0.4); transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #D97706);
  color: #fff; box-shadow: 0 2px 10px rgba(245,158,11,0.3);
}
.btn-gold:hover { box-shadow: 0 4px 16px rgba(245,158,11,0.4); transform: translateY(-1px); }
.btn-green {
  background: linear-gradient(135deg, var(--green), #059669);
  color: #fff; box-shadow: 0 2px 10px rgba(16,185,129,0.3);
}
.btn-green:hover { box-shadow: 0 4px 16px rgba(16,185,129,0.4); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text-mid);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--blue-primary); color: var(--blue-primary); }

/* ============ TABS ============ */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-main); border-radius: 12px;
  margin-bottom: 20px;
}
.tab {
  padding: 8px 18px; border-radius: 10px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  color: var(--text-light); border: none; background: none;
}
.tab:hover { color: var(--text-mid); }
.tab.active {
  background: var(--bg-card); color: var(--blue-primary);
  box-shadow: var(--shadow-sm); font-weight: 700;
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 32px; max-width: 480px; width: 90%;
  box-shadow: var(--shadow-xl); animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title {
  font-size: 20px; font-weight: 800; margin-bottom: 8px;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-main); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); font-size: 16px;
}

/* ============ PAGE CONTAINER ============ */
.page-container {
  max-width: 1200px; margin: 24px auto; padding: 0 24px;
}

/* ============ BOTTOM NAV (Mobile) ============ */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 8px 16px 12px; z-index: 100;
  justify-content: space-around; box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 10px; font-weight: 600;
  color: var(--text-light); transition: color 0.2s; cursor: pointer;
}
.bottom-nav-item:hover, .bottom-nav-item.active { color: var(--blue-primary); }
.nav-icon { font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }

@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .nav-links { display: none; }
  .bottom-nav { display: flex; }
  .page-container { padding: 0 12px; margin-bottom: 70px; }
}
