/* General reset */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* Header styling */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

/* Title Section */
.title h1 {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
}

.title p {
  font-size: 14px;
  color: #666;
  /* Subtle gray for subtitle */
  margin: 0;
}

/* Button Section */
.header-buttons {
  display: flex;
  gap: 10px;
  /* Space between buttons */
}

/* Icon Button Styling */
.icon-button {
  width: 40px;
  height: 40px;
  background-color: #f5f5f5;
  /* Light gray background */
  border: none;
  border-radius: 8px;
  /* Rounded corners */
  font-size: 16px;
  /* Font size for "..." */
  color: #333;
  /* Darker gray text */
}

.icon-button:hover {
  background-color: #eaeaea;
  /* Slightly darker gray on hover */
}

/* Primary Button Styling */
.primary-button {
  padding: 10px 20px;
  background-color: black;
  /* Black button */
  color: white;
  /* White text */
  border: none;
  border-radius: 8px;
  /* Rounded corners */
  font-size: 16px;
}

.primary-button:hover {
  background-color: #333;
  /* Darker black on hover */
}

/* Dropdown Button Styling */
.dropdown-button {
  width: 40px;
  height: 40px;
  background-color: transparent;
  /* Transparent background */
  border: none;
  font-size: 20px;
  /* Font size for dropdown arrow */
}

/* Container styling to hold the sections */
.container {
  position: absolute;
  /* Absolute positioning */
  top: 80px;
  /* Height of the header */
  left: 0;
  width: 100%;
  height: calc(100vh - 80px);
  /* Remaining height after header */
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  box-sizing: border-box;
}

/* Section styling */
.section {
  border: 1px solid #ddd;
  /* Light gray border */
  border-radius: 8px;
  /* Rounded corners */
  padding: 15px;
  box-sizing: border-box;
  /* Makes padding and border part of the element's total width and height */
  overflow: hidden;
  /* Prevent content overflow */
  position: relative;
  /* For positioning child elements */
}

/* Specific widths for each section */
/* Image section */
.section:nth-child(1) {
  width: calc(48% - 10px);
  height: calc(55% - 10px);
}

.section:nth-child(1) .content {
  height: 95%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Results section */
.section:nth-child(2) {
  width: calc(52% - 10px);
  height: calc(55% - 10px);
  overflow-y: auto;
}

/* Console section */
.section:nth-child(3),
/* Configurations section */
.section:nth-child(4) {
  width: calc(50% - 10px);
  height: calc(45% - 10px);
  /* Full width */
  overflow-y: auto;
}

/* Section heading */
.section h2 {
  font-size: 1.2em;
  margin-top: 0;
  margin-bottom: 5px;
  color: #333;
  /* Dark gray for the title */
}

/* CONTENT STYLING */
/* Content area inside the section */
.content {
  display: flex;
  flex-direction: column;
  /* Stack items vertically */
  justify-content: space-between;
  /* Space between image and button */
}


#consoleOutput {
  overflow-y: auto;
  /* Enable vertical scrolling */
  padding: 5px;
  /* Optional: Add some padding for spacing */
  line-height: 1.5;
  /* Adjust the line height as needed */
  /* background-color: #b5b3b3; */
}


.face-bbox.real {
  border-color: green;
}

.face-bbox.fake {
  border-color: red;
}


/* Image container styling */
.image-container {
  flex-grow: 1;
  /* Make the image container take up all available space */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;

}
/* Bounding box style */
.face-bbox {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none; /* don't block clicks */
  border: 3px solid yellow; /* default color */
  pointer-events: none;
  }


#imagePreview {
  max-width: 100%;
  /* Ensure image doesn't overflow container */
  max-height: 100%;
  /* Ensure image doesn't overflow container */
  object-fit: contain;
  /* Maintain aspect ratio while fitting within container */
}

/* Results container styling */
#faceCropsContainer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Two columns */
  gap: 16px;
  /* Space between items */
}

.face-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: #fafafa;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.face-info {
  margin-left: 10px;
}
.bounding-box {
  border: 2px solid limegreen;
  position: absolute;
  box-sizing: border-box;
}

.confidence {
  width: 120px;
  /* Adjust as needed */
  height: 20px;
  /* Increased height */
  background-color: #ddd;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.confidence-bar {
  height: 100%;
  /* Expand to fill the container */
  background: #4CAF50;
  transition: width 0.5s ease, background 0.3s ease;
  color: white;
  text-align: center;
  border-radius: 3px;
  font-size: 0.8em;
  min-width: 40px;
  display: flex;
  /* Use flexbox */
  justify-content: center;
  /* Center horizontally */
  align-items: center;
  /* Center vertically */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.confidence-bar.fake {
  background: #ff4444;
  /* Red for FAKE */
}

/* Configuration container styling */
.config-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  padding: 10px;

}

.config-item label {
  font-weight: bold;
}

/* Upload form styling */
.upload-form {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.upload-button,
#previewBtn,
#detectBtn,
#predictBtn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s, color 0.3s;
}

#previewBtn.disabled,
#detectBtn.disabled,
#predictBtn.disabled {
  background-color: #ccc;
  color: #777;
  cursor: not-allowed;
}

#previewBtn.active,
#detectBtn.active,
#predictBtn.active {
  background-color: #007bff;
  color: white;
}

.upload-button:hover {
  background-color: #0056b3;
}

.workflow-btn {
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  min-width: 100px;
  /* smaller fixed width */
  max-width: 120px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s, color 0.3s;
}

.workflow-btn.active {
  background-color: #007bff;
  color: white;
}

.workflow-btn.disabled {
  background-color: #ccc;
  color: #777;
  cursor: not-allowed;
}

.loader {
  border: 8px solid #f3f3f3;
  /* Light gray background */
  border-top: 8px solid #007bff;
  /* Blue spinning section */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#spinner {
  display: none;
  margin-top: 10px;
  text-align: center;
}

.model-dropdown {
  width: 250px;
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  min-width: 200px;
  transition: border-color 0.3s;
}

.model-dropdown:hover {
  border-color: #007bff;
}

.model-dropdown:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.face-item {
  display: inline-block;
  margin: 5px;
  text-align: center;
}

.face-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border: 2px solid #4CAF50;
  border-radius: 5px;
}