/* Make any <h3> inside a preview-container span 100% width */
.preview-container > h3 {
  flex-basis: 100%;     /* take a whole row before the images */
  text-align: left;     /* align the title text left */
  margin-bottom: 0.5rem;
}

/* (Ensure your preview-containers wrap) */
.preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
}

#colorPicker {
  /* remove default border & padding */
  border: none;
  padding: 0;
  
  /* make it a nice circle */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  
  /* subtle outline */
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

/* Hover/focus state */
#colorPicker:hover,
#colorPicker:focus {
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5);
  outline: none;
}

/* WebKit-specific swatch tweaks */
#colorPicker::-webkit-color-swatch-wrapper {
  padding: 0;
}
#colorPicker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

/* Firefox-specific swatch tweak */
#colorPicker::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 4px solid rgba(0, 0, 0, 0.3);
    border-top-color: black;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.preview-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
}

.preview-item {
    position: relative;
    max-width: 100px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    width: 100%;
    height: auto;
}

#result {
    font-size: 1.5rem;
    color: #007bff;
    margin: 1rem 0;
    text-align: center;
}

.main-content {
    background: white;
    width: 100%;
    margin: auto;
    display: none;
}

.upload-area {
    width: 100%;
    border: 2px dashed #007bff;
    border-radius: 12px;
    padding: 2.5rem;
    margin: 1rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: #0056b3;
}

#preview {
    max-width: 200px;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    display: none;
}