/* ========== XECUTE — css/04-preview-status-footer.css ========== */
/* Preview pane, status bar, footer */

/* ====== PREVIEW CONTAINER ====== */
#preview-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 80px;
  background: var(--bg-secondary);
  overflow: hidden;
  position: relative;
}

/* Preview Toolbar */
#preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--toolbar-h);
  padding: 0 8px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#preview-label {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.preview-toolbar-actions button {
  height: 26px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  transition: background 0.12s, color 0.12s;
}
.preview-toolbar-actions button:hover { background: var(--bg-hover); color: var(--text-primary); }

#runBtn {
  background: var(--accent-green) !important;
  color: white !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 0 12px !important;
  border-radius: 4px !important;
  gap: 5px !important;
  height: 26px !important;
  animation: none;
}
#runBtn:hover { background: #2ea043 !important; filter: brightness(1.1); }
#runBtn.running { background: var(--accent-orange) !important; }

#stopRunBtn {
  background: var(--accent-red, #f85149) !important;
  color: white !important;
  border-radius: 4px !important;
  height: 26px !important;
}
#stopRunBtn:hover { filter: brightness(1.15); }

#rerunLastBtn {
  color: var(--accent, #58a6ff) !important;
  border-radius: 4px !important;
  height: 26px !important;
}
#rerunLastBtn:hover { background: var(--bg-hover); }

/* Preview Input Panel (shows in preview area) */
#previewInputPanel {
  position: absolute;
  top: var(--toolbar-h);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--accent);
  padding: 12px 16px;
  z-index: 20;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.input-panel-header {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
}
#previewInputArea {
  width: 100%;
  padding: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  resize: vertical;
  outline: none;
  margin-bottom: 8px;
}
#previewInputArea:focus { border-color: var(--accent); }
.input-panel-actions { display: flex; gap: 6px; }

#preview {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: none;
  background: white;
  display: block;
}

/* ====== STATUS BAR ====== */
#statusBar {
  height: var(--statusbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}
.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
}
.save-indicator { margin-left: 4px; }
.save-indicator.saving i { color: var(--accent-orange); animation: pulse 1s infinite; }
.save-indicator.saved i { color: var(--accent-green); }
.save-indicator.error i { color: var(--accent-red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ====== FOOTER ====== */
footer {
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
  /* Always anchor footer to the bottom */
  position: sticky;
  bottom: 0;
  z-index: 40;
}
.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 2px;
}
footer button {
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
footer button:hover { background: var(--bg-hover); color: var(--text-primary); }
footer button i { font-size: 13px; }
footer button span { font-size: 11px; }

.footer-center {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}
.footer-center a { color: var(--accent); text-decoration: none; }
.footer-center a:hover { text-decoration: underline; }
