/* 
 * PowerOn | Multi-Agent Service - Chat Component Styles
 * Styles for chat messages and interaction
 * CSS Variables sind in styles_variables.css definiert
 */

/* Workflow Dashboard Styles */
.workflow-dashboard {
    background: var(--color-primary);
    border-radius: 25px;
    margin-bottom: 1rem;
    padding: 1rem;
    color: var(--color-bg);
    box-shadow: inset 0 0 0 1px rgba(199,197,178,.15), 0 0 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(199,197,178,.15);
    font-family: var(--font-family);
}

.dashboard-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    font-family: var(--font-family);
    color: var(--color-bg);
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-tasks {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.dashboard-task {
    background: var(--color-bg);
    border-radius: 15px;
    padding: 0.75rem;
    min-width: 120px;
    text-align: center;
    border: 2px solid var(--color-primary);
    transition: all 0.3s ease;
    font-family: var(--font-family);
    color: var(--color-text);
}

.dashboard-task.active {
    border-color: var(--color-blue);
    background: var(--color-blue-disabled);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.3);
}

.dashboard-task.completed {
    border-color: var(--color-green);
    background: var(--color-green-disabled);
}

.task-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.task-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.task-actions.empty {
    font-size: 0.75rem;
    opacity: 0.7;
    font-style: italic;
}

.dashboard-action {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
}

.dashboard-action.active {
    background: #ffd700;
    color: #1f2937;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.dashboard-action.completed {
    background: #4ade80;
    color: white;
}

.action-pulse {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid #ffd700;
    animation: pulse 4s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.dashboard-empty {
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}

/* New Dashboard Elements for Progress Display */
.dashboard-round {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.task-progress, .action-progress {
    text-align: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.task-progress-bar, .action-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-highlight-gray);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.task-progress-fill, .action-progress-fill {
    height: 100%;
    background: var(--color-blue);
    border-radius: 15px;
    transition: width 0.5s ease;
}

/* Task and Action Indicators */
.task-indicators, .action-indicators {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.task-indicator, .action-indicator {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s ease;
}

.task-indicator {
    background: var(--color-highlight-gray);
    border: 2px solid var(--color-primary);
    color: var(--color-text);
    font-family: var(--font-family);
}

.action-indicator {
    background: var(--color-highlight-gray);
    border: 2px solid var(--color-primary);
    color: var(--color-text);
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.8rem;
    font-family: var(--font-family);
}

.task-indicator.active, .action-indicator.active {
    background: var(--color-blue);
    border-color: var(--color-blue);
    color: var(--color-bg);
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

.task-indicator.completed, .action-indicator.completed {
    background: var(--color-green);
    border-color: var(--color-green);
    color: var(--color-bg);
}

.action-pulse {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid var(--color-blue);
    animation: pulse 4s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.dashboard-actions {
    margin-top: 0.5rem;
}

/* Message Indentation Styles */
.message-entry.message-indent-level-1 {
    margin-left: 2rem;
    border-left: 3px solid var(--color-blue);
    padding-left: 1rem;
}

.message-entry.message-indent-level-2 {
    margin-left: 4rem;
    border-left: 3px solid var(--color-primary);
    padding-left: 1rem;
}

/* Message Header Enhancements */
.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.message-time {
    color: var(--color-gray);
    font-size: 0.75rem;
    white-space: nowrap;
    font-family: var(--font-family);
}

.message-round,
.message-task,
.message-action {
    background: var(--color-highlight-gray);
    color: var(--color-text);
    padding: 0.2rem 0.5rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    font-family: var(--font-family);
}

.message-round {
    background: var(--color-primary);
    color: var(--color-bg);
}

.message-task {
    background: var(--color-blue-disabled);
    color: var(--color-blue);
}

.message-action {
    background: var(--color-primary);
    color: var(--color-bg);
}

/* Markdown Content Styles */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 0.5rem 0;
    color: #1f2937;
}

.message-content h1 {
    font-size: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.message-content h2 {
    font-size: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

.message-content h3 {
    font-size: 1.1rem;
}

.message-content strong {
    font-weight: 600;
    color: #1f2937;
}

.message-content em {
    font-style: italic;
    color: #4b5563;
}

.message-content code {
    background: #f3f4f6;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #dc2626;
}

.message-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.message-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.message-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin: 0.25rem 0;
}

/* Workflow Chat Styles */
.chat-section {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.chat-columns {
  display: flex;
  height: 100%;
}

.chat-left {
  width: 70%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  height: 100%;
  overflow: hidden;
}

.chat-right {
  width: 30%;
  height: 100%;
  overflow: hidden;
}

/* Unified Content Area - New unified rendering area for logs and messages */
.unified-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.unified-content-area::-webkit-scrollbar {
  width: 8px;
}

.unified-content-area::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.unified-content-area::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.unified-content-area::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Unified content items - general compactness */
.unified-item {
  padding: 0.25rem 0.5rem;
  border-radius: 0.2rem;
  margin-bottom: 0.15rem;
  border-left: 2px solid transparent;
  min-height: 0; /* Allow items to shrink */
  flex-shrink: 0; /* Prevent items from shrinking in flex container */
}

/* Special handling for message entries with grid layout */
.unified-item.message-entry {
  padding: 0; /* Remove padding for message entries since grid handles its own spacing */
}

/* New 4-column grid layout for messages */
.unified-item.message-entry .message-grid {
  display: grid;
  grid-template-columns: 4% 120px 1fr 300px; /* Increased documents column from 200px to 300px (50% wider) */
  gap: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-height: 0; /* Allow grid to shrink */
  flex-shrink: 0; /* Prevent grid from shrinking in flex container */
}

/* Left column - 4% width, empty for action messages, filled for visual indentation */
.message-left {
  border-right: 1px solid #e2e8f0;
}

.message-left.action-message {
  /* Empty for action messages - no background */
  background: transparent;
}

.message-left.non-action-message {
  background: #f8fafc; /* Same background as metadata column for visual indentation */
}

/* Metadata column */
.message-metadata {
  padding: 0.75rem 0.5rem;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}

.metadata-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.metadata-item i {
  width: 12px;
  text-align: center;
  color: #9ca3af;
}

.metadata-timestamp {
  font-family: monospace;
  font-size: 0.7rem;
}

.metadata-round {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-weight: 500;
}

.metadata-task {
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-weight: 500;
}

.metadata-action {
  background: #f3e8ff;
  color: #7c3aed;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-weight: 500;
}

/* Content column for new layout */
.unified-item.message-entry .message-grid .message-content {
  padding: 0.75rem;
  background: white;
  border-right: 1px solid #e2e8f0;
}

/* Files column for new layout */
.unified-item.message-entry .message-grid .message-files {
  padding: 0.75rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.unified-item.message-entry .message-grid .file-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  transition: all 0.2s ease;
  min-height: auto; /* Allow flexible height */
  height: auto; /* Allow flexible height */
  position: relative;
  overflow: hidden;
}

.unified-item.message-entry .message-grid .file-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4, #10b981);
  background-size: 200% 100%;
  animation: gradient-shift 3s ease-in-out infinite;
}

.unified-item.message-entry .message-grid .file-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  transition: all 0.2s ease;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.file-header {
  display: flex;
  align-items: flex-start; /* Align to top to handle multi-line filenames */
  gap: 0.5rem;
  min-height: auto; /* Allow flexible height */
}

.file-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none; /* Remove colored background */
  border-radius: 6px;
  color: #6b7280; /* Use neutral gray color instead of white */
  font-size: 0.8rem;
  flex-shrink: 0; /* Prevent icon from shrinking */
  margin-top: 0.1rem; /* Slight top margin to align with first line of text */
  transition: all 0.2s ease;
}

.file-icon:hover {
  transform: scale(1.1);
  color: #374151; /* Darker gray on hover */
}

.unified-item.message-entry .message-grid .file-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
  word-break: break-word; /* Break at underscores and spaces */
  overflow-wrap: anywhere; /* Allow breaking anywhere if needed */
  line-height: 1.2;
  white-space: normal; /* Allow text to wrap */
  overflow: visible; /* Show full text */
  text-overflow: unset; /* No ellipsis */
  min-height: auto; /* Allow flexible height */
  max-width: 100%; /* Ensure it doesn't exceed container */
  hyphens: auto; /* Enable automatic hyphenation */
}

.file-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6b7280;
}

.unified-item.message-entry .message-grid .file-size {
  font-family: monospace;
  color: #9ca3af;
}

.unified-item.message-entry .message-grid .file-actions {
  display: flex;
  gap: 0.25rem;
}

.file-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6b7280;
  font-size: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.file-action-btn:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #374151;
}

/* All action buttons use the same base styling with consistent colors */
.file-action-btn.download,
.file-action-btn.copy,
.file-action-btn.preview {
  background: #f8fafc;
  color: #6b7280;
  border: 1px solid #e2e8f0;
}

.file-action-btn.download:hover,
.file-action-btn.copy:hover,
.file-action-btn.preview:hover {
  background: #e2e8f0;
  color: #374151;
  border-color: #cbd5e1;
}

/* Responsive design for new layout */
@media (max-width: 768px) {
  .unified-item.message-entry .message-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .message-left {
    display: none; /* Hide the 4% column on mobile */
  }

  .message-metadata {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .unified-item.message-entry .message-grid .message-content {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .unified-item.message-entry .message-grid .message-files {
    border-top: 1px solid #e2e8f0;
  }
}

/* Log entries in unified area */
.unified-item.log-entry {
  background-color: transparent; /* No background */
  border-left-color: #64748b;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: normal;
  padding: 0.02rem 0.3rem; /* Reduced vertical padding */
  margin-bottom: 0.02rem; /* Reduced bottom margin */
  text-align: left;
}

.unified-item.log-entry .log-header {
  display: flex;
  align-items: flex-start;
  gap: 0.1rem; /* Reduced gap */
  text-align: left;
  flex-wrap: wrap;
  margin-bottom: 0; /* Remove any bottom margin */
}

.unified-item.log-entry .log-time {
  color: #64748b;
  font-size: 0.75rem;
  white-space: nowrap;
}

.unified-item.log-entry .log-agent {
  color: #3b82f6;
  font-size: 0.75rem;
  white-space: nowrap;
}

.unified-item.log-entry .log-message {
  text-align: left;
  flex: 1;
  word-wrap: break-word;
  white-space: pre-line;
  line-height: 1.1;
  display: block;
  color: inherit;
  font-weight: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
  min-width: 0;
}

.unified-item.log-entry .log-message i {
  font-size: 0.7rem;
  margin-top: 0.05rem;
  flex-shrink: 0;
}

/* Log entry types - no background colors, icons show the type */
.unified-item.log-entry.log-success {
  border-left-color: #059669;
}

.unified-item.log-entry.log-error {
  border-left-color: #dc2626;
}

.unified-item.log-entry.log-warning {
  border-left-color: #d97706;
}

.unified-item.log-entry.log-info {
  border-left-color: #3b82f6;
}

/* Progress bar styling */
.log-progress-container {
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.log-progress-bar {
  flex: 1;
  height: 0.3rem;
  background-color: #e5e7eb;
  border-radius: 0.15rem;
  overflow: hidden;
}

.log-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 0.15rem;
  transition: width 0.3s ease;
}

.log-progress-text {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 500;
  min-width: 2rem;
  text-align: right;
}

.log-progress-status {
  font-size: 0.6rem;
  color: #6b7280;
  font-style: italic;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}



/* Message entries in unified area */
.unified-item.message-entry {
  background-color: #e6f0fa; /* light blue */
  border-left-color: #3b82f6;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  padding: 0.18rem 0.5rem;
  margin-bottom: 0.12rem;
}

/* Error message styling */
.unified-item.message-entry .message-content.message-error {
  background-color: #fef2f2;
  border-left: 4px solid #dc2626;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border-radius: 0.25rem;
  color: #dc2626;
  font-weight: 500;
}

/* Warning message styling */
.unified-item.message-entry .message-content.message-warning {
  background-color: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border-radius: 0.25rem;
  color: #d97706;
  font-weight: 500;
}

/* Message header and content compactness */
.unified-item.message-entry .message-header,
.unified-item.log-entry .log-header {
  margin-bottom: 0.02rem; /* Reduced margin */
  padding: 0;
  gap: 0.1rem; /* Reduced gap */
}

.unified-item.message-entry .message-content,
.unified-item.log-entry .log-message {
  margin: 0.02rem 0 0.02rem 0; /* Reduced margins */
  line-height: 1.1; /* Reduced line height for more compact text */
}

/* File item compactness */
.unified-item.message-entry .file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.15rem 0.25rem;
  background-color: #f8fafc;
  border-radius: 0.12rem;
  margin-bottom: 0.04rem;
  font-size: 0.75rem;
  min-height: 2.2rem;
  height: 2.2rem;
  word-wrap: break-word;
  word-break: break-all;
}

/* Removed old file-info structure - now using file-header/file-footer structure */

/* Removed old conflicting CSS rules - now using new file-header/file-footer structure */

/* Removed conflicting rule - now handled by .unified-item.message-entry .message-grid .file-name */

.unified-item.message-entry .file-item .file-size {
  font-size: 0.65rem;
  line-height: 2.2rem;
  color: #6b7280;
  white-space: nowrap;
  margin-left: 0.5rem;
  font-family: monospace;
  flex-shrink: 0;
  min-width: 3rem;
  text-align: right;
}

.unified-item.message-entry .file-item .file-actions {
  gap: 0.04rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.unified-item.message-entry .file-item .preview-action-btn {
  padding: 0.04rem 0.08rem;
  font-size: 0.7rem;
  height: 2.2rem;
  width: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.unified-item.message-entry .file-item .preview-action-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 0.08rem;
}

/* Workflow completion indicator in unified area */
.unified-item.workflow-completion-indicator {
  background-color: #f0fdf4;
  border-left-color: #10b981;
  text-align: center;
  padding: 1rem;
}

.unified-item.workflow-completion-indicator.completion-success {
  background-color: #f0fdf4;
  border-left-color: #10b981;
}

.unified-item.workflow-completion-indicator.completion-error {
  background-color: #fef2f2;
  border-left-color: #dc2626;
}

.unified-item.workflow-completion-indicator.completion-warning {
  background-color: #fffbeb;
  border-left-color: #d97706;
}

.unified-item.workflow-completion-indicator .completion-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
}

.unified-item.workflow-completion-indicator.completion-success .completion-content {
  color: var(--color-green);
}

.unified-item.workflow-completion-indicator.completion-error .completion-content {
  color: var(--color-red);
}

.unified-item.workflow-completion-indicator.completion-warning .completion-content {
  color: var(--color-secondary);
}

.unified-item.workflow-completion-indicator.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.message {
  margin-bottom: 1rem;
  max-width: 80%;
}

.message.user {
  margin-left: auto;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 25px;
  font-size: 0.875rem;
  line-height: 1.5;
  font-family: var(--font-family);
}

.message.user .message-content {
  background-color: var(--color-blue);
  color: var(--color-bg);
}

.message.assistant .message-content {
  background-color: var(--color-highlight-gray);
  color: var(--color-text);
}

.message-time {
  font-size: 0.75rem;
  color: var(--color-gray);
  margin-top: 0.25rem;
  font-family: var(--font-family);
}

/* Chat Input */
.chat-input {
  padding: 1rem;
  border-top: 1px solid var(--color-primary);
  background-color: var(--color-bg);
  font-family: var(--font-family);
}

.input-container {
  display: flex;
  gap: 0.5rem;
}

.message-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--color-gray-disabled);
  border-radius: 25px;
  font-size: 0.875rem;
  resize: none;
  min-height: 2.5rem;
  max-height: 10rem;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
}

.message-input:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background-color: var(--color-blue);
  color: var(--color-bg);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
  height: 50px;
}

.send-button:hover {
  background-color: var(--color-blue-hover);
}

.send-button:disabled {
  background-color: var(--color-gray-disabled);
  cursor: not-allowed;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray);
  padding: 2rem;
  font-family: var(--font-family);
}

.empty-state-content {
  text-align: center;
  font-family: var(--font-family);
}

/* Responsive Design */
@media (max-width: 992px) {
  .chat-columns {
    flex-direction: column;
  }
  
  .chat-left, .chat-right {
    width: 100%;
    border-right: none;
  }
  
  .chat-left {
    border-bottom: 1px solid #e5e7eb;
  }
  
  .message {
    max-width: 90%;
  }
}

/* Chat area header */
.chat-area-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    z-index: 10;
    position: sticky;
    top: 0;
  }
  
  .chat-area-header h3 {
    margin: 0;
  }
  
  /* Chat message types */
  .system-message {
    margin: 0.5rem auto;
    text-align: center;
    color: #6b7280;
    font-size: 0.75rem;
    font-style: italic;
    background-color: #f9fafb;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    max-width: 80%;
  }
  
  .agent-message {
    padding: 0.75rem;
    background-color: white;
    border-radius: 0.375rem;
    border-left: 3px solid #3b82f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
  
  .agent-message.user {
    border-left-color: #10b981;
    background-color: #f0fdf4;
  }
  
  /* Special styling for messages between Moderator and User Agent */
  .agent-message.moderator-to-user {
    border-left-color: #f59e0b;
    background-color: #fffbeb;
    border-width: 3px;
  }
  
  .moderator-to-user .agent-name {
    color: #b45309;
  }
  
  /* Message header */
  .message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
  }
  
  .agent-name {
    font-weight: 500;
  }
  
  .message-content {
    font-size: 0.875rem;
  }
  
  .agent-message.collapsed .message-content {
    max-height: 100px;
    overflow: hidden;
    position: relative;
  }
  
  .agent-message.collapsed .message-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, white);
  }
  
  .agent-message .toggle-content {
    text-align: center;
    color: #3b82f6;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem;
    user-select: none;
  }
  
  .agent-message .toggle-content:hover {
    text-decoration: underline;
  }
  
  /* Files in messages */
  .message-files {
    margin-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.5rem;
  }
  
  .files-heading {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.5rem;
  }
  
  .files-list {
    list-style: none;
    padding: 0;
    margin: 5px 0;
  }
  
  .file-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
    font-size: 0.8rem;
  }
  
  .file-item:hover {
    background-color: #e9e9e9;
  }
  
  .file-item i:first-child {
    margin-right: 8px;
    color: #555;
  }
  
  .file-name {
    flex: 1;
    word-wrap: break-word;
    word-break: break-all;
    margin-right: 10px;
  }
  
  .file-actions {
    display: flex;
    gap: 5px;
  }
  
  /* File preview buttons */
  .preview-action-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
    color: #6b7280;
  }
  
  .preview-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
  }
  
  .preview-action-btn i {
    font-size: 0.875rem;
  }
  
  .preview-action-btn[title="Download file"] i {
    color: #3b82f6 !important;
  }
  
  .preview-action-btn[title="Copy content"] i {
    color: #10b981 !important;
  }
  
  .preview-action-btn[title="Close preview"] i {
    color: #ef4444 !important;
  }
  
  /* File preview is now handled by modal in styles_workflow_files.css */
  
  /* Message delete button */
  .message-delete-container {
    display: none;
    margin-left: 8px;
  }
  
  .chat-message:hover .message-delete-container {
    display: block;
  }
  
  .message-delete-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s;
  }
  
  .message-delete-btn:hover {
    color: #ef4444;
  }
  
  /* User prompt area */
  .user-prompt {
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0.25rem;
    animation: fadeIn 0.3s ease;
  }
  
  .moderator-question {
    font-size: 0.95rem;
  }
  
  .moderator-question strong {
    color: #b45309;
    font-weight: 600;
  }
  
  /* Previous result */
  .previous-result {
    font-size: 0.875rem;
    line-height: 1.4;
  }
  
  .previous-result strong {
    color: #4b5563;
    margin-right: 0.25rem;
  }
  
  /* Empty chat state */
  #empty-chat-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-align: center;
    padding: 2rem;
  }
  
  #empty-chat-state i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
  }
  
  #empty-chat-state h4 {
    margin: 0.5rem 0;
    color: #4b5563;
  }
  
  #empty-chat-state p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
  }
  
  /* Animation */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* Scroll behavior */
  .chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
  }
  
  .chat-messages::-webkit-scrollbar {
    width: 6px;
  }
  
  .chat-messages::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .chat-messages::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
  }
  
  /* File preview responsive design is now handled by modal in styles_workflow_files.css */

.planning-text {
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}

/* Dashboard Container and Action Buttons */
.workflow-dashboard-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 200px; /* Ensure minimum height to prevent shrinking */
}

.workflow-dashboard-container.minimized {
    height: auto;
    min-height: 60px;
}

.workflow-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.workflow-dashboard-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.dashboard-actions {
    display: flex;
    gap: 0.5rem;
}

.dashboard-action-btn {
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.dashboard-action-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.dashboard-action-btn:active {
    background-color: #e5e7eb;
}

.workflow-dashboard-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    min-height: 0; /* Allow content to shrink if needed */
}

/* Custom scrollbar styling for webkit browsers */
.workflow-dashboard-content::-webkit-scrollbar {
    width: 6px;
}

.workflow-dashboard-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.workflow-dashboard-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.workflow-dashboard-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dashboard content styles */
.dashboard-round-compact {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: #6b7280;
    color: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: inline-block;
    max-width: 80px;
}

/* Progress text and bars removed - now shown in graphics */

.task-indicators-horizontal {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
    min-height: 60px; /* Ensure minimum height to prevent layout shifts */
}

.task-box {
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    min-width: 60px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: 500;
}

.task-box.completed {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.task-box.completed.failed {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.task-box.completed.retry {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.task-box.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    animation: task-box-pulse 3s infinite ease-in-out;
}

.task-box.pending {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

.task-label {
    font-weight: 600;
}

/* Workflow Completion Status */
.workflow-completion-status {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.workflow-completion-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.workflow-completion-status.failed {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.workflow-completion-status.stopped {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* Workflow Final Status */
.workflow-final-status {
    text-align: center;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 6px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

.workflow-final-status i {
    font-size: 1.2rem;
}

.workflow-final-status:has(i.fa-check-circle) {
    background: #f0fdf4;
    border-color: #10b981;
    color: #065f46;
}

.workflow-final-status:has(i.fa-times-circle) {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.workflow-final-status:has(i.fa-stop-circle) {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

/* Task Steps */
.task-steps {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.step-indicator {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step-indicator.completed {
    background: #10b981;
    color: white;
}

.step-indicator.active {
    background: #f59e0b;
    color: white;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.step-indicator.pending {
    background: #e5e7eb;
    color: #6b7280;
}

/* Planning Elements */
.planning-phase {
    text-align: center;
    padding: 1rem;
    color: #6b7280;
    font-style: italic;
}

.planning-phase i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #9ca3af;
}

.planning-indicator {
    text-align: center;
    padding: 1rem;
}

.planning-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #9ca3af;
    animation: planning-pulse 1.5s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes planning-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Action Indicators */
.action-indicators {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.action-indicator {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
}

.action-indicator.completed {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

.action-indicator.completed.failed {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.action-indicator.completed.retry {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.action-indicator.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    animation: active-glow 2s ease-in-out infinite alternate;
}

.action-indicator:not(.completed):not(.active) {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #6b7280;
    border: 2px solid #d1d5db;
}

@keyframes active-glow {
    0% {
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    }
    100% {
        box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
    }
}

.action-number {
    font-weight: 600;
}

/* Task Actions Container */
.task-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Action Pulse Animation - Enhanced */
.action-pulse {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 3px solid #f59e0b;
    animation: action-pulse-enhanced 2s infinite;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
}

@keyframes action-pulse-enhanced {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes task-box-pulse {
    0% {
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    }
    100% {
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
    }
}