/* Container (Không đổi) */
.ihd-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}

.ihd-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Hotspot chớp sáng (Không đổi) */
.ihd-hotspot {
  position: absolute;
  width: 18px;
  height: 18px;
  background: rgba(255, 0, 0, 0.8);
  border-radius: 50%;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  animation: pulse 1.5s infinite;
  transition: transform 0.2s ease;
}
.ihd-hotspot:hover {
  transform: translate(-50%, -50%) scale(1.2);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

/* ------------------------------------------------ */
/* MỚI: Tooltip (khung đen nhỏ khi hover) */
/* ------------------------------------------------ */
.ihd-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  border-radius: 6px;
  width: 180px; 
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%);
  margin-top: -15px; 
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 15;
  cursor: pointer; /* THÊM: Báo cho người dùng biết có thể click */
}

.ihd-tooltip.ihd-visible {
  opacity: 1;
  visibility: visible;
}

/* MỚI: Header bọc text và mũi tên */
.ihd-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Đẩy text và mũi tên ra 2 phía */
  padding: 8px 12px;
}

.ihd-tooltip-header span {
  font-size: 14px;
  font-weight: bold;
  white-space: normal;
  margin-right: 10px; /* Khoảng cách giữa text và mũi tên */
}

/* Mũi tên */
.ihd-tooltip-arrow {
  width: 20px; /* Kích thước vòng tròn */
  height: 20px;
  background: white;
  border-radius: 50%;
  flex-shrink: 0;
  
  /* Căn giữa dấu chevron bên trong */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Thêm hiệu ứng khi hover (tùy chọn) */
  transition: transform 0.2s ease;
}

/* Hiệu ứng khi hover (tùy chọn) */
.ihd-tooltip:hover .ihd-tooltip-arrow {
    transform: scale(1.1);
}

/* MỚI: Tạo dấu chevron (>) bằng pseudo-element ::after */
.ihd-tooltip-arrow::after {
  content: '';
  width: 6px; /* Kích thước chevron */
  height: 6px;
  border-top: 2px solid #333; /* Màu đen/xám đậm */
  border-right: 2px solid #333;
  transform: rotate(45deg) translateX(-1px); /* Tinh chỉnh vị trí */
}

.ihd-tooltip img {
  display: block;
  width: 100%;
  height: 100px; 
  object-fit: contain; /* Sửa lỗi ảnh bị khuất */
  background: #000;
  border-radius: 0 0 6px 6px; 
}

/* ------------------------------------------------ */
/* MỚI: Modal (khung trắng lớn khi click) */
/* ------------------------------------------------ */
.ihd-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Lớp phủ mờ */
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Ẩn ban đầu */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Lớp hiển thị (JS sẽ thêm class này) */
.ihd-modal-container.ihd-visible {
  opacity: 1;
  visibility: visible;
}

.ihd-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  max-width: 400px;
  width: 90%;
  position: relative;
  text-align: center;
  padding: 25px;
  
  /* Animation (giống ảnh 1) */
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.ihd-modal-container.ihd-visible .ihd-modal-content {
  transform: scale(1);
}

.ihd-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #eee;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 20px;
  cursor: pointer;
  color: #555;

  /* Dùng Flexbox để căn giữa hoàn hảo */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Reset line-height và padding */
  line-height: 1; 
  padding: 0;
}

.ihd-modal-content img {
  width: 100%;
  max-width: 300px; /* Giới hạn kích thước ảnh */
  height: auto;
  border-radius: 8px;
  margin-bottom: 15px;
}

.ihd-modal-content h3 {
  margin: 0 0 15px 0;
  font-size: 24px;
  color: #333;
}

.ihd-modal-button {
  display: inline-block;
  background: #007bff; /* Màu xanh (giống ảnh 1) */
  color: white;
  text-decoration: none;
  padding: 12px 30px;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.2s ease;
}
.ihd-modal-button:hover {
  background: #0056b3;
}