/* Đổi màu chữ trên thanh menu thành trắng cho dễ đọc trên nền xanh */
.navbar-dark .navbar-nav .nav-link, .navbar-brand {
  color: #ffffff !important;
  font-weight: 500;
}

/* Đổi màu toàn bộ các đường link trong bài viết sang xanh dương đồng bộ với site */
a {
  color: #1e90ff;
  text-decoration: none;
}
a:hover {
  color: #c77dff;
  text-decoration: underline;
}

/* Làm mượt các tiêu đề H1, H2 */
h1, h2, h3 {
  color: #0a1a2e;
  font-weight: 700;
  margin-top: 1.5em;
}

/* Tạo điểm nhấn cho các danh sách bullet point */
ul li {
  margin-bottom: 8px;
}

/* Đổi màu thanh Mục lục (On this page) bên phải sang xanh dương khi scroll */
.sidebar nav[data-bs-spy="scroll"] .active {
  color: #1e90ff !important;
  border-left-color: #1e90ff !important;
}

/* Hiệu ứng đổi màu tím khi di chuột qua các mục trong mục lục */
.sidebar nav a:hover {
  color: #c77dff !important;
}

/* ==========================================
   MÀN HÌNH LOADING (PRELOADER) 
============================================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #020c1a;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    border-radius: 50%;
    
    background: conic-gradient(
        #1e90ff,
        #c77dff,
        #60a5fa,
        #ffd700,
        #1e90ff
    );
    
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    
    padding: 3px;
    box-shadow: 0 0 22px rgba(30, 144, 255, 0.4);
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-content {
    text-align: center;
}

.loader-text {
    color: #60a5fa !important;
    font-family: 'Courier New', Courier, monospace !important;
    letter-spacing: 5px !important;
    font-size: 16px !important;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.loader-subtext {
    color: #4a7a9b !important;
    font-size: 11px !important;
    letter-spacing: 3px !important;
    text-transform: uppercase;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ============================================================ */
/* PRELOADER — Căn chỉnh V đứng yên                           */
/* ============================================================ */

.spinner {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto;
    border-radius: 50%;
    animation: spin 1.4s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

.loader-center-group {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 35px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-letter-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-letter {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #1e90ff, #c77dff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================ */
/* ÉP CÁC CHỮ TRÊN NAVBAR NẰM TRÊN 1 DÒNG DUY NHẤT             */
/* ============================================================ */

.navbar-nav .nav-item .nav-link,
.navbar-nav .nav-item {
    white-space: nowrap !important;
}

.navbar-nav .nav-link {
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 0.95rem !important;
}

.navbar-collapse {
    flex-grow: 1;
    justify-content: flex-end;
}

/* ============================================================ */
/* OVERRIDE MÀU NAVBAR QUARTO (flatly theme)                   */
/* ============================================================ */
.navbar {
    background-color: #0a4fa6 !important;
    border-bottom: 1px solid rgba(10, 79, 166, 0.5) !important;
}

.navbar.headroom--not-top {
    background-color: #083d85 !important;
}

/* ============================================================ */
/* MỤC LỤC (TOC) — đồng bộ màu xanh dương                     */
/* ============================================================ */

/* Link thường trong TOC */
#TOC a,
.sidebar nav a,
nav[id="TOC"] a {
    color: #4a7a9b !important;
}

/* Mục đang active (đang xem) */
#TOC a.active,
#TOC li.active > a,
.sidebar nav a.active,
nav[id="TOC"] a.active {
    color: #1e90ff !important;
    border-left: 2px solid #1e90ff !important;
    font-weight: 600 !important;
}

/* Hover */
#TOC a:hover,
.sidebar nav a:hover,
nav[id="TOC"] a:hover {
    color: #c77dff !important;
    text-decoration: none !important;
}