/* ============================================================
   Uultis AI Visualizer — Styles
   Follows the site design language: black/white, athelas/Suis In, uppercase
   ============================================================ */

/* Coluna que envolve imagem + panel, alinhada à esquerda */
.uv-image-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-right: 10px;
}

/* ── Image wrapper ── */
.uv-img-wrap {
  display: block;
  line-height: 0;
}

.uv-img-wrap > img.image {
  display: block;
  margin-right: 0 !important;
}

/* ── Image action links (below image, only when generated) ── */
#uv-img-actions {
  display: none;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

#uv-img-actions.active {
  display: flex;
}

#uv-img-actions a {
  font-family: "Suis in", serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  text-decoration: none;
  transition: color 0.15s ease;
  cursor: pointer;
}

#uv-img-actions a:hover {
  color: #000;
}

#uv-overlay-fullscreen {
  margin-left: auto;
}

/* ── Fullscreen modal ── */
#uv-fullscreen-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#uv-fullscreen-modal img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  pointer-events: none;
}

#uv-fullscreen-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

#uv-fullscreen-close:hover {
  opacity: 1;
}

#uultis-visualizer {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font-family: "Suis in", serif;
  width: 100%;
  /* max-width: 380px; */
}

/* ── Header ── */
#uultis-visualizer .uv-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #000;
}

#uultis-visualizer .uv-icon {
  width: 28px;
  height: 28px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

#uultis-visualizer .uv-icon svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

#uultis-visualizer .uv-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  margin: 0;
  line-height: 1;
  font-family: "Suis in", serif;
}

#uultis-visualizer .uv-subtitle {
  font-size: 11px;
  color: #888;
  margin: 0;
  line-height: 1;
  margin-top: 4px;
  font-weight: 300;
  font-family: "Suis in", serif;
}

/* ── AI Prompt Suggestions ── */
#uv-ai-prompts-section {
  display: none;
  margin-bottom: 16px;
}

#uv-ai-prompts-section.active {
  display: block;
}

.uv-ai-prompts-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 8px;
  font-family: "Suis in", serif;
}

.uv-ai-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uv-ai-prompt-chip {
  padding: 6px 12px;
  border: 1px solid #000;
  background: transparent;
  font-size: 11px;
  color: #000;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: "Suis in", serif;
  font-weight: 300;
  text-align: left;
  line-height: 1.4;
}

.uv-ai-prompt-chip:hover {
  background: #000;
  color: #fff;
}

/* ── Clarifying Questions ── */
#uv-clarifying-panel {
  display: none;
  background: #f8f8f8;
  border-left: 2px solid #000;
  padding: 14px 16px;
  margin-bottom: 14px;
}

#uv-clarifying-panel.active {
  display: block;
}

.uv-clarify-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #000;
  margin-bottom: 8px;
  font-family: "Suis in", serif;
}

.uv-clarify-question {
  font-size: 13px;
  color: #000;
  margin-bottom: 10px;
  line-height: 1.5;
  font-family: "Suis in", serif;
  font-weight: 300;
}

.uv-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uv-chip {
  padding: 5px 12px;
  border: 1px solid #ccc;
  background: #fff;
  font-size: 11px;
  color: #000;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: "Suis in", serif;
  font-weight: 300;
}

.uv-chip:hover,
.uv-chip.selected {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* ── Textarea ── */
#uultis-visualizer .uv-prompt-wrapper {
  position: relative;
  margin-bottom: 8px;
}

#uv-prompt {
  width: 100%;
  min-height: 72px;
  max-height: 160px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #000;
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  resize: vertical;
  font-family: "Suis in", serif;
  font-weight: 300;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

#uv-prompt:focus {
  border-color: #000;
  background: #fff;
}

#uv-prompt::placeholder {
  color: #bbb;
  font-weight: 300;
}

/* ── Example prompts chips (static) ── */
.uv-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.uv-example-chip {
  padding: 4px 10px;
  border: 1px solid #e0e0e0;
  background: transparent;
  font-size: 10px;
  color: #888;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: "Suis in", serif;
  font-weight: 300;
  white-space: nowrap;
}

.uv-example-chip:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* ── Generate Button ── */
#uv-generate-btn {
  width: 100%;
  padding: 12px 20px;
  background: #000;
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: outline 0.15s ease, outline-offset 0.15s ease;
  font-family: "Suis in", serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: 1px solid transparent;
  outline-offset: 0;
}

#uv-generate-btn:hover:not(:disabled) {
  outline: 1px solid #000;
  outline-offset: 3px;
}

#uv-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Generate with AI button (secondary) ── */
#uv-ai-suggest-btn {
  width: 100%;
  padding: 10px 20px;
  background: transparent;
  color: #000;
  border: 1px solid #000;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: "Suis in", serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

#uv-ai-suggest-btn:hover:not(:disabled) {
  background: #000;
  color: #fff;
}

#uv-ai-suggest-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#uv-ai-suggest-btn .uv-spinner-sm {
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: uv-spin 0.6s linear infinite;
  display: none;
}

#uv-ai-suggest-btn.loading .uv-spinner-sm {
  display: inline-block;
}

/* ── Progress ── */
#uv-progress-wrapper {
  display: none;
  margin-top: 14px;
}

#uv-progress-wrapper.active {
  display: block;
}

#uv-progress-bar-track {
  height: 2px;
  background: #e0e0e0;
  overflow: hidden;
  margin-bottom: 8px;
}

#uv-progress-bar-fill {
  height: 100%;
  background: #000;
  width: 0%;
  transition: width 0.4s ease;
}

#uv-progress-label {
  font-size: 10px;
  color: #888;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "Suis in", serif;
}

/* ── History ── */
#uv-history {
  margin-top: 16px;
  border-top: 1px solid #e0e0e0;
  padding-top: 14px;
  display: none;
}

#uv-history.active {
  display: block;
}

.uv-history-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 10px;
  font-family: "Suis in", serif;
}

.uv-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.uv-history-item:last-child {
  border-bottom: none;
}

.uv-history-item:hover {
  opacity: 0.75;
}

.uv-history-item img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.uv-history-item span {
  font-size: 11px;
  color: #888;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Suis in", serif;
  font-weight: 300;
}

.uv-history-item .uv-restore-btn {
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid #ccc;
  background: transparent;
  cursor: pointer;
  color: #888;
  font-family: "Suis in", serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
}

.uv-history-item .uv-restore-btn:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* ── Actions row ── */
.uv-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

#uv-reset-btn {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: 1px solid #e0e0e0;
  font-size: 10px;
  color: #888;
  cursor: pointer;
  font-family: "Suis in", serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
  display: none;
  width: 100%;
  margin-top: 10px;
}

#uv-reset-btn:hover {
  border-color: #000;
  color: #000;
}

#uv-reset-btn.active {
  display: block;
}

/* ── Error ── */
#uv-error {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff8f8;
  border-left: 2px solid #c0392b;
  font-size: 12px;
  color: #c0392b;
  font-family: "Suis in", serif;
  font-weight: 300;
}

#uv-error.active {
  display: block;
}

/* ── Spinner ── */
@keyframes uv-spin {
  to { transform: rotate(360deg); }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  #uultis-visualizer {
    margin-top: 20px;
    padding: 16px;
  }

  .uv-examples {
    display: none;
  }

  #uv-prompt {
    font-size: 16px;
  }
}
