/* ==========================================================================
   1. ĐỊNH NGHĨA BIẾN VÀ THUỘC TÍNH NÂNG CAO
   ========================================================================== */
@property --cyber-angle {
  syntax: '';
  initial-value: 0deg;
  inherits: false;
}

/* ==========================================================================
   2. NỀN GỐC & KHÔNG GIAN CHIỀU SÂU QUANG HỌC 3D
   ========================================================================== */
body {
  position: relative;
  background-color: #08101e;
  /* Kết hợp ánh sáng chiếu điểm đa góc tạo độ sâu dạng vòm không gian số */
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(30, 64, 175, 0.28) 0%, transparent 60%),
    radial-gradient(circle at 10% 70%, rgba(6, 182, 212, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, #f0f7ff 0%, #e2eaf7 40%, #cddcf0 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* LỚP 1: Mạng lưới nơ-ron đa tầng ngẫu nhiên (Pseudo-random Neural Deep Grid) */
body::before {
  content: "";
  position: fixed;
  inset: -60px;
  background-image: 
    /* Tầng hạt vi mô sâu xa (hạt nhỏ ngẫu nhiên) */
    radial-gradient(circle, rgba(14, 165, 233, 0.6) 1px, transparent 1.5px),
    /* Tầng điểm nút trung cảnh (hạt phát sáng đậm) */
    radial-gradient(circle, rgba(56, 189, 248, 0.8) 1.5px, transparent 2.5px),
    /* Tầng điểm nút tiền cảnh (hạt lớn mờ khuếch tán) */
    radial-gradient(circle, rgba(2, 132, 199, 0.35) 2.5px, transparent 4px),
    /* Mạng lưới sợi dẫn số học (Grid Matrix) */
    linear-gradient(rgba(14, 165, 233, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.05) 1px, transparent 1px);
  /* Phân bổ theo các bước chu kỳ số nguyên tố để triệt tiêu tính lặp đơn điệu */
  background-size: 137px 173px, 211px 241px, 313px 307px, 50px 50px, 50px 50px;
  background-position: 15px 23px, 57px 91px, 120px 45px, 0 0, 0 0;
  transform: perspective(800px) rotateX(7deg);
  transform-origin: top center;
  animation: neuralDepthShift 24s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -2;
}

/* LỚP 2: Luồng sóng ánh sáng & xung nhịp truyền tín hiệu (Synaptic Pulse Wave) */
/* Lớp GIF động: Ma trận dữ liệu & Hạt ánh sáng số */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  /* Thay đường dẫn URL ảnh GIF của bạn vào đây */
  background-image: 
    url('https://tamhiep.dongnai.gov.vn/uploads/tamhiep/backgroudn.gif'), /* Ví dụ GIF hạt số */
    radial-gradient(800px circle at 15% 15%, rgba(56, 189, 248, 0.18), transparent 65%);
  background-repeat: repeat, no-repeat;
  background-size: 400px auto, cover;
  background-position: center center;
  /* Loại bỏ nền đen của GIF, chỉ giữ lại vệt sáng công nghệ */
  mix-blend-mode: screen; 
  opacity: 0.35; /* Giữ độ mờ vừa phải để nội dung tin tức luôn đọc rõ */
  pointer-events: none; /* Không cản trở thao tác click chuột trên web */
  z-index: -1;
}

@keyframes neuralDepthShift {
  0% {
    transform: perspective(800px) rotateX(9deg) translateY(0) scale(1);
    opacity: 0.85;
  }
  50% {
    transform: perspective(800px) rotateX(5deg) translateY(-18px) scale(1.03);
    opacity: 1;
  }
  100% {
    transform: perspective(800px) rotateX(10deg) translateY(8px) scale(0.97);
    opacity: 0.8;
  }
}

@keyframes synapseFlow {
  0% {
    background-position: center, -150% -150%;
    opacity: 0;
  }
  20%, 80% {
    opacity: 0.9;
  }
  100% {
    background-position: center, 250% 250%;
    opacity: 0;
  }
}

/* ==========================================================================
   3. KHỐI NỘI DUNG VÀ VIỀN SÁNG CHUYỂN ĐỘNG (CYBER BORDER)
   ========================================================================== */
.dnn_layout .DnnModule,
.portlet,
.panel-default,
.box-border {
  position: relative !important;
  border-radius: 6px !important;
  border: 1px solid rgba(2, 132, 199, 0.2) !important;
  background-clip: padding-box;
  box-shadow: 
    0 0 0 1px rgba(14, 165, 233, 0.1),
    0 4px 16px rgba(2, 132, 199, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dnn_layout .DnnModule::before,
.portlet::before,
.panel-default::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 7px;
  padding: 1.5px;
  background: conic-gradient(
    from var(--cyber-angle),
    transparent 70%,
    rgba(2, 132, 199, 0.25) 82%,
    #0284c7 90%,
    #38bdf8 96%,
    #ffffff 100%
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: borderGlowOrbit 6s linear infinite;
  z-index: 2;
}

.dnn_layout .DnnModule:hover,
.portlet:hover,
.panel-default:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(14, 165, 233, 0.22),
    0 0 0 1px rgba(56, 189, 248, 0.4) !important;
}

@keyframes borderGlowOrbit {
  to {
    --cyber-angle: 360deg;
  }
}

/* ==========================================================================
   4. TIÊU ĐỀ KHỐI VÀ ĐÈN TÍN HIỆU SỐ
   ========================================================================== */
.box-header, 
.panel-heading,
.portlet-header,
h3.title-box {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  position: relative;
  border-radius: 5px 5px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  padding-left: 28px !important;
}

.box-header::before,
.panel-heading::before,
h3.title-box::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  background-color: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 8px #38bdf8;
  animation: statusLedPulse 2s ease-in-out infinite;
}

@keyframes statusLedPulse {
  0%, 100% {
    opacity: 0.4;
    transform: translateY(-50%) scale(0.9);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scale(1.3);
    box-shadow: 0 0 12px #7dd3fc;
  }
}

/* ==========================================================================
   5. MENU ĐIỀU HƯỚNG & KHỐI TIỆN ÍCH
   ========================================================================== */
.navbar-nav > li > a,
#main-menu ul li a {
  position: relative;
  transition: color 0.25s ease;
}

.navbar-nav > li > a::after,
#main-menu ul li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2.5px;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: translateX(-50%);
  border-radius: 2px;
}

.navbar-nav > li:hover > a::after,
#main-menu ul li:hover a::after,
.navbar-nav > li.active > a::after {
  width: 80%;
}

/* Vùng chứa banner */
.banner-container {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.15);
}

/* Khối thống kê truy cập (HUD style) */
.visitor-counter {
  background: radial-gradient(circle at top left, #0f274a, #0b1a33) !important;
  color: #e0f2fe !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.12);
}

.visitor-counter strong,
.visitor-counter b {
  font-family: 'Consolas', 'Courier New', monospace;
  color: #38bdf8 !important;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  letter-spacing: 1px;
}