/* ============================
   TUNLEY — Models/Agent Panel Styles
   ============================ */

/* Agent Panel */
.agent-panel {
  border-top: 1px solid var(--tunley-border);
  background: var(--tunley-sidebar);
  max-height: 350px;
  overflow-y: auto;
  display: none;
  min-width: 0;
  width: 100%;
}

.agent-panel.visible {
  display: block;
}

.agent-panel-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tunley-border);
  font-size: 13px;
  font-weight: 600;
}

.agent-panel-header .agent-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-panel-header .agent-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tunley-text-muted);
}

.agent-panel-header .agent-status .status-dot.running {
  background: var(--tunley-green);
  animation: pulse 1.5s infinite;
}

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

.agent-panel-header .agent-status .status-dot.error {
  background: var(--tunley-red);
}

.agent-panel-body {
  padding: 12px 16px;
}

.agent-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--tunley-border);
  font-size: 13px;
}

.agent-step-item:last-child {
  border-bottom: none;
}

.agent-step-item .step-status {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  margin-top: 1px;
}

.agent-step-item .step-status.pending {
  background: var(--tunley-surface-2);
  color: var(--tunley-text-muted);
}

.agent-step-item .step-status.running {
  background: rgba(245, 158, 11, 0.15);
  color: var(--tunley-amber);
  animation: spin 1s linear infinite;
  border: 2px solid var(--tunley-amber);
  border-top-color: transparent;
}

.agent-step-item .step-status.done {
  background: var(--tunley-success-bg);
  color: var(--tunley-green);
}

.agent-step-item .step-status.failed {
  background: var(--tunley-danger-bg);
  color: var(--tunley-red);
}

.agent-step-item .step-info {
  flex: 1;
}

.agent-step-item .step-info .step-title {
  font-weight: 500;
  margin-bottom: 2px;
}

.agent-step-item .step-info .step-desc {
  font-size: 12px;
  color: var(--tunley-text-muted);
}

.agent-step-item .step-info .step-result {
  font-size: 12px;
  color: var(--tunley-text-muted);
  margin-top: 4px;
  padding: 6px 8px;
  background: var(--tunley-surface);
  border-radius: var(--radius-sm);
  max-height: 80px;
  overflow-y: auto;
}

/* Stop Agent Button */
.stop-agent-btn {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: var(--tunley-danger-bg);
  color: var(--tunley-red);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.stop-agent-btn:hover {
  border-color: var(--tunley-red);
}

/* Sandbox File Tree */
.sandbox-files {
  margin-top: 8px;
  padding: 8px;
  background: var(--tunley-surface);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.sandbox-files .file-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.sandbox-files .file-entry:hover {
  background: var(--tunley-surface-2);
}

.sandbox-files .file-entry .file-icon {
  font-size: 14px;
}

.sandbox-files .file-entry .file-name {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

/* Profile Panel */
.profile-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: var(--tunley-sidebar);
  border-left: 1px solid var(--tunley-border);
  z-index: 100;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.profile-panel.open {
  right: 0;
}

.profile-panel-header {
  padding: 20px;
  border-bottom: 1px solid var(--tunley-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-panel-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.profile-panel-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--tunley-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 16px;
}

.profile-section {
  margin-bottom: 24px;
}

.profile-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--tunley-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.profile-field {
  margin-bottom: 12px;
}

.profile-field label {
  display: block;
  font-size: 12px;
  color: var(--tunley-text-muted);
  margin-bottom: 4px;
}

.profile-field .field-value {
  font-size: 14px;
  font-weight: 500;
}
