/* styles.css */

/* Reset some basic styles for consistency */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  transition: background-color 0.3s ease;
  background-color: #f4f4f4;
}

h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  text-align: center;
}

#main-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.column {
  flex: 1;
  min-width: 250px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

@media (max-width: 800px) {
  #main-container {
    flex-direction: column;
    align-items: center;
  }

  /* Reorder columns: center first, then left, then right */
  #center-column {
    order: 1;
  }

  #left-column {
    order: 2;
  }

  #right-column {
    order: 3;
  }
}

.boxed-section {
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

#input-label {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
}

textarea {
  width: 100%;
  height: 150px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  resize: none;
  box-sizing: border-box;
}

button {
  font-size: 1rem;
  padding: 10px 20px;
  border: none;
  background-color: #007bff; /* Blue background for all buttons */
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

/* Clear All button is now also blue, matching others */
/* No special styling for clear-btn now, since all are blue */

#top-buttons {
  display: flex;
  gap: 10px;
}

#summary {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 1.2rem;
  justify-content: center;
}

#last-scanned-area {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

#scan-status {
  font-size: 4.5rem;
  font-weight: bold;
  color: #000;
}

#scan-input {
  font-size: 1rem;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  display: block;
}

.list-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 600px;
}

.list-section h2 {
  font-size: 1.5rem;
  margin: 0;
}

.serial-list {
  list-style: none;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: white;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
}

.serial-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.serial-item:last-child {
  border-bottom: none;
}

.serial-item.green {
  background-color: #4caf50;
  color: white;
  font-weight: bold;
}

.serial-item.unmatched {
  background-color: #f8d7da;
}

.delete-btn {
  font-size: 0.9rem;
  padding: 5px 10px;
  border: none;
  background-color: #dc3545;
  color: white;
  border-radius: 3px;
  cursor: pointer;
  margin-left: 10px;
}

.delete-btn:hover {
  background-color: #c82333;
}

.modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: white;
  padding: 20px;
  border-radius: 5px;
  max-width: 500px;
  width: 90%;
  box-sizing: border-box;
  text-align: center;
}

.modal h2 {
  margin-top: 0;
}

.modal button {
  margin-top: 20px;
  background: #007bff;
}

#download-report-btn {
  margin-top: 20px;
  background-color: #007bff;
  font-size: 1rem;
  padding: 10px 20px;
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

#download-report-btn:hover {
  background-color: #0056b3;
}

/* Feedback Toggles and Volume Slider */
#feedback-toggles {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-container label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.toggle-container input[type="checkbox"] {
  margin-right: 5px;
  width: 20px;
  height: 20px;
}

.toggle-container .icon {
  font-size: 1.5rem;
}

/* Volume slider now can go up to 1.3 as requested */
#volume-slider {
  width: 100px;
  display: none;
}

@media (max-width: 600px) {
  #feedback-toggles {
    position: static; /* Remove fixed positioning */
    margin: 20px auto 0 auto; /* Center horizontally with top margin */
    flex-direction: row; /* Arrange toggles in a row */
    gap: 20px; /* Adjust gap between toggles for better spacing */
    justify-content: center; /* Ensure toggles are centered */
    background: none; /* Remove background if any */
    box-shadow: none; /* Remove shadow if any */
    padding: 0; /* Remove any padding */
  }

  /* Adjust volume slider width for mobile */
  #volume-slider {
    width: 80px;
  }

  /* Optional: Adjust toggle container spacing */
  .toggle-container {
    gap: 10px;
  }
}
