body {
  font-family: 'Montserrat', sans-serif;
  background: #121212;
  color: #fff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow-x: hidden;
}

.app-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 1100px;
  margin: 20px auto;
}

.square-wrapper {
  width: 100%;
  position: relative;
  padding-top: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #333;
}

#webcam,
#photo-output {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.controls-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 20px;
}

.app-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.sub-title {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 15px;
}

.btn-capture {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

.btn-capture:active:not(:disabled) {
  transform: scale(0.9);
  background: #ff4757;
}

.btn-capture:disabled {
  background: #555;
  cursor: not-allowed;
}

.action-btn {
  width: 100%;
  text-align: left;
  padding: 12px 20px;
  margin-bottom: 12px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-retake {
  background: #4a4a4a;
  color: #fff;
}

/* --- CẬP NHẬT: Nút Download màu xanh chuyên nghiệp (Bỏ cầu vồng) --- */
.btn-download {
  background: #00b894;
  /* Màu xanh ngọc */
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
}

.btn-download:hover {
  background: #01987a;
  color: #fff;
}

.btn-facebook {
  background: #1877F2;
  color: #fff;
}

#canvas {
  display: none;
}

.gps-badge {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
  border-radius: 20px;
  color: #aaa;
  margin-bottom: 20px;
}

.gps-active {
  color: #4cd137;
  border: 1px solid #4cd137;
}

/* ... (Các code cũ giữ nguyên) ... */

.gps-badge {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
  border-radius: 20px;
  color: #aaa;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  /* Hiệu ứng mượt */
}

/* Khi đã có GPS (Active) */
.gps-active {
  color: #4cd137;
  border: 1px solid #4cd137;
  cursor: pointer;
  /* Biến chuột thành bàn tay */
  text-decoration: underline;
  /* Gạch chân nhẹ để biết là link */
}

/* Hiệu ứng khi rê chuột vào */
.gps-active:hover {
  background: rgba(76, 209, 55, 0.2);
  /* Nền xanh nhẹ */
  transform: scale(1.05);
  /* Phóng to nhẹ */
  box-shadow: 0 0 10px rgba(76, 209, 55, 0.5);
  /* Phát sáng */
}

/* ... (Code cũ giữ nguyên) ... */

/* Nút Đổi Camera */
#btn-switch-camera {
  opacity: 0.7;
  transition: all 0.2s;
}

#btn-switch-camera:hover {
  opacity: 1;
  transform: scale(1.1);
}

#btn-switch-camera:active {
  transform: scale(0.95);
}

/* Ẩn nút đổi camera khi đã chụp xong (đang hiện ảnh tĩnh) */
.square-wrapper img.d-none+#btn-switch-camera {
  display: block;
}

/* Logic CSS nâng cao: Khi video bị ẩn (tức là đã chụp), thì ẩn luôn nút switch */
video.d-none~#btn-switch-camera {
  display: none;
}

.btn-capture:disabled {
  background: #555;
  /* Màu xám tối */
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  /* Con trỏ chuột báo cấm */
  opacity: 0.6;
  box-shadow: none;
  /* Bỏ hiệu ứng phát sáng */
}