
/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
  color: #9a9a9a;
  background-color: white;
}

#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgb(222, 144, 27);
  padding: 1rem;
  text-align: center;
  z-index: 100;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}


header h1 {
  color: #2c3e50;
  font-size: 1.2rem;
}

legend {
  font-size: 0.7rem;
  font-weight: 800;
}

.main-content {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-panel {
  flex: 2;
  min-width: 400px;
}

.controls-panel {
  flex: 1;
  min-width: 300px;
  background: white;
  /* padding: 10px; */
  border-radius: 8px;
  /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
}

#canvas-container {
  position: sticky;
  top: 12px;
  z-index: 10;
  background: white;
  border-radius: 2px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  /* Dimensions are set by the native mockup compositor. */
}

#mockup-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.canvas2d-poc {
  margin-top: 20px;
  padding: 12px;
  background: #f7f7f7;
  border: 1px dashed #b9b9b9;
  text-align: center;
}

.canvas2d-poc p {
  margin-bottom: 8px;
  color: #666;
  font-size: 0.75rem;
}

#canvas2d-poc {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
  background: #17314d;
}

/* Form Controls */
.control-group {
  margin-bottom: 6px;
  font-size: 0.8rem;
  padding: 8px;
  background-color: white;
}

.control-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 300;
  font-size: 0.7rem;
  color: #9a9a9a;
}

fieldset.control-group {
  border-style: none;
  margin-bottom: 36px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

input[type="text"],
textarea, select {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1em;
  color: #0f0f0f;
}

textarea {
  min-height: 50px;
  resize: vertical;
  font-size: 1.6em;
}

.radio-group {
  display: flex;
  gap: 10px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Range Inputs */
.control-group input[type="range"] {
  width: 60%;
  margin: 3px;
}

.control-group label span {
  font-weight: normal;
  font-size: 0.85em;
  color: #666;
}

/* Model Options */
.model-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.model-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.model-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.model-option img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border: 2px solid transparent;
  border-radius: 4px;
}

.model-option input:checked + img {
  border-color: #ed7520;
}

.version-options {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.version-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.version-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.version-option img {
  width: 86%;
  object-fit: contain;
  border: 2px solid transparent;
  border-radius: 4px;
}

.version-option input:checked + img {
  border-color: #ed7520;
}

/* Color Options */
.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-option {
  position: relative;
}

.color-option input {
  position: absolute;
  opacity: 0;
}

.color-option .color-swatch {
  /* min-width: 30px; */
  /* height: 10px; */
  border-radius: 100px;
  border: 1px solid #ddd;
  padding: 9px;
  margin-bottom: 14px;
  cursor: pointer;
}

.color-option input:checked + .color-swatch {
  /* border-color: #ed7520; */
  background-color: black;
  color: white;
  transform: scale(1.1);
}

.extras-instructions {
  display: inline;
  font-size: smaller;
}

.extras-instructions img {
  width: 40px;
  height: 20px;
  object-fit: contain;
  border: 1px solid transparent;
  border-radius: 4px;
}

/* Flower Selectors */
#flower-selectors {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flower-selector-group label {
  font-weight: 600;
  color: #333;
}

.flower-options {
  display: grid;
  grid-template-columns: repeat(7, 48px);
  gap: 8px;
  padding: 8px 4px;
  border-radius: 6px;
  background-color: #f7f7f7;

  /* Manage vertical scroll for grid */
  max-height: 220px;
  overflow-y: auto;

  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #ed7520 #e0e0e0;
}

.flower-options::-webkit-scrollbar {
  width: 8px;
}

.flower-options::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 4px;
}

.flower-options::-webkit-scrollbar-thumb {
  background-color: #ed7520;
  border-radius: 4px;
}


.flower-thumbnail {
  display: inline-block;
  cursor: pointer;
  flex-shrink: 0; /* Prevent thumbnails from shrinking */
}

.flower-thumbnail img {
  width: 48px; /* Larger thumbnails */
  height: 48px;
  object-fit: contain;
  border: 2px solid #ccc;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
  background-color: white;
}

.flower-thumbnail input {
  display: none;
}

.flower-thumbnail input:checked + img {
  border-color: #ed7520;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(237, 117, 32, 0.6);
}

/* Buttons */
button {
  background-color: #ed7520;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
  width: 100%;
}

button:hover {
  background-color: #ed7520;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

input[type="radio"]:focus-visible + .color-swatch,
input[type="radio"]:focus-visible + img {
  outline: 2px solid #ed7520;
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
  #canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 40vh !important;
    max-height: 40vh;
    min-height: 200px;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
  }
  .preview-panel {
    min-width: unset;
    width: 100vw;
    padding: 0;
    /* margin-top: 2vh; */
  }
  .controls-panel {
    /* margin-top: 0; */
    min-width: unset;
    width: 100vw;
    padding-bottom: 2rem;
  }
  body {
    padding-top: 40vh;
  }
}
