/* style.css — Pipeline UI */

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

html, body {
  height: 100%;
  font-size: 16px;
  line-height: 1.6;
  font-family: Arial, Helvetica, sans-serif;
}

/* ── Two-column shell ── */
body {
  display: flex;
  overflow: hidden;
}

/* ── Left Sidebar ── */
.sidebar {
  width: 340px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid #ddd;
}

.sidebar-header h1 {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.95rem;
  font-weight: normal;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 1.4rem;
}

.sidebar-tagline {
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.sidebar-credit {
  margin-top: 1.4rem;
  font-size: 0.72rem;
  font-style: italic;
  margin-bottom: 0.4rem;
}

.steps-nav {
  padding: 0 1.25rem 2rem;
  flex: 1;
}

/* ── Right Panel ── */
.right-panel {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ── Info Overlay ── */
.info-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 100;
  overflow-y: auto;
  /* padding: 3rem 3.5rem; */
  padding: 3rem 3rem 1rem;
}

.info-overlay.visible {
  display: block;
}

.info-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.5rem;
}

.info-body {
  max-width: 640px;
}

.info-body p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.info-credit {
  margin-top: 2rem;
  font-size: 0.8rem;
  font-style: italic;
}

/* ── Preview + Flatplan row ── */
.preview-row {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}

/* ── Preview section ── */
.preview-section {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #f5f5f5;
}

/* ── Flatplan section (right column) ── */
.flatplan-section {
  display: none;
  width: 440px;
  flex-shrink: 0;
  border-left: 1px solid #ddd;
  flex-direction: column;
  overflow: hidden;
}

.flatplan-section.visible {
  display: flex;
}

.flatplan-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 0.75rem;
  flex-shrink: 0;
  border-bottom: 1px solid #ddd;
}

.flatplan-iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: none;
  display: block;
  background: #e8e8e8;
  overflow-y: auto;
}

/* ── Bottom action bar ── */
.right-actions {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #ddd;
  flex-shrink: 0;
}

.action-btn {
  flex: 1;
  min-height: 40px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  background: #eee;
  color: #111;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s, transform 0.1s;
}

.action-btn:hover {
  background: #ddd;
  transform: translateY(-1px);
}

/* ── Floating Info Button ── */
.info-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFE033;
  color: #111;
  border: none;
  cursor: pointer;
  z-index: 9999;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.15s, transform 0.1s;
}

.info-btn:hover {
  background: #ffd700;
  transform: scale(1.08);
}

.info-btn.active {
  background: #111;
  color: #FFE033;
}

/* ── Feature button (scaffold, etc.) ── */
.feature-btn {
  display: inline-block;
  min-height: 40px;
  padding: 0.4rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  background: #eee;
  color: #111;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: background 0.15s, transform 0.1s;
  margin-top: 0.25rem;
}

.feature-btn:hover {
  background: #ddd;
  transform: translateY(-1px);
}

.scaffold-btn {
  color: #3EFF00;
  border-color: #3EFF00;
  background: #111;
}

.scaffold-btn:hover {
  background: #1a1a1a;
}

/* ── Step Sections (collapsible) ── */
.step {
  border-bottom: 1px solid #ddd;
}

.step:first-of-type {
  border-top: 1px solid #ddd;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  cursor: pointer;
  user-select: none;
}

.step-header:hover .step-label {
  opacity: 0.65;
}

.step-chevron {
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: #555;
  line-height: 1;
}

.step.collapsed .step-chevron {
  transform: rotate(-90deg);
}

.step-body {
  padding-bottom: 1.5rem;
}

.step.collapsed .step-body {
  display: none;
}

.step-label {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.15s;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid #333;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Drop Zone ── */
.drop-zone {
  border: 3px dashed #ccc;
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #333;
}

.drop-zone.has-file {
  border-style: solid;
  border-color: #333;
}

.drop-zone-text {
  font-size: 0.95rem;
  font-weight: 500;
}

.drop-zone-hint {
  font-size: 0.85rem;
}

.file-info {
  font-size: 0.9rem;
  font-weight: 600;
}

.file-meta {
  font-size: 0.82rem;
}

.toggle-paste {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.88rem;
  cursor: pointer;
  font-weight: 600;
  background: none;
  border: none;
  text-decoration: underline;
  min-height: 36px;
  line-height: 36px;
}

.paste-area {
  display: none;
  margin-top: 0.75rem;
}

.paste-area.visible {
  display: block;
}

.paste-area textarea {
  width: 100%;
  min-height: 140px;
  padding: 0.75rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
  border: 2px solid #ccc;
  border-radius: 8px;
  resize: vertical;
}

.paste-area textarea:focus {
  outline: none;
  border-color: #333;
}

/* ── Size Cards ── */
.category-group {
  margin-bottom: 1rem;
}

.category-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #ccc;
}

.size-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.size-card {
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 54px;
  flex: 0 0 auto;
}

.size-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.size-card.selected {
  border-color: #333;
  box-shadow: 0 0 0 2px #333;
}

.size-preview {
  border: 1.5px solid #ccc;
  flex-shrink: 0;
}

.size-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.size-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.size-dims {
  font-size: 0.75rem;
}

/* ── Custom Size Inputs ── */
.custom-inputs {
  display: none;
  margin-top: 0.75rem;
  gap: 0.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.custom-inputs.visible {
  display: flex;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
}

.input-group input,
.input-group select {
  min-height: 36px;
  padding: 0.4rem 0.6rem;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  width: 88px;
}

.input-group select {
  width: 72px;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #333;
}

/* ── Generate Button ── */
.generate-btn {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.03em;
}

.generate-btn:hover:not(:disabled) {
  background: #111;
  transform: translateY(-1px);
}

.generate-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
  opacity: 0.7;
}

.generate-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* ── Spinner / Status ── */
.status {
  text-align: center;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  display: none;
}

.status.visible {
  display: block;
}

.spinner {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  border: 3px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

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

/* ── Typography Controls ── */
.typo-hint {
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.stretch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  user-select: none;
}

.stretch-toggle input[type="checkbox"] {
  display: none;
}

.stretch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #333;
  flex-shrink: 0;
  transition: background 0.15s;
}

.stretch-toggle input[type="checkbox"]:checked + .stretch-dot {
  background: #333;
}

.stretch-chars {
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
}

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

.typo-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0.9rem 0 0.35rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid #ccc;
}

.typo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

.typo-name {
  font-size: 0.82rem;
  min-width: 120px;
  flex-shrink: 0;
}

.typo-field {
  display: flex;
  flex-direction: column;
  font-size: 0.7rem;
  font-weight: 600;
  gap: 0.2rem;
}

.typo-input {
  width: 68px;
  padding: 0.25rem 0.35rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
}

.typo-input:focus {
  outline: none;
  border-color: #333;
}

/* ── H1 page background color rows ── */
.h1-bg-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #eee;
}

.h1-bg-label {
  font-size: 0.82rem;
  font-style: italic;
  min-width: 160px;
  flex-shrink: 0;
}

/* ── Style Rows (Typeface & Style per element) ── */
.style-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

.style-label {
  font-size: 0.82rem;
  min-width: 88px;
  flex-shrink: 0;
}

.style-select {
  width: 150px;
  padding: 0.25rem 0.35rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: inherit;
}

.style-select:focus {
  outline: none;
  border-color: #333;
}

.style-upper-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  gap: 0.2rem;
  cursor: pointer;
  user-select: none;
}

.style-upper-label input[type="checkbox"] {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: #333;
}

/* ── Markdown hint tags ── */
.md {
  display: block;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 0.65em;
  opacity: 0.45;
  margin-top: 0.1em;
}

/* ── Error ── */
.error-msg {
  display: none;
  padding: 0.75rem;
  border: 2px solid #333;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}

.error-msg.visible {
  display: block;
}
