/* CSS Variables */
:root {
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-tertiary: #2d2d2d;
  --bg-hover: #353535;
  --bg-active: #404040;

  --border-color: #3d3d3d;
  --border-light: #4a4a4a;

  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-yellow: #eab308;
  --accent-purple: #a855f7;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --header-height: 52px;
  --toolbar-height: 44px;
  --controls-height: 56px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow: hidden;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 20px;
}

.header-left h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-center {
  display: flex;
  align-items: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}

.status-indicator.recording .status-dot {
  background: var(--accent-red);
  animation: pulse 1s infinite;
}

.status-indicator.playing .status-dot {
  background: var(--accent-blue);
  animation: pulse 1.5s infinite;
}

.status-indicator.loading .status-dot {
  background: var(--accent-yellow);
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Main Content */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Browser Panel */
.browser-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 400px;
  background: var(--bg-secondary);
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--toolbar-height);
  padding: 0 12px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.browser-nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.url-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.url-icon {
  font-size: 12px;
  color: var(--accent-green);
}

.url-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  outline: none;
}

.url-bar input::placeholder {
  color: var(--text-muted);
}

.go-btn {
  padding: 4px 12px;
  background: var(--accent-blue);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.go-btn:hover {
  background: var(--accent-blue-hover);
}

/* Browser Viewport */
.browser-viewport {
  flex: 1;
  position: relative;
  background: var(--bg-primary);
  overflow: hidden;
}

.browser-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.browser-placeholder.hidden {
  display: none;
}

.placeholder-content {
  text-align: center;
}

.placeholder-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.placeholder-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.placeholder-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.launch-btn {
  padding: 12px 24px;
  background: var(--accent-blue);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.launch-btn:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
}

.browser-screenshot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.browser-screenshot.visible {
  display: block;
}

/* Browser Controls */
.browser-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--controls-height);
  padding: 0 12px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.control-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.control-btn .btn-icon {
  font-size: 16px;
}

.control-btn.record-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.control-btn.stop-btn {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

.control-btn.stop-btn:hover {
  background: #dc2626;
}

.action-counter {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

.counter-label {
  color: var(--text-secondary);
}

.counter-value {
  color: var(--accent-blue);
  font-weight: 600;
}

/* Panel Divider */
.panel-divider {
  width: 4px;
  background: var(--border-color);
  cursor: col-resize;
  transition: background 0.15s;
}

.panel-divider:hover {
  background: var(--accent-blue);
}

/* Chat Panel */
.chat-panel {
  display: flex;
  flex-direction: column;
  width: 400px;
  min-width: 300px;
  max-width: 600px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.chat-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.clear-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.clear-chat-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: fadeIn 0.2s ease;
}

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.message-avatar.agent {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.message-avatar.user {
  background: var(--bg-tertiary);
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.message-time {
  font-size: 12px;
  color: var(--text-muted);
}

.message-text {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
  word-wrap: break-word;
}

.message-text code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.message-action-btn {
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.message-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Action Notification */
.action-notification {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.action-notification .action-type {
  color: var(--accent-blue);
  font-weight: 500;
}

.action-notification .action-selector {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* Chat Input */
.chat-input-container {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.quick-action-btn {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.chat-input-wrapper:focus-within {
  border-color: var(--accent-blue);
}

.chat-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  resize: none;
  outline: none;
  max-height: 120px;
}

.chat-input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-blue);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: all 0.15s;
}

.send-btn:hover {
  background: var(--accent-blue-hover);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-content.modal-small {
  max-width: 400px;
}

.modal-content.modal-large {
  max-width: 700px;
}

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

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

.modal-close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent-blue);
  border: none;
  color: white;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--accent-red);
  border: none;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-blue);
}

/* Recordings List */
.recordings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recording-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.recording-item:hover {
  border-color: var(--border-light);
}

.recording-thumbnail {
  width: 80px;
  height: 60px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.recording-info {
  flex: 1;
  min-width: 0;
}

.recording-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.recording-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.recording-actions {
  display: flex;
  gap: 8px;
}

.recording-action-btn {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.recording-action-btn:hover {
  background: var(--bg-hover);
}

.recording-action-btn.play-btn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.recording-action-btn.edit-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.recording-action-btn.delete-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Actions List (Edit Modal) */
.actions-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

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

.action-step {
  width: 24px;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.action-details {
  flex: 1;
  min-width: 0;
}

.action-type-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-blue);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: white;
  margin-bottom: 4px;
}

.action-selector-input {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  outline: none;
}

.action-selector-input:focus {
  border-color: var(--accent-blue);
}

.action-delete-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.action-delete-btn:hover {
  background: var(--accent-red);
  color: white;
}

/* Variables List */
.variables-list {
  margin-bottom: 12px;
}

.variable-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.variable-item input {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.add-variable-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.add-variable-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--accent-blue);
  color: white;
}

.mode-btn .mode-icon {
  font-size: 16px;
}

/* Sidebar Panel */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  width: 360px;
  min-width: 280px;
  max-width: 500px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
}

/* Manual Mode Panel */
.manual-mode-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Training Controls */
.training-controls {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.training-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.training-btn .btn-icon {
  font-size: 16px;
}

.training-btn.start-btn {
  background: linear-gradient(135deg, var(--accent-green), #16a34a);
  color: white;
}

.training-btn.start-btn:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.training-btn.stop-btn {
  background: linear-gradient(135deg, var(--accent-red), #dc2626);
  color: white;
}

.training-btn.stop-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Training Status */
.training-status {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-red);
  font-weight: 600;
  font-size: 16px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.step-count {
  color: var(--text-secondary);
  font-size: 14px;
}

.captured-steps {
  max-height: 200px;
  overflow-y: auto;
}

.captured-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-number {
  width: 22px;
  height: 22px;
  background: var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.step-number.completed {
  background: var(--accent-green);
}

.step-info {
  flex: 1;
  min-width: 0;
}

.step-type {
  font-weight: 500;
  color: var(--text-primary);
  text-transform: capitalize;
}

.step-target {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Saved Paths Section */
.saved-paths-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.refresh-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.saved-paths-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.path-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.path-item:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.path-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.path-icon {
  font-size: 18px;
}

.path-info {
  flex: 1;
  min-width: 0;
}

.path-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Apply Button */
.apply-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-green);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.apply-btn:hover {
  background: #2ea043;
  transform: translateY(-1px);
}

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

.apply-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.apply-btn.running {
  background: var(--accent-blue);
}

.apply-btn.success {
  background: var(--accent-green);
}

.apply-btn.error {
  background: var(--accent-red);
}

.apply-icon {
  font-size: 10px;
}

.apply-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.path-actions {
  display: flex;
  gap: 8px;
  padding-left: 28px;
}

.path-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.path-action-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.path-action-btn.edit:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.path-action-btn.delete:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.path-action-btn.chat {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: white;
}

.path-action-btn.chat:hover {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

/* Modified Path Message Styles */
.apply-modified-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent-green);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.apply-modified-btn:hover {
  background: #2ea043;
  transform: translateY(-1px);
}

.apply-modified-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.apply-modified-btn.success {
  background: var(--accent-green);
}

/* Save Modified Button */
.save-modified-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent-blue);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.save-modified-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.save-modified-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.save-modified-btn.success {
  background: var(--accent-green);
}

.message-action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 14px;
}

.message-action-btn.secondary:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.action-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 8px;
  border-radius: var(--radius-sm);
  display: block;
  margin-top: 4px;
}

/* Agent Mode Panel */
.agent-mode-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Add Step Button */
.add-step-btn {
  float: right;
  padding: 4px 10px;
  background: var(--accent-blue);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.add-step-btn:hover {
  background: var(--accent-blue-hover);
}

/* Form Select */
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.form-group select:focus {
  border-color: var(--accent-blue);
}

.form-group select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Empty Paths State */
.empty-paths {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-paths-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-paths-text {
  color: var(--text-muted);
  font-size: 14px;
}
