/**
 * Renderer Styles — ported from MCP-SuperAssistant
 * CSS for function call blocks, execute buttons, results panels
 */

export const styles = `
/* ── Function Block Container ── */
.function-block {
  position: relative;
  margin: 8px 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(30, 30, 40, 0.95), rgba(20, 20, 30, 0.98));
  border: 1px solid rgba(255, 109, 90, 0.15);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #e4e4e7;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.function-block:hover {
  border-color: rgba(255, 109, 90, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 109, 90, 0.1);
}

/* ── Header ── */
.function-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 109, 90, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.function-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff6d5a, #ff9a44);
  color: white;
  font-size: 12px;
  flex-shrink: 0;
}

.function-name {
  font-size: 13px;
  font-weight: 600;
  color: #ff8a65;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.function-status {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.function-status.streaming {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  animation: pulse 1.5s infinite;
}

.function-status.complete {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

/* ── Parameters ── */
.function-params {
  padding: 10px 14px;
}

.param-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.param-row:last-child {
  border-bottom: none;
}

.param-name {
  color: #60a5fa;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-weight: 500;
  min-width: 100px;
  flex-shrink: 0;
}

.param-value {
  color: rgba(255, 255, 255, 0.7);
  word-break: break-word;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 150px;
}

/* ── Buttons ── */
.function-buttons {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.execute-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  background: linear-gradient(135deg, #ff6d5a, #ff9a44);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.execute-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 109, 90, 0.3);
}

.execute-button:active {
  transform: scale(0.97);
}

.execute-button:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.raw-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.raw-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

/* ── Results Panel ── */
.function-results-panel {
  margin: 8px 14px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  max-height: 200px;
  overflow: auto;
}

.function-results-panel.success {
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(34, 197, 94, 0.05);
}

.function-results-panel.error {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-weight: 600;
}

.result-header.success { color: #22c55e; }
.result-header.error { color: #ef4444; }

.result-content {
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
}

/* ── Spinner ── */
.execute-spinner {
  display: inline-flex;
  align-items: center;
}

.execute-spinner svg {
  animation: spin 0.8s linear infinite;
}

/* ── Animations ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.function-block {
  animation: slideIn 0.3s ease;
}

/* ── Scrollbar ── */
.function-results-panel::-webkit-scrollbar,
.param-value::-webkit-scrollbar {
  width: 4px;
}
.function-results-panel::-webkit-scrollbar-track,
.param-value::-webkit-scrollbar-track {
  background: transparent;
}
.function-results-panel::-webkit-scrollbar-thumb,
.param-value::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ── Light mode ── */
@media (prefers-color-scheme: light) {
  .function-block {
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    border-color: rgba(255, 109, 90, 0.15);
    color: #1a1a1a;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  }
  .function-header {
    background: rgba(255, 109, 90, 0.04);
    border-bottom-color: rgba(0, 0, 0, 0.06);
  }
  .param-name { color: #2563eb; }
  .param-value { color: rgba(0, 0, 0, 0.7); }
  .function-results-panel {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
  }
  .raw-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.5);
  }
}
`
