/* Camera Feature Styles */
/* Based on Figma mockup: https://www.figma.com/design/OchtWelqBXetwDAlr7acIZ/BioTracks-Mobile-Data-Collection?node-id=243-5732 */

.camera-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  font-family: 'PT Sans', sans-serif;
}

/* Top Bar */
.camera-top-bar {
  position: relative;
  height: 250px;
  background: #000;
  padding: 26px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
}

.transect-info {
  font-size: 14px;
  color: white;
  line-height: 1.5;
}

.transect-label {
  display: block;
}

.transect-length {
  color: #ff0101;
  font-weight: bold;
}

.mario-arrows {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.complete-btn {
  background: #f0b71b;
  color: #000;
  border: none;
  border-radius: 5px;
  padding: 8px 20px;
  font-size: 14px;
  font-family: 'Mic 32 New Rounded', sans-serif;
  cursor: pointer;
  opacity: 0.62;
}

.complete-btn:disabled {
  cursor: not-allowed;
}

/* Camera Viewfinder */
.camera-viewfinder {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  touch-action: none; /* Prevent default touch behavior for pinch-to-zoom */
}

.camera-viewfinder video,
.camera-viewfinder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Zoom Controls */
.zoom-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
  z-index: 5;
}

.zoom-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'PT Sans', sans-serif;
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-btn.active {
  background: #f0b71b;
  color: #000;
  border-color: #f0b71b;
}

/* Focus Indicator */
.focus-indicator {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 2px solid #f0b71b;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 5;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}

.focus-indicator.focusing {
  animation: focusAnimation 0.6s ease-out;
}

@keyframes focusAnimation {
  0% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Modal */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal-content {
  background: white;
  border-radius: 5px;
  padding: 24px;
  width: 325px;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #000;
  line-height: 1;
}

.modal-question {
  font-size: 14px;
  font-family: 'Mic 32 New Rounded', sans-serif;
  color: #000;
  margin-bottom: 20px;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-yes,
.btn-finished {
  padding: 10px 30px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-family: 'Mic 32 New Rounded', sans-serif;
  cursor: pointer;
}

.btn-yes {
  background: #bebebe;
  color: #000;
}

.btn-finished {
  background: #919191;
  color: #000;
}

/* Camera Controls */
.camera-controls {
  height: 148px;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.photo-label {
  color: #f0b71b;
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: normal;
}

.control-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 30px;
  padding: 0 20px;
}

.btn-retake,
.btn-use-photo {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 10px;
  font-family: 'PT Sans', sans-serif;
}

.btn-capture {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.capture-circle {
  width: 86px;
  height: 86px;
  border: 6px solid white;
  border-radius: 50%;
  background: white;
  position: relative;
}

.capture-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: white;
  border-radius: 50%;
  border: 3px solid #000;
}

/* Mobile-specific adjustments */
@media (max-width: 390px) {
  .camera-container {
    font-size: 14px;
  }

  .modal-content {
    width: 90%;
    max-width: 325px;
  }
}

/* Responsive for various mobile sizes */
@media (min-width: 391px) {
  .camera-viewfinder {
    max-height: calc(100vh - 250px - 148px);
  }
}
