﻿/* ============================================================
   jobcard.css - live status card shown after submission
   ============================================================ */

.job-card {
  display: none;
  animation: slideUp 0.32s var(--ease-out);
}

.job-card.show { display: block; }

/* ?? Panel ?? */
.job-inner {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 17px;
  position: relative;
  overflow: hidden;
}

/* top shimmer line */
.job-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.09), transparent);
}

/* ?? Layout ?? */
.job-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

/* coloured icon badge */
.job-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 13px;
}

.job-icon.processing { background: rgba(96,165,250,0.1);  border: 1px solid rgba(96,165,250,0.22); }
.job-icon.done       { background: rgba(52,211,153,0.1);  border: 1px solid rgba(52,211,153,0.25); }
.job-icon.failed     { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.25); }

.job-body { flex: 1; min-width: 0; }

/* ?? Text ?? */
.job-status {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.job-status .s-processing { color: var(--blue);  }
.job-status .s-done       { color: var(--green); }
.job-status .s-failed     { color: var(--red);   }

.job-detail {
  font-size: 11.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-detail:empty { display: none; }

/* ?? Progress row ?? */
.job-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding-top: 0;
  border-top: none;
}

.job-spinner {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border: 1.5px solid rgba(139,92,246,0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.progress-text {
  font-size: 11.5px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ?? Error ?? */
.err-msg {
  font-size: 12px;
  color: var(--red);
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ?? Download button ?? */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  margin-top: 11px;
  background: var(--button-bg);
  color: #fff;
  border: 1px solid var(--button-border);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  letter-spacing: 0;
  transition: all 0.18s var(--ease-out);
  box-shadow: var(--button-shadow);
  outline: none;
}

.download-btn:hover {
  transform: translateY(-2px);
  background: var(--button-bg-hover);
  box-shadow: var(--button-shadow-hover);
}

.download-btn:active { transform: translateY(0); }

.download-btn:focus-visible {
  box-shadow: var(--button-shadow), var(--button-focus);
}

/* Result state inside the fixed-height main card */
.result-preview-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.1);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
    rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 16px 42px rgba(0,0,0,0.3) inset;
}

.result-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.complete-copy {
  text-align: center;
  display: grid;
  gap: 4px;
}

.complete-kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.complete-title {
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
}

.complete-meta {
  min-height: 17px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.complete-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.complete-actions .download-btn {
  margin-top: 0;
  justify-content: center;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.18s var(--ease-out), transform 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}

.secondary-action:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

.secondary-action:focus-visible {
  outline: none;
  box-shadow: var(--button-focus);
}

@media (max-width: 480px) {
  .complete-actions {
    grid-template-columns: 1fr;
  }

  .complete-title {
    font-size: 17px;
  }
}
