/* ==========================================================================
   TẠP HÓA VIỆT / VIETHOAGAME - GAMING PORTAL CORE STYLES (portal.css)
   Lấy cảm hứng từ VietPatch, The Red Team & Cánh Cụt Team
   ========================================================================== */

:root {
  /* Hệ Màu Tạp Hóa Kem & Cam (Editorial Vintage Cream & Orange) */
  --bg-base: #F5F0E6;          /* Màu kem ấm chuẩn vintage newsprint */
  --bg-surface: #EFE9DC;       /* Màu kem ngà trung tính */
  --bg-card: #FFFFFF;          /* Nền card trắng kem sạch sẽ */
  --bg-card-hover: #FFFFFF;
  --bg-glass: rgba(245, 240, 230, 0.95);
  --bg-input: #FFFFFF;
  
  /* Đường viền & Phân cách */
  --border-subtle: #E2DAC8;    /* Viền kem tự nhiên */
  --border-active: #EA4828;    /* Viền cam nổi bật */
  --border-strong: #121316;    /* Viền đen neubrutalist */
  --border-glow: rgba(234, 72, 40, 0.35);

  /* Màu chủ đạo: Cam & Đỏ Cam (Orange / Vermilion) */
  --accent-orange: #EA4828;
  --accent-orange-hover: #CE3214;
  --accent-gold: #EA4828;
  --accent-gold-hover: #CE3214;
  --accent-red: #EA4828;
  --accent-red-hover: #CE3214;
  --accent-green: #059669;
  --accent-cyan: #0284C7;
  --accent-purple: #7C3AED;

  /* Màu chữ (Typography) */
  --text-primary: #121316;     /* Đen than obsidian cực nét */
  --text-secondary: #57534E;   /* Xám khói ấm */
  --text-muted: #888275;       /* Xám be mờ */
  --text-inverse: #FFFFFF;     /* Chữ trắng tương phản cao */

  /* Font chữ chuẩn tiếng Việt */
  --font-main: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;

  /* Hiệu ứng bóng đổ Neubrutalist */
  --shadow-sm: 2px 2px 0px #121316;
  --shadow-md: 4px 4px 0px #121316;
  --shadow-lg: 6px 6px 0px #121316;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);

  /* Bo góc */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Kích thước */
  --header-height: 72px;
  --max-width: 1320px;
}

/* CSS Reset cơ bản */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  scroll-behavior: smooth;
  font-size: 15px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: #F5F0E6;
  background-image: 
    radial-gradient(circle at 12% 15%, rgba(234, 72, 40, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 88% 70%, rgba(234, 72, 40, 0.03) 0%, transparent 45%);
  color: #121316;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container dùng chung */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ==========================================================================
   2. GLOBAL HEADER
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.35rem;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-brand > div {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-orange, #EA4828);
  border: 2px solid var(--border-strong, #121316);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 1.3rem;
  box-shadow: 2px 2px 0px var(--border-strong, #121316);
  flex-shrink: 0;
}

.logo-text {
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.2;
  white-space: nowrap;
  display: inline-block;
}

.logo-text span {
  color: var(--accent-orange, #EA4828);
  white-space: nowrap;
}

.logo-tagline {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Nav Menu Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.nav-tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(234, 72, 40, 0.08);
}

.nav-tab-btn.active {
  color: #FFF;
  background: var(--accent-orange, #EA4828);
  box-shadow: 0 2px 10px rgba(234, 72, 40, 0.35);
}

/* Header Utilities */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Nút Đổi Giao Diện Sáng / Tối (Theme Switcher) */
.btn-theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full, 9999px);
  background: var(--bg-surface);
  border: 2px solid var(--border-strong, #121316);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--border-strong, #121316);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  transform: translate(-1px, -1px) rotate(15deg);
  box-shadow: 3px 3px 0px var(--border-strong, #121316);
  border-color: var(--accent-orange, #EA4828);
  color: var(--accent-orange, #EA4828);
}

/* Nút Báo Lỗi trên Header - Nổi bật phong cách Neubrutalist */
.btn-header-bug {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFF1F2;
  border: 2px solid var(--border-strong, #121316);
  border-radius: var(--radius-full, 9999px);
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #BE123C;
  box-shadow: 2px 2px 0px var(--border-strong, #121316);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-header-bug i {
  color: #E11D48;
  font-size: 1rem;
}

.btn-header-bug:hover {
  background: #FFE4E6;
  color: #9F1239;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--border-strong, #121316);
}

.btn-header-bug:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--border-strong, #121316);
}

/* Nút Báo Lỗi trong Modal Chi Tiết Game */
.btn-detail-bug {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFF1F2;
  border: 2px solid var(--border-strong, #121316);
  border-radius: var(--radius-md, 8px);
  padding: 7px 15px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #BE123C;
  box-shadow: 2px 2px 0px var(--border-strong, #121316);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-detail-bug i {
  color: #E11D48;
  font-size: 0.95rem;
}

.btn-detail-bug:hover {
  background: #FFE4E6;
  color: #9F1239;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--border-strong, #121316);
}

.btn-detail-bug:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--border-strong, #121316);
}

/* Nút Gửi Báo Cáo Lỗi trong Modal Báo Lỗi - Cực Kỳ Nổi Bật */
.btn-submit-bug {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #E11D48 0%, #BE123C 100%);
  border: 2px solid var(--border-strong, #121316);
  border-radius: var(--radius-md, 10px);
  color: #FFFFFF !important;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  padding: 13px 24px;
  box-shadow: 4px 4px 0px var(--border-strong, #121316);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
  margin-top: 12px;
}

.btn-submit-bug i {
  font-size: 1.15rem;
}

.btn-submit-bug:hover {
  background: linear-gradient(135deg, #BE123C 0%, #9F1239 100%);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--border-strong, #121316);
}

.btn-submit-bug:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0px var(--border-strong, #121316);
}

.btn-bookmark-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.btn-bookmark-tab:hover {
  border-color: var(--border-active);
  background: rgba(245, 158, 11, 0.1);
}

.badge-count {
  background: var(--accent-red);
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.btn-discord {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #5865F2;
  color: #FFF;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.btn-discord:hover {
  background: #4752C4;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  font-size: 1.4rem;
  color: var(--text-primary);
}

/* ==========================================================================
   3. TAB CONTENT MANAGEMENT
   ========================================================================== */
.tab-pane {
  display: none;
  animation: fadeInPane 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   4. GLOBAL FOOTER
   ========================================================================== */
.main-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 12px;
  max-width: 440px;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--accent-gold);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Toast Notification */
.toast-box {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 10000;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  box-shadow: var(--shadow-lg);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-box.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-box i {
  color: var(--accent-gold);
  font-size: 1.2rem;
}

/* ==========================================================================
   5. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 992px) {
  .nav-tabs {
    display: none; /* Sẽ bung qua mobile menu */
  }
  .mobile-toggle {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-actions .btn-discord {
    display: none;
  }
  .logo-tagline {
    display: none;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
