/* build.css — Build modal and button styles */

/* ── Build button (top-right, gold) ───────────────── */

#btn-build {
  position: fixed;
  top: 8px;
  right: 16px;
  z-index: 800;
  height: 30px;
  padding: 0 14px;
  border: 1px solid #b8860b;
  border-radius: 6px;
  background: linear-gradient(135deg, #c8961e 0%, #e6b422 50%, #c8961e 100%);
  color: #1a1a1a;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(200, 150, 30, 0.25);
}

#btn-build:hover {
  box-shadow: 0 4px 16px rgba(200, 150, 30, 0.4);
  transform: translateY(-1px);
}

#btn-build:active {
  transform: translateY(0);
}

#btn-build svg {
  flex-shrink: 0;
}

/* ── Modal overlay ────────────────────────────────── */

#build-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
}

#build-overlay.visible {
  display: flex;
}

/* ── Modal ────────────────────────────────────────── */

#build-modal {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  width: 520px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  padding: 24px;
}

/* ── Modal header ─────────────────────────────────── */

.build-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.build-header h2 {
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #e6b422;
  margin: 0;
}

.build-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
}

.build-close:hover {
  background: #2a2a2a;
  color: #fff;
}

/* ── Drop zone ────────────────────────────────────── */

.build-dropzone {
  border: 2px dashed #444;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
}

.build-dropzone:hover,
.build-dropzone.drag-over {
  border-color: #e6b422;
  background: rgba(230, 180, 34, 0.04);
}

.build-dropzone-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.build-dropzone-label {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}

.build-dropzone-label span {
  color: #e6b422;
  font-weight: 600;
}

/* ── File list ────────────────────────────────────── */

.build-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.build-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #252525;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #ccc;
}

.build-file-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.build-file-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-file-remove {
  border: none;
  background: transparent;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.1s;
}

.build-file-remove:hover {
  color: #f87171;
}

/* ── Prompt input ─────────────────────────────────── */

.build-prompt {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  resize: vertical;
  background: #252525;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  color: #ccc;
  line-height: 1.5;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}

.build-prompt::placeholder {
  color: #666;
}

.build-prompt:focus {
  outline: none;
  border-color: #e6b422;
}

/* ── Build button ─────────────────────────────────── */

.build-submit {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #c8961e 0%, #e6b422 50%, #c8961e 100%);
  color: #1a1a1a;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.build-submit:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(200, 150, 30, 0.3);
}

.build-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Progress area ────────────────────────────────── */

.build-progress {
  margin-top: 16px;
  display: none;
}

.build-progress.active {
  display: block;
}

.build-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.build-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #888;
  line-height: 1.4;
  padding: 3px 0;
}

.build-step-icon {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.build-step.active {
  color: #ccc;
}

.build-step.active .build-step-icon {
  animation: build-blink 1s ease-in-out infinite;
}

@keyframes build-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Scrollbar ────────────────────────────────────── */

.build-steps::-webkit-scrollbar {
  width: 4px;
}

.build-steps::-webkit-scrollbar-track {
  background: transparent;
}

.build-steps::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}

/* ── Phase tracker ────────────────────────────────── */

.build-phase-tracker {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}

.build-phase {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.build-phase.active,
.build-phase.done,
.build-phase.error {
  opacity: 1;
}

.build-phase-indicator {
  width: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2px;
  flex-shrink: 0;
}

.build-phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #444;
  transition: background 0.3s, box-shadow 0.3s;
}

.build-phase.active .build-phase-dot {
  background: #e6b422;
  box-shadow: 0 0 8px rgba(230, 180, 34, 0.6);
  animation: build-pulse 1.5s ease-in-out infinite;
}

.build-phase.done .build-phase-dot {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.build-phase.error .build-phase-dot {
  background: #ef4444;
}

@keyframes build-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(230, 180, 34, 0.6); }
  50% { box-shadow: 0 0 16px rgba(230, 180, 34, 0.9); }
}

.build-phase-info {
  min-width: 0;
  flex: 1;
}

.build-phase-label {
  font-size: 12px;
  font-weight: 600;
  color: #ccc;
  line-height: 1.3;
}

.build-phase-detail {
  font-size: 11px;
  color: #666;
  line-height: 1.3;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-phase.done .build-phase-detail {
  color: #888;
}

.build-phase.active .build-phase-detail {
  color: #aaa;
}

/* ── Section cards ────────────────────────────────── */

#build-section-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.build-section-card {
  background: #252525;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.3s, background 0.3s;
}

.build-section-card.writing {
  border-color: #e6b422;
  background: #2a2518;
}

.build-section-card.done {
  border-color: #22c55e;
  background: #1a2a1a;
}

.build-section-card.error {
  border-color: #ef4444;
  background: #2a1a1a;
}

.build-section-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.build-section-card-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #333;
  color: #888;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.build-section-card.writing .build-section-card-num {
  background: #e6b422;
  color: #1a1a1a;
}

.build-section-card.done .build-section-card-num {
  background: #22c55e;
  color: #1a1a1a;
}

.build-section-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #ccc;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-section-card-status {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.build-section-card.writing .build-section-card-status {
  color: #e6b422;
}

.build-section-card.done .build-section-card-status {
  color: #22c55e;
}

.build-section-card.error .build-section-card-status {
  color: #ef4444;
}

.build-section-card-bar {
  height: 3px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.build-section-card-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.6s ease;
  background: #444;
}

.build-section-card.writing .build-section-card-fill {
  background: #e6b422;
  animation: build-bar-shimmer 1.5s ease-in-out infinite;
}

.build-section-card.done .build-section-card-fill {
  background: #22c55e;
}

.build-section-card.error .build-section-card-fill {
  background: #ef4444;
}

@keyframes build-bar-shimmer {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.build-section-card-meta {
  font-size: 11px;
  color: #666;
}

.build-section-card.done .build-section-card-meta {
  color: #888;
}

/* ── Overall progress bar ─────────────────────────── */

.build-overall-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.build-progress-bar {
  flex: 1;
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
}

.build-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #c8961e, #e6b422);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.build-progress-label {
  font-size: 11px;
  color: #888;
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}
