/* Tùy chỉnh font chữ và các style cơ bản */
body {
    font-family: 'Be Vietnam Pro', sans-serif;
    background-color: #f8fafc; /* slate-50 */
    color: #1e293b; /* slate-800 */
}
/* Giao diện tối mới - Tông màu Lam-Tím huyền bí */
.dark body {
    background-color: #111827; /* gray-900 */
    color: #d1d5db; /* gray-300 */
}
.dark .bg-white { background-color: #1f2937; } /* gray-800 */
.dark .bg-gray-100 { background-color: #374151; } /* gray-700 */
.dark .bg-gray-200 { background-color: #374151; } /* gray-700 */
.dark .text-gray-800 { color: #f9fafb; } /* gray-50 */
.dark .text-gray-700 { color: #d1d5db; } /* gray-300 */
.dark .text-gray-600 { color: #9ca3af; } /* gray-400 */
.dark .text-gray-500 { color: #6b7280; } /* gray-500 */
.dark .text-gray-400 { color: #9ca3af; } /* gray-400 */
.dark .border-gray-200 { border-color: #374151; } /* gray-700 */
.dark .border-gray-300 { border-color: #4b5563; } /* gray-600 */
.dark input, .dark select, .dark textarea {
    background-color: #374151; /* gray-700 */
    color: #f9fafb; /* gray-50 */
    border-color: #4b5563; /* gray-600 */
}
.dark input::placeholder, .dark textarea::placeholder { color: #6b7280; } /* gray-500 */
.dark .text-slate-800 { color: #f9fafb; } /* Sửa lỗi tiêu đề tối màu */

/* Hiệu ứng cho modal */
.modal { transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal-content { transition: transform 0.3s ease; }
.modal:not(.is-open) { visibility: hidden; opacity: 0; }
.modal:not(.is-open) .modal-content { transform: scale(0.95); }
.is-open { visibility: visible; opacity: 1; }
.is-open .modal-content { transform: scale(1); }

/* Tùy chỉnh scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #e5e7eb; } /* gray-200 */
.dark ::-webkit-scrollbar-track { background: #1f2937; } /* gray-800 */
::-webkit-scrollbar-thumb { background: #9ca3af; border-radius: 4px; } /* gray-400 */
.dark ::-webkit-scrollbar-thumb { background: #4b5563; } /* gray-600 */
::-webkit-scrollbar-thumb:hover { background: #6b7280; } /* gray-500 */
.dark ::-webkit-scrollbar-thumb:hover { background: #6b7280; } /* gray-500 */

/* Icon ngũ hành */
.ngu-hanh-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%; margin-right: 8px; color: white;
}
.ngu-hanh-icon.hoa { background-color: #ef4444; }
.ngu-hanh-icon.thuy { background-color: #3b82f6; }
.ngu-hanh-icon.moc { background-color: #22c55e; }
.ngu-hanh-icon.kim { background-color: #a1a1aa; }
.ngu-hanh-icon.tho { background-color: #f97316; }

/* Ẩn/hiện các section */
.section-content { display: none; }
.section-content.active { display: block; }

/* Styling cho nội dung popup */
.popup-section-title {
    font-size: 1.25rem; font-weight: 700;
    color: #16a34a; /* green-600 */
    margin-top: 1.5rem; margin-bottom: 0.75rem;
}
.dark .popup-section-title {
     color: #f59e0b; /* amber-500 */
}
.popup-content-body hr {
    border: none;
    border-top: 1px solid #e5e7eb; /* gray-200 */
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
.dark .popup-content-body hr {
     border-top: 1px solid #4b5563; /* gray-600 */
}

/* Quiz Styling */
.quiz-option { transition: background-color 0.2s, border-color 0.2s; }
.quiz-option.correct { background-color: #dcfce7; border-color: #22c55e; } /* green */
.quiz-option.incorrect { background-color: #fee2e2; border-color: #ef4444; } /* red */
.dark .quiz-option.correct { background-color: #166534; border-color: #4ade80; }
.dark .quiz-option.incorrect { background-color: #991b1b; border-color: #f87171; }
.quiz-option.disabled { pointer-events: none; }

/* CÁC QUY TẮC BỔ SUNG CHO PHẦN XEM VẬN HẠN */
.luu-han-result-cung {
    padding: 1.5rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}
.dark .luu-han-result-cung {
    background-color: #1f2937;
    border-color: #374151;
}

.luu-han-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.luu-han-item i {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.luu-han-item div {
    display: flex;
    flex-direction: column;
}
.luu-han-item strong {
    font-size: 0.95rem;
}
.luu-han-item span {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #4b5563;
}
.dark .luu-han-item span {
    color: #d1d5db;
}

/* Thêm style cho checkbox */
.luu-han-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
    font-weight: 500;
}

.luu-han-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border-width: 1px;
    border-color: #d1d5db;
    background-color: #f9fafb;
}

.dark .luu-han-checkbox {
    background-color: #4b5563;
    border-color: #6b7280;
}

@media print {
  body *, header, footer, form, button, #admin-panel, #tra-cuu, #back-to-top {
    visibility: hidden;
    margin: 0;
    padding: 0;
  }
  .laso-container, .laso-container * {
    visibility: visible;
  }
  .laso-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    border: none;
    box-shadow: none;
  }
}

/* --- CSS cho Thanh trượt Thời gian (Time Slider) --- */
.slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #10b981; /* green-500 */
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.dark .slider-thumb {
    background: #f59e0b; /* amber-500 */
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #10b981;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  margin-top: -7px; /* Căn chỉnh cho Chrome */
}

.dark input[type=range]::-webkit-slider-thumb {
    background: #f59e0b;
}

input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #10b981;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.dark input[type=range]::-moz-range-thumb {
    background: #f59e0b;
}

/* SỬA LỖI HIỂN THỊ XUỐNG DÒNG CHO BÀI VIẾT */
.popup-content-body, 
.popup-content-body div {
    white-space: pre-line;
}