/* === File: style.css === */
body { 
  margin: 0; overflow: hidden; 
  height: 100vh;
  font-family: "Times New Roman", Times, serif;
}
.base-container { 
  font-size: 1rem; transition: transform 0.3s ease; 
  height: 100%; display: flex; flex-direction: column;
}

.container { 
  display: flex; gap: 8px; justify-content: space-between; 
  width: 100%; padding: 0 8px; box-sizing: border-box;
  flex-grow: 1; overflow: hidden;
  margin-bottom: 5px;
}
.procedure-block {
  display: flex; flex-direction: column;
  border: 3px solid #01579b; border-radius: 8px;
  overflow: hidden; background-color: #f8fbff;
}

/* Đặt 2 khối double chiếm tỷ lệ ngang nhau */
.procedure-block.double { flex: 1; } 

.procedure-block h2 { 
  text-align: center; font-size: 23px; margin: 0; 
  color: #01579b; background: linear-gradient(to right, #e3f2fd, #bbdefb); 
  padding: 6px 4px; border-bottom: 3px solid #01579b;
  animation: pulseHeader 2s infinite, headerGlow 3s infinite; 
  flex-shrink: 0; min-height: 40px; display: flex; align-items: center; justify-content: center;
}

.sub-container {
  display: flex; flex: 1; gap: 4px; padding: 4px; overflow: hidden;
}
.booth { 
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.booth:first-child {
  border-right: 2px dashed #90caf9;
  padding-right: 4px;
}

.table-wrapper { flex-grow: 1; overflow: hidden; position: relative; padding: 4px; }
table { border-collapse: collapse; width: 100%; margin: 0; }
td { 
  border: 1px solid #0288d1; padding: 6px 4px; text-align: center; 
  font-size: 1.15em; font-weight: bold; word-wrap: break-word; 
  color: #212121; background-color: #ffffff; 
}

@keyframes pulseHeader { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.01); } }
@keyframes headerGlow { 0%, 100% { box-shadow: 0 0 5px rgba(252, 250, 164, 0.5); } 50% { box-shadow: 0 0 10px rgba(252, 250, 164, 0.8); } }
.header-text { 
  text-align: center; font-size: 28px; font-weight: 900; margin: 0 0 10px; 
  color: #d32f2f; border: 3px double #d32f2f; border-left: none; border-right: none; 
  background: linear-gradient(to right, #b3e5fc, #e0f7fa); padding: 4px 3px; 
  animation: pulse 2s infinite, borderGlow 3s infinite; box-shadow: 0 0 10px rgba(255, 138, 128, 0.5); flex-shrink: 0;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes borderGlow { 0%, 100% { box-shadow: 0 0 10px rgba(255, 138, 128, 0.5); } 50% { box-shadow: 0 0 20px rgba(255, 138, 128, 0.8); } }
.blink { animation: blink 1.8s infinite; background-color: #fff8e1; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.quay-badge {
  color: #d32f2f; font-size: 78%; font-weight: 900; 
  margin-left: 5px; padding: 2px 6px; 
  border: 2px dashed #d32f2f; background-color: #fff9c4; 
  border-radius: 4px; display: inline-block;
  animation: pulseGlow 1.5s infinite;
}
@keyframes pulseGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 5px rgba(211, 47, 47, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(211, 47, 47, 0.7); }
}

.new-data { 
  animation: scaleText 10.4s ease-in-out; border: 2px solid #0362fc; background-color: #0362fc; color: #ffffff; 
}
@keyframes scaleText { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.zoomed { transform: scale(1.5); transform-origin: top center; }
.marquee-container { 
  width: 100%; overflow: hidden; background-color: #e6f0ff; padding: 3px 0; margin-bottom: 5px; flex-shrink: 0;
}
.marquee { display: flex; align-items: center; white-space: nowrap; animation: marquee 20s linear infinite; }
.marquee img { height: 25px; margin-right: 10px; animation: spin3d 4s linear infinite; }
.marquee span.char { 
  font-size: 25px; 
  font-weight: bold; 
  background: linear-gradient(to right, #0549f0, #4fc3f7); 
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  display: inline-block; 
  animation: charPulse 1.5s infinite; 
  animation-delay: calc(0.05s * var(--char-index)); 
  
  /* Thêm dòng này để các chữ cái giãn ra một chút cho dễ đọc */
  margin-right: 2px; 
}
@keyframes marquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
@keyframes spin3d { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(360deg); } }
@keyframes charPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.highlight { animation: highlight 5s ease-in-out; background-color: #ffeb3b; }
@keyframes highlight { 0%, 20%, 40%, 60%, 80%, 100% { background-color: transparent; } 10%, 30%, 50%, 70%, 90% { background-color: #ffeb3b; } }

@media (max-width: 768px) {
  body { overflow-y: auto; height: auto; }
  .base-container { height: auto; display: block; }
  .container { flex-direction: column; height: auto; overflow: visible; }
  .procedure-block { width: 100%; margin-bottom: 15px; }
  .procedure-block.double { height: 600px; }
  .procedure-block.double .sub-container { flex-direction: column; }
  .booth:first-child { 
    border-right: none; border-bottom: 2px dashed #90caf9; 
    padding-right: 0; padding-bottom: 4px; margin-bottom: 4px;
  }
  .header-text { font-size: 18px; }
  .procedure-block h2 { font-size: 16px; min-height: 40px; }
  td { font-size: 1em; padding: 4px 2px; }
  .marquee span.char { font-size: 18px; }
}
// --- BẢO VỆ GIAO DIỆN & CHẶN XEM MÃ NGUỒN CƠ BẢN ---

// 1. Vô hiệu hóa chuột phải (Context Menu)
document.addEventListener('contextmenu', function(e) {
  e.preventDefault();
});

// 2. Vô hiệu hóa các phím tắt phổ biến dùng để soi code
document.addEventListener('keydown', function(e) {
  // Chặn F12 (DevTools)
  if (e.key === 'F12' || e.keyCode === 123) {
    e.preventDefault();
  }
  
  // Chặn Ctrl + Shift + I (DevTools) / Ctrl + Shift + J (Console) / Ctrl + Shift + C (Inspect Element)
  if (e.ctrlKey && e.shiftKey && (e.key === 'I' || e.key === 'i' || e.key === 'J' || e.key === 'j' || e.key === 'C' || e.key === 'c')) {
    e.preventDefault();
  }
  
  // Chặn Ctrl + U (View Source)
  if (e.ctrlKey && (e.key === 'U' || e.key === 'u')) {
    e.preventDefault();
  }

  // Chặn Ctrl + S (Save Page)
  if (e.ctrlKey && (e.key === 'S' || e.key === 's')) {
    e.preventDefault();
  }

  // Chặn Ctrl + P (Print Page)
  if (e.ctrlKey && (e.key === 'P' || e.key === 'p')) {
    e.preventDefault();
  }
});

// 3. Vô hiệu hóa việc kéo thả hình ảnh/link
document.addEventListener('dragstart', function(e) {
  e.preventDefault();
});
