/* AddItem.css */

.add-item-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.add-item-title {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 2rem;
}

.add-item-form {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.image-upload {
  flex: 1 1 40%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* image-upload box: always outlined in fg color */
.upload-box {
  width: 100%;
  background-color: var(--card);
  border: 1px solid var(--fg);
  border-radius: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.preview {
  max-width: 100%;
  max-height: 100%;
  border-radius: 1rem;
}

.form-fields {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-fields label {
  font-weight: 500;
}

/* inputs, selects, textareas pick up page bg & text colours */
.form-fields input,
.form-fields select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 2rem;
  border: 1px solid var(--fg);
  background-color: var(--bg);
  color: var(--fg);
  font-size: 1rem;
}

.form-fields select {
  appearance: none;
  background-image: url("../../public/drop_down.png");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  color: var(--fg);
}

.form-fields select:focus {
  outline: none;
}

.form-fields select option {
  color: var(--fg);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip {
  background-color: var(--border);
  color: var(--fg);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
}

.chip button {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.1rem;
  margin-left: 0.5rem;
  cursor: pointer;
}

.submit-btn {
  margin-top: 1rem;
  background-color: var(--fg);
  color: var(--bg);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-size: 1rem;
  cursor: pointer;
  align-self: flex-start;
}

.popup-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 1rem;
  color: white;
  z-index: 1000;
  font-size: 1.2rem;
}

/* 📱 Responsive mobile layout */
@media (max-width: 768px) {
  .add-item-form {
    flex-direction: column;
  }

  .image-upload,
  .form-fields {
    flex: 1 1 100%;
    width: 100%;
  }

  .upload-box {
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 1rem;
    border-radius: 2rem;
    background-color: var(--card);
    border: 1px solid var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .submit-btn {
    align-self: stretch;
  }
}