/**
 * Face Recognition Components - Responsive Styles
 * Implements responsive design for the face/image-based feedback search feature
 */

/* General container styling */
.face-recognition-container {
  position: relative;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Preview area */
.preview-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 0.375rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preview-container img {
  max-width: 100%;
  height: auto;
}

/* Face detection canvas */
#faceCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Image upload area */
.upload-container {
  background-color: rgba(23, 106, 58, 0.05);
  border: 2px dashed #176a3a;
  border-radius: 0.5rem;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-container:hover,
.upload-container.drag-over {
  background-color: rgba(23, 106, 58, 0.1);
  border-color: #14532d;
}

.upload-container .upload-icon {
  font-size: 3rem;
  color: #176a3a;
  margin-bottom: 1rem;
}

/* Camera container */
.camera-container {
  display: none;
  width: 100%;
  margin: 0 auto;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.camera-controls {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  background-color: rgba(0, 0, 0, 0.03);
  gap: 1rem;
}

#cameraFeed {
  width: 100%;
  max-height: 80vh;
  background-color: #000;
}

/* Processing status */
.face-processing-status {
  margin: 1rem 0;
}

/* Search results */
.search-results {
  margin-top: 2rem;
}

.results-container .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.results-container .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Privacy controls */
.privacy-controls {
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.privacy-controls .form-check-input:checked {
  background-color: #176a3a;
  border-color: #14532d;
}

/* Mobile responsiveness */
@media (max-width: 767.98px) {
  .upload-container {
    padding: 1.5rem 1rem;
  }
  
  .upload-container .upload-icon {
    font-size: 2.5rem;
  }
  
  .camera-controls {
    flex-wrap: wrap;
  }
  
  .camera-controls .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .preview-container {
    max-height: 50vh;
    overflow: hidden;
  }
  
  #imagePreview {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  
  /* Make sure buttons are easily tappable on mobile */
  .btn {
    padding: 0.5rem 1rem;
  }
  
  /* Full-width dropdowns on mobile */
  .form-select, 
  .form-control {
    width: 100%;
  }
  
  /* Adjust cards in search results */
  .results-container .col-md-4 {
    margin-bottom: 1rem;
  }
}

/* Tablet responsiveness */
@media (min-width: 768px) and (max-width: 991.98px) {
  .preview-container {
    max-height: 60vh;
  }
}

/* Custom FeedoCenter theme elements */
.btn-feedo {
  background-color: #176a3a;
  border-color: #14532d;
  color: white;
}

.btn-feedo:hover,
.btn-feedo:focus {
  background-color: #14532d;
  border-color: #0f4024;
  color: white;
}

.text-feedo {
  color: #176a3a;
}

.border-feedo {
  border-color: #176a3a !important;
}

/* Loader animation for processing */
.face-recognition-loader {
  display: inline-block;
  width: 80px;
  height: 80px;
  position: relative;
}

.face-recognition-loader div {
  position: absolute;
  border: 4px solid #176a3a;
  opacity: 1;
  border-radius: 50%;
  animation: face-recognition-loader 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.face-recognition-loader div:nth-child(2) {
  animation-delay: -0.5s;
}

@keyframes face-recognition-loader {
  0% {
    top: 36px;
    left: 36px;
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    top: 0px;
    left: 0px;
    width: 72px;
    height: 72px;
    opacity: 0;
  }
}
