:root {
  --bg-page: #f6f8fc;
  --bg-card: #ffffff;
  --bg-card-soft: #f8fafc;
  --border-light: #eef2f6;
  --border-hover: #e2e8f0;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --primary-red: #ef4444;
  --primary-red-glow: rgba(239, 68, 68, 0.25);
  --accent-blue: #3b82f6;
  --accent-gold: #f59e0b;
  
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 9999px;
  
  --shadow-subtle: 0 4px 20px -2px rgba(100, 116, 139, 0.08);
  --shadow-card: 0 10px 25px -5px rgba(100, 116, 139, 0.08), 0 8px 10px -6px rgba(100, 116, 139, 0.04);
  --shadow-hover: 0 20px 30px -10px rgba(100, 116, 139, 0.15);
}

/* ================= DARK THEME VARIABLES (PURE OBSIDIAN CARBON) ================= */
body.dark-mode {
  --bg-page: #000000;
  --bg-card: #0b0b0d;
  --bg-card-soft: #141418;
  --border-light: rgba(255, 255, 255, 0.11);
  --border-hover: rgba(255, 255, 255, 0.22);
  
  --text-primary: #f4f4f6;
  --text-secondary: #d4d4d8;
  --text-muted: #8b8b96;
  
  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.82);
  --shadow-card: 0 12px 28px -5px rgba(0, 0, 0, 0.9);
  --shadow-hover: 0 22px 36px -10px rgba(0, 0, 0, 0.96);
}

body.dark-mode .watermark-pokeball {
  border-color: rgba(255, 255, 255, 0.095);
}
body.dark-mode .watermark-pokeball::after {
  border-color: rgba(255, 255, 255, 0.095);
}
body.dark-mode .modern-select option {
  background-color: #0b0b0d;
  color: #f4f4f6;
}

html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* ================= MODERN CLEAN SCROLLBARS ================= */
/* Cho trình duyệt Webkit (Chrome, Edge, Safari, Opera) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-pill);
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

/* Cho Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

/* Tự động ẩn thanh cuộn nhưng vẫn cuộn được cho các container danh sách */
.no-scrollbar,
.owners-clean-list,
#packCardsGridContainer,
.clean-modal-card {
  scrollbar-width: thin;
}

.owners-clean-list::-webkit-scrollbar,
#packCardsGridContainer::-webkit-scrollbar,
.clean-modal-card::-webkit-scrollbar {
  width: 5px;
}

.owners-clean-list::-webkit-scrollbar-thumb,
#packCardsGridContainer::-webkit-scrollbar-thumb,
.clean-modal-card::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-pill);
}

.owners-clean-list::-webkit-scrollbar-thumb:hover,
#packCardsGridContainer::-webkit-scrollbar-thumb:hover,
.clean-modal-card::-webkit-scrollbar-thumb:hover {
  background: rgba(239, 68, 68, 0.6);
}

/* ================= PAGE PRELOADER ANIMATION ================= */
.page-preloader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-pokeball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ef4444 50%, #ffffff 50%);
  border: 4px solid #1e293b;
  position: relative;
  animation: pokeballSpin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.preloader-pokeball::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: #1e293b;
  transform: translateY(-50%);
}

.preloader-pokeball::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 4px solid #1e293b;
  border-radius: 50%;
}

@keyframes pokeballSpin {
  0% { transform: rotate(0deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(0.9); }
}

.preloader-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.5px;
}

/* ================= ENTRANCE KEYFRAME ANIMATIONS ================= */
.animate-slide-down {
  animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pop-in {
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ================= BUTTON RIPPLE & PRESS ANIMATIONS ================= */
.ripple-effect {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}

.ripple-effect:active {
  transform: scale(0.94) !important;
}

/* Watermark Pokeball */
.watermark-pokeball {
  position: fixed;
  top: -80px;
  left: -80px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 45px solid rgba(226, 232, 240, 0.45);
  pointer-events: none;
  z-index: 0;
}
.watermark-pokeball::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 45px solid rgba(226, 232, 240, 0.45);
}

.page-container {
  flex: 1;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 28px 24px 102px;
  position: relative;
}


/* ================= FULL-WIDTH LAYOUT ================= */
.master-layout {
  width: 100%;
}

.main-content-area {
  width: 100%;
}

