/* ==========================================
   Battle Fruits Wiki - Modern Ultra-Smooth Dark UI
========================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --theme-color: #38bdf8;
  --theme-glow: rgba(56, 189, 248, 0.25);
  --bg-main: #0b0f17;
  --bg-sidebar: #111827;
  --bg-card: #151d2a;
  --border-color: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
}

/* Base Body Styling */
body {
  background-color: var(--bg-main) !important;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #1f293d;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--theme-color);
}

/* Sidebar Ultra Styling */
.sidebar {
  background-color: var(--bg-sidebar) !important;
  border-right: 1px solid var(--border-color) !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle {
  background-color: transparent !important;
  padding: 15px !important;
}

.sidebar-toggle span { 
  background-color: var(--theme-color) !important;
  border-radius: 2px;
}

.sidebar ul li a {
  font-weight: 500;
  color: var(--text-sub) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 8px;
  padding: 6px 12px !important;
  margin: 2px 8px;
}

.sidebar ul li a:hover,
.sidebar ul li.active > a {
  color: var(--theme-color) !important;
  background: rgba(56, 189, 248, 0.08);
  font-weight: 600;
  transform: translateX(4px);
}

/* Glassmorphism Search Input */
.search {
  padding: 16px 16px 0 16px !important;
}

.search input {
  background-color: #1a2332 !important;
  border: 1px solid var(--border-color) !important;
  color: #fff !important;
  border-radius: 10px !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  transition: all 0.3s ease !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search input:focus {
  border-color: var(--theme-color) !important;
  box-shadow: 0 0 16px var(--theme-glow) !important;
}

/* Content & Typography */
.markdown-section {
  max-width: 950px !important;
  padding: 30px 45px !important;
  color: var(--text-main) !important;
}

.markdown-section h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.markdown-section h2 {
  font-size: 1.5rem;
  color: var(--theme-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-top: 36px;
}

.markdown-section h3 {
  font-size: 1.2rem;
  color: #f1f5f9;
}

.markdown-section p, 
.markdown-section li {
  color: var(--text-sub) !important;
}

.markdown-section a {
  color: var(--theme-color);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.markdown-section a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.markdown-section code {
  background-color: #1a2332 !important;
  color: #38bdf8 !important;
  border-radius: 6px;
  padding: 3px 8px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-family: 'Fira Code', monospace;
}

/* ==========================================
   FIXED TABLE STYLING (UNIFORM DARK & HIGH CONTRAST)
========================================== */
.markdown-section table {
  display: table !important;
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background-color: var(--bg-card) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  margin: 24px 0 !important;
}

.markdown-section th {
  background-color: #0d131f !important;
  color: var(--theme-color) !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.8px;
  padding: 14px 18px !important;
  border-bottom: 1px solid var(--border-color) !important;
}

/* Tắt hoàn toàn dòng đổi màu xen kẽ */
.markdown-section tr,
.markdown-section tr:nth-child(even),
.markdown-section tr:nth-child(odd) {
  background-color: transparent !important;
}

.markdown-section td {
  background-color: transparent !important;
  padding: 14px 18px !important;
  border-top: 1px solid var(--border-color) !important;
  color: #f1f5f9 !important;
  transition: background-color 0.2s ease;
}

.markdown-section tr:hover td {
  background-color: rgba(56, 189, 248, 0.08) !important;
}

/* High Contrast Rarity & Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.rarity-common, .badge.updating { background: #374151; color: #f3f4f6; }
.rarity-uncommon, .badge.active { background: #166534; color: #dcfce7; }
.rarity-rare { background: #1e40af; color: #dbeafe; }
.rarity-legendary, .badge.important { background: #6b21a8; color: #f3e8ff; }
.rarity-mythical { background: #991b1b; color: #fee2e2; }

/* Callout Quote Boxes */
.markdown-section blockquote {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.1) 0%, rgba(15, 23, 42, 0) 100%);
  border-left: 4px solid var(--theme-color) !important;
  border-radius: 0 10px 10px 0;
  padding: 14px 20px;
  color: #cbd5e1;
  margin: 20px 0;
}

/* ==========================================
   TÙY CHỈNH HỘP KẾT QUẢ TÌM KIẾM (SEARCH RESULTS POPUP)
========================================== */

/* Khung chứa danh sách kết quả tìm kiếm */
.search .results {
  background-color: #151d2a !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
  padding: 12px !important;
  margin-top: 8px !important;
  overflow: hidden;
}

/* Từng mục kết quả bên trong */
.search .results .search-keyword {
  color: #38bdf8 !important;
  font-weight: 600;
}

.search .results p {
  padding: 10px 14px !important;
  margin: 4px 0 !important;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.search .results p:hover {
  background-color: rgba(56, 189, 248, 0.08) !important;
}

/* Tiêu đề bài viết trong kết quả tìm kiếm */
.search .results h2 {
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: #f8fafc !important;
  border-bottom: none !important;
  margin-bottom: 2px !important;
  padding-bottom: 0 !important;
}

.search .results h2:hover {
  color: #38bdf8 !important;
}

/* Đoạn trích dẫn nội dung (snippet) bên dưới tiêu đề */
.search .results li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 0;
}

.search .results li:last-child {
  border-bottom: none;
}

/* Ẩn bớt các đoạn mã HTML rác dài dòng nếu có thể, làm sạch text hiển thị */
.search .results p {
  color: #94a3b8 !important;
  font-size: 0.85rem !important;
  line-height: 1.4;
}