/* css/style.css */

body {
  background-color: #f8f9fa;
  overflow-x: hidden;
}

/* --- Section quản lý hiển thị --- */
.hidden {
  display: none !important;
}

/* --- Camera Fullscreen Mobile --- */
#camera-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.camera-container {
  position: relative;
  flex-grow: 1;
  /* Chiếm hết khoảng trống còn lại */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Đảm bảo full màn hình không bị méo */
}

/* --- Overlay thẻ ATM (Tối ưu chụp xa 50-70cm) --- */
/* Khi chụp xa, vật thể lớn, thẻ ATM sẽ trông nhỏ đi.
   Ta đặt nó ở góc để không che vật thể chính */
.atm-overlay {
  position: absolute;
  bottom: 20%;
  right: 5%;
  width: 85px;
  /* Nhỏ hơn 1 nửa so với bản trước */
  height: 54px;
  border: 2px dashed #00ff00;
  background-color: rgba(0, 255, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00ff00;
  font-size: 9px;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

/* --- Thanh điều khiển bên dưới --- */
.camera-controls {
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 20px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9;
}

.btn-capture {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: #fff;
  border: 5px solid #ccc;
  position: relative;
}

.btn-capture:active {
  background-color: #ddd;
  border-color: #fff;
}

/* --- Modal Review ảnh --- */
.review-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.review-img {
  max-width: 95%;
  max-height: 70vh;
  border: 2px solid #fff;
  margin-bottom: 20px;
}

.review-actions .btn {
  min-width: 120px;
  margin: 0 10px;
}

/* Thêm vào css/style.css */

.zoom-controls {
  position: absolute;
  bottom: 25%;
  /* Cao hơn khung ATM một chút */
  right: 5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.5);
  padding: 5px;
  border-radius: 20px;
}

.zoom-controls button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  display: flex;
  /* Căn giữa dấu + - */
  justify-content: center;
  align-items: center;
}

.atm-overlay {
  /* Đặt kích thước mặc định ban đầu */
  width: 85px;
  height: 54px;
  /* ... giữ nguyên các thuộc tính cũ ... */
  position: absolute;
  bottom: 20%;
  right: 5%;
  border: 2px dashed #00ff00;
  background-color: rgba(0, 255, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00ff00;
  font-size: 9px;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  transition: width 0.1s, height 0.1s;
  /* Hiệu ứng mượt khi resize */
}

/* css/style.css */

/* ... các style cũ ... */

.camera-container {
  position: relative;
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  /* Thêm nền đen để tránh nháy trắng */
}

/* Video gốc nằm dưới cùng */
#video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* [MỚI] Canvas phủ lên để vẽ nhận diện */
#detectionOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Quan trọng: phải khớp object-fit với video */
  z-index: 5;
  /* Nằm trên video nhưng dưới khung ATM */
  pointer-events: none;
  /* Để click xuyên qua */
}

/* Khung ATM nằm trên cùng */
.atm-overlay {
  /* ... các thuộc tính cũ ... */
  z-index: 10;
}

/* ... các style khác giữ nguyên ... */