/*
 * Gem Studio — standalone design page.
 *
 * Shares the visualizer's palette (gold #b8860b on cream #faf8f4) so a shopper
 * moving between a product page and the studio sees one product, but laid out
 * as a full page rather than a modal.
 */

.gemstudio {
  max-width: 860px;
  margin: 0 auto;
  padding: 8px 0 40px;
  color: #1f2937;
}

.gemstudio-head h2 {
  margin: 0 0 6px;
}

.gemstudio-head p {
  margin: 0 0 20px;
  color: #4b5563;
}

.gemstudio h4 {
  margin: 22px 0 4px;
  font-size: 15px;
  color: #1f2937;
}

/* Sign-in gate */

.gemstudio--gate {
  background: #faf8f4;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}

.gemstudio-gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.gemstudio-btn-ghost {
  background: transparent !important;
  border: 1px solid #b8860b !important;
  color: #b8860b !important;
}

/* Stone source tabs */

.gemstudio-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
}

.gemstudio-tab {
  border: none;
  background: none;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.gemstudio-tab.is-active {
  color: #b8860b;
  border-bottom-color: #b8860b;
}

.gemstudio-panel {
  padding-top: 4px;
}

/* Option cards */

.gemstudio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 6px;
}

.gemstudio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.gemstudio-card:hover {
  transform: translateY(-1px);
  border-color: #d6c08a;
}

.gemstudio-card.is-active {
  border-color: #b8860b;
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.25);
}

.gemstudio-card-text {
  display: flex;
  flex-direction: column;
}

.gemstudio-card-label {
  font-weight: 600;
  font-size: 14px;
}

.gemstudio-card-desc {
  font-size: 12px;
  color: #6b7280;
}

.gemstudio-card-icon {
  font-size: 18px;
  line-height: 1;
}

/* Colour swatches */

.gemstudio-card--color {
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  min-width: 92px;
  text-align: center;
}

.gemstudio-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.25), inset 0 3px 5px rgba(255, 255, 255, 0.4);
}

.gemstudio-card--color .gemstudio-card-label {
  font-size: 12px;
  font-weight: 500;
}

/* Upload */

.gemstudio-upload input[type='file'] {
  display: none;
}

.gemstudio-upload {
  display: inline-block;
  cursor: pointer;
}

.gemstudio-upload-name {
  margin: 8px 0 0;
  font-size: 13px;
  color: #4b5563;
}

.gemstudio-preview {
  display: block;
  max-width: 220px;
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.gemstudio-note {
  font-size: 12px;
  color: #6b7280;
  margin: 10px 0 0;
  max-width: 60ch;
}

/* Actions */

.gemstudio-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.gemstudio-go {
  font-size: 16px !important;
  padding: 12px 26px !important;
}

.gemstudio-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 10px 0 0;
}

/* Result */

.gemstudio-result {
  margin-top: 26px;
  padding: 22px;
  background: #faf8f4;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-align: center;
}

.gemstudio-image {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.gemstudio-status {
  margin: 8px 0;
  color: #4b5563;
  font-size: 14px;
}

.gemstudio-error-link {
  margin-top: 10px;
  display: inline-block;
}

.gemstudio-after {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.gemstudio-3d-status {
  font-size: 13px;
  color: #4b5563;
  margin: 12px 0 0;
}

.gemstudio-3d-files {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.gemstudio-spinner {
  width: 36px;
  height: 36px;
  margin: 12px auto;
  border: 4px solid #e5e7eb;
  border-top-color: #b8860b;
  border-radius: 50%;
  animation: gemstudio-spin 0.9s linear infinite;
}

@keyframes gemstudio-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gemstudio-spinner {
    animation-duration: 2.4s;
  }

  .gemstudio-card:hover {
    transform: none;
  }
}

/* Chat refinement */

.gemstudio-chat {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
  text-align: left;
}

.gemstudio-chat-log {
  max-height: 200px;
  overflow-y: auto;
  margin: 10px 0;
}

.gemstudio-chat-line {
  margin: 6px 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 80%;
}

.gemstudio-chat-line--user {
  background: #b8860b;
  color: #fff;
  margin-left: auto;
}

.gemstudio-chat-line--ai {
  background: #fff;
  border: 1px solid #e5e7eb;
}

.gemstudio-chat-row {
  display: flex;
  gap: 8px;
}

.gemstudio-chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
}

.gemstudio-notice {
  padding: 12px 16px;
  background: #fef3c7;
  border-left: 3px solid #b8860b;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .gemstudio-card {
    flex: 1 1 100%;
  }

  .gemstudio-card--color {
    flex: 0 0 auto;
    min-width: 78px;
  }
}
