/* Main CSS - VibeSurf Extension */

:root {
  /* Colors */
  --primary-color: #007acc;
  --primary-hover: #005a9b;
  --secondary-color: #f0f2f5;
  --accent-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --text-primary: #1a1a1a;
  --text-secondary: #6c757d;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --border-hover: #d1d5db;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f4;
  --bg-hover: #f5f5f5;
  --bg-active: #e8f4fd;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 0.875rem;
  --font-size-lg: 1rem;
  --font-size-xl: 1.125rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow: hidden;
}

/* Container */
.vibesurf-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  min-width: 320px;
  background-color: var(--bg-primary);
  resize: horizontal;
  overflow: auto;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  min-height: 56px;
}

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

.logo {
  display: flex;
  align-items: center;
  color: var(--primary-color);
  font-weight: var(--font-weight-semibold);
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--primary-color);
  font-weight: var(--font-weight-semibold);
}

.logo-image {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
}

.logo-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.logo-text {
  font-size: var(--font-size-lg);
  line-height: 1.2;
}

.session-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.session-label {
  font-weight: var(--font-weight-medium);
}

#session-id {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background-color: var(--bg-tertiary);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.copy-btn:active {
  background-color: var(--bg-active);
  transform: scale(0.95);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

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

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

.icon-btn:active {
  background-color: var(--bg-active);
  transform: scale(0.95);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Activity Section */
.activity-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.activity-log {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
  background-color: var(--bg-primary);
  min-height: 0; /* Allow proper flexbox sizing */
  display: flex;
  flex-direction: column;
}

.activity-log::-webkit-scrollbar {
  width: 6px;
}

.activity-log::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.activity-log::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.activity-log::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.welcome-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: var(--spacing-lg) var(--spacing-2xl);
  color: var(--text-muted);
  min-height: 0; /* Allow shrinking */
  max-height: none; /* Remove any height constraints */
  overflow: visible; /* Ensure content is not clipped */
}

.welcome-text h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.welcome-text p {
  font-size: var(--font-size-sm);
  line-height: 1.6;
  margin-bottom: var(--spacing-xl);
}

.quick-tasks {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  width: 100%;
  max-width: 400px;
  min-height: 0; /* Ensure all items are visible */
  overflow: visible; /* Ensure content is not clipped */
  grid-auto-rows: auto; /* Let rows size automatically */
}

.task-suggestion {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.task-suggestion:hover {
  border-color: var(--primary-color);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.task-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  border-radius: var(--radius-md);
  color: white;
}

.task-content {
  flex: 1;
}

.task-title {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-base);
}

.task-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Control Panel */
.control-panel {
  padding: var(--spacing-md);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.control-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.control-btn:active {
  transform: scale(0.98);
}

.cancel-btn {
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.cancel-btn:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

.resume-btn {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.resume-btn:hover {
  background-color: rgba(40, 167, 69, 0.1);
}

.terminate-btn {
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.terminate-btn:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* Input Section */
.input-section {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-md);
}

.input-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.input-main {
  display: flex;
  flex-direction: column;
}

.textarea-container {
  position: relative;
  display: flex;
  flex-direction: column;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: calc(var(--spacing-xs) / 2);
}

.llm-select {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast);
  min-width: 120px;
}

.llm-select.compact {
  max-width: 100px;
  font-size: var(--font-size-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
}

.llm-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

.task-input {
  width: 100%;
  padding: var(--spacing-md);
  padding-right: 80px; /* Make space for buttons */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background-color: var(--bg-primary);
  font-size: var(--font-size-sm);
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  transition: all var(--transition-fast);
  min-height: 44px;
  max-height: 200px;
  overflow-y: auto;
}

.task-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

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

.input-actions {
  position: absolute;
  right: var(--spacing-sm);
  bottom: var(--spacing-sm);
  display: flex;
  gap: var(--spacing-xs);
  z-index: 1;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.8;
}

.action-btn:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-hover);
  color: var(--text-primary);
  opacity: 1;
  transform: scale(1.05);
}

.action-btn:active {
  transform: scale(0.95);
}

.send-btn {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.send-btn:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.send-btn:disabled {
  background-color: var(--border-color);
  border-color: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
}

/* Activity Log Items - Chat Style */
.activity-item {
  margin-bottom: var(--spacing-lg);
  width: 100%;
  display: flex;
  flex-direction: column;
}

.message-container {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: fadeIn 0.3s ease-out;
}

.user-container {
  align-self: flex-end;
  align-items: flex-end;
}

.agent-container {
  align-self: flex-start;
  align-items: flex-start;
}

.message-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.user-container .message-header {
  justify-content: flex-end;
}

.agent-container .message-header {
  justify-content: flex-start;
}

.agent-name {
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.user-container .agent-name {
  color: var(--primary-color);
}

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

.message-bubble {
  padding: var(--spacing-md);
  border-radius: var(--radius-lg);
  position: relative;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}

.user-bubble {
  background-color: var(--primary-color);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.agent-bubble {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: var(--radius-sm);
}

.message-bubble.working {
  border-left: 3px solid var(--warning-color);
  background-color: rgba(255, 193, 7, 0.05);
}

.message-bubble.result,
.message-bubble.done {
  border-left: 3px solid var(--accent-color);
  background-color: rgba(40, 167, 69, 0.05);
}

.message-bubble.error {
  border-left: 3px solid var(--danger-color);
  background-color: rgba(220, 53, 69, 0.05);
}

.message-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.user-bubble .message-status {
  color: rgba(255, 255, 255, 0.9);
}

.agent-bubble .message-status {
  color: var(--text-secondary);
}

.status-indicator {
  font-size: 12px;
}

.status-text {
  text-transform: capitalize;
}

.message-content {
  line-height: 1.6;
  font-size: var(--font-size-sm);
}

.user-bubble .message-content {
  color: white;
}

.agent-bubble .message-content {
  color: var(--text-primary);
}

/* Content formatting */
.message-content h1,
.message-content h2,
.message-content h3 {
  margin: var(--spacing-sm) 0;
  font-weight: var(--font-weight-semibold);
}

.message-content h1 {
  font-size: var(--font-size-lg);
}

.message-content h2 {
  font-size: var(--font-size-base);
}

.message-content h3 {
  font-size: var(--font-size-sm);
}

.message-content ul {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-lg);
}

.message-content li {
  margin-bottom: var(--spacing-xs);
}

.message-content .code-block {
  background-color: var(--bg-tertiary);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: var(--font-size-xs);
  margin: var(--spacing-sm) 0;
  border: 1px solid var(--border-color);
}

.user-bubble .code-block {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.message-content .inline-code {
  background-color: var(--bg-tertiary);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: var(--font-size-xs);
}

.user-bubble .inline-code {
  background-color: rgba(255, 255, 255, 0.2);
}

.message-content .json-content {
  background-color: var(--bg-tertiary);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: var(--font-size-xs);
  margin: var(--spacing-sm) 0;
  border: 1px solid var(--border-color);
}

.user-bubble .json-content {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.message-content a {
  color: inherit;
  text-decoration: underline;
}

.user-bubble .message-content a {
  color: rgba(255, 255, 255, 0.9);
}

.agent-bubble .message-content a {
  color: var(--primary-color);
}

.message-content a:hover {
  opacity: 0.8;
}

/* Status indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--border-color);
}

.status-dot.active {
  background-color: var(--accent-color);
  animation: pulse 2s infinite;
}

.status-dot.error {
  background-color: var(--danger-color);
}

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

/* Enhanced Markdown Styles */
.message-content .task-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-xs) 0;
  padding: var(--spacing-xs) 0;
  line-height: 1.4;
}

.message-content .task-item input[type="checkbox"] {
  margin: 0;
  cursor: default;
  accent-color: var(--primary-color);
}

.message-content .markdown-table {
  border-collapse: collapse;
  width: 100%;
  margin: var(--spacing-md) 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: var(--font-size-sm);
}

.message-content .markdown-table th,
.message-content .markdown-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.message-content .markdown-table th {
  background-color: var(--bg-tertiary);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.user-bubble .markdown-table th {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.message-content .markdown-table tr:hover {
  background-color: var(--bg-hover);
}

.user-bubble .markdown-table tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.message-content .markdown-quote {
  border-left: 4px solid var(--primary-color);
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
  color: var(--text-secondary);
  font-style: italic;
  background-color: var(--bg-secondary);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
}

.user-bubble .markdown-quote {
  border-left-color: rgba(255, 255, 255, 0.8);
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: var(--spacing-md) 0 var(--spacing-sm) 0;
  color: var(--text-primary);
  line-height: 1.3;
}

.user-bubble .message-content h1,
.user-bubble .message-content h2,
.user-bubble .message-content h3,
.user-bubble .message-content h4,
.user-bubble .message-content h5,
.user-bubble .message-content h6 {
  color: white;
}

.message-content h1 { font-size: var(--font-size-xl); font-weight: var(--font-weight-bold); }
.message-content h2 { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
.message-content h3 { font-size: var(--font-size-base); font-weight: var(--font-weight-semibold); }
.message-content h4 { font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); }

.message-content ul,
.message-content ol {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-xl);
}

.message-content li {
  margin: var(--spacing-xs) 0;
  line-height: 1.5;
}

.message-content p {
  margin: var(--spacing-sm) 0;
  line-height: 1.6;
}

.message-content a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.message-content a:hover {
  border-bottom-color: var(--primary-color);
}

.user-bubble .message-content a {
  color: rgba(255, 255, 255, 0.9);
  border-bottom-color: transparent;
}

/* Task Running Disabled State */
.task-running-disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  position: relative;
}

.task-running-disabled::after {
  content: '🔒';
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.7;
  pointer-events: none;
}

/* Specific styles for different elements when disabled */
button.task-running-disabled {
  background-color: #f0f0f0 !important;
  border-color: #ddd !important;
  color: #999 !important;
}

input.task-running-disabled,
textarea.task-running-disabled,
select.task-running-disabled {
  background-color: #f9f9f9 !important;
  border-color: #ddd !important;
  color: #999 !important;
}

/* Task status indicator in control panel */
.control-panel .task-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 6px;
  font-size: 12px;
  color: #856404;
  margin-bottom: 8px;
}

.control-panel .task-status-indicator::before {
  content: '⚠️';
  font-size: 14px;
}

/* Enhanced warning modal styles */
.modal-overlay.warning-modal {
  z-index: 15000;
}

.warning-modal .modal-content {
  max-width: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.warning-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
}

.warning-icon {
  font-size: 24px;
}

.warning-header h3 {
  margin: 0;
  color: #dc3545;
  font-size: 18px;
}

.warning-body {
  padding: 0 20px 16px;
}

.warning-body p {
  margin: 0 0 12px;
  color: #666;
  line-height: 1.5;
}

.warning-details {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  color: #495057;
  white-space: pre-wrap;
  margin: 0;
}

.warning-actions {
  display: flex;
  gap: 8px;
  padding: 16px 20px 20px;
  justify-content: flex-end;
}

.warning-actions .btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.warning-actions .btn-danger {
  background: #dc3545;
  color: white;
}

.warning-actions .btn-danger:hover {
  background: #c82333;
}

.warning-actions .btn-secondary {
  background: #6c757d;
  color: white;
}

.warning-actions .btn-secondary:hover {
  background: #545b62;
}

.warning-actions .btn-primary {
  background: #007bff;
  color: white;
}

.warning-actions .btn-primary:hover {
  background: #0056b3;
}

.user-bubble .message-content a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.9);
}

.message-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--spacing-lg) 0;
}

.user-bubble .message-content hr {
  border-top-color: rgba(255, 255, 255, 0.3);
}

.message-content strong {
  font-weight: var(--font-weight-semibold);
}

.message-content em {
  font-style: italic;
}

/* Animation for new content */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 320px) {
  .header {
    padding: var(--spacing-md);
  }
  
  .activity-log {
    padding: var(--spacing-md);
  }
  
  .input-section {
    padding: var(--spacing-md);
  }
}

/* History Modal Styles - Modern Design */
.history-modal-content {
  width: 92vw;
  max-width: 900px;
  min-height: 70vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.history-content {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 32px;
  padding-top: 24px;
}

.history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-height: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 24px 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 28px;
}

.section-header h4 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  background-color: transparent;
  color: var(--primary-color);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 122, 204, 0.2);
}

/* Recent Tasks List */
.recent-tasks-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 28px;
  padding-right: 8px;
}

.recent-tasks-list::-webkit-scrollbar {
  width: 6px;
}

.recent-tasks-list::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.recent-tasks-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.recent-tasks-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.recent-task-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background-color: var(--bg-secondary);
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.recent-task-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.recent-task-item:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 122, 204, 0.15);
}

.recent-task-item:hover::before {
  transform: scaleX(1);
}

.task-status-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
}

.task-status-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  padding: 2px;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.task-status-icon:hover::before {
  opacity: 1;
}

.task-status-icon.completed {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.2));
  color: var(--accent-color);
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.task-status-icon.running {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.2));
  color: var(--warning-color);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.task-status-icon.error {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.2));
  color: var(--danger-color);
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.task-status-icon.pending {
  background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.2));
  color: var(--text-muted);
  border: 1px solid rgba(108, 117, 125, 0.3);
}

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

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

.session-id-badge {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 11px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.task-timestamp {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.task-description {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 400;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.task-status-text {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
}

.task-status-text.completed {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.15));
  color: var(--accent-color);
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.task-status-text.running {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.15));
  color: var(--warning-color);
  border: 1px solid rgba(255, 193, 7, 0.2);
}

.task-status-text.error {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.15));
  color: var(--danger-color);
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.task-status-text.pending {
  background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.15));
  color: var(--text-muted);
  border: 1px solid rgba(108, 117, 125, 0.2);
}

.view-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 20px;
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.view-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 122, 204, 0.1), transparent);
  transition: left 0.5s;
}

.view-more-btn:hover {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-secondary));
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 122, 204, 0.15);
}

.view-more-btn:hover::before {
  left: 100%;
}

/* Search and Filter Bar */
.search-filter-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
}

.search-input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-primary);
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 122, 204, 0.1);
  transform: translateY(-1px);
}

.filter-select {
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-primary);
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  min-width: 140px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 122, 204, 0.1);
  transform: translateY(-1px);
}

/* All Sessions List */
.sessions-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 28px;
  padding-right: 8px;
}

.sessions-list::-webkit-scrollbar {
  width: 6px;
}

.sessions-list::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.sessions-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.sessions-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.session-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-primary);
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.session-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.session-item:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 122, 204, 0.15);
}

.session-item:hover::before {
  transform: scaleX(1);
}

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

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

.session-id {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

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

.session-details {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.task-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.session-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 0;
  border-top: 2px solid var(--border-color);
  margin-top: auto;
}

.page-btn {
  padding: 12px 20px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 122, 204, 0.2);
}

.page-btn:disabled {
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.4;
}

.page-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.page-info {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Empty State - Enhanced */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  color: var(--text-muted);
  min-height: 300px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: 16px;
  border: 2px dashed var(--border-color);
  margin: 20px 0;
}

.empty-state-icon {
  font-size: 72px;
  margin-bottom: 24px;
  opacity: 0.6;
  filter: grayscale(0.3);
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.empty-state-description {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.8;
  max-width: 320px;
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-task-item {
  height: 80px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-md);
}

.skeleton-session-item {
  height: 60px;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
}

/* Responsive adjustments for history modal */
@media (max-width: 768px) {
  .history-modal-content {
    width: 95vw;
    max-height: 90vh;
  }
  
  .search-filter-bar {
    flex-direction: column;
  }
  
  .task-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
  
  .session-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }
}

@media (max-width: 480px) {
  .recent-task-item {
    padding: var(--spacing-md);
  }
  
  .task-item-content {
    min-width: 0;
  }
  
  .task-description {
    -webkit-line-clamp: 3;
  }
}

/* Enhanced History Modal Styles */

/* Loading States - Enhanced */
.loading-skeleton {
  background: linear-gradient(90deg, 
    var(--bg-tertiary) 25%, 
    rgba(0, 122, 204, 0.1) 50%, 
    var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite ease-in-out;
  border-radius: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-task-item {
  height: 96px;
  border-radius: 16px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.skeleton-task-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0.3;
}

.skeleton-session-item {
  height: 76px;
  border-radius: 12px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.skeleton-session-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0.3;
}

/* Enhanced Status Dots */
.history-modal .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  margin-right: 4px;
}

.history-modal .status-dot::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  opacity: 0.3;
}

.history-modal .status-dot.completed, 
.history-modal .status-dot.done {
  background: var(--accent-color);
}

.history-modal .status-dot.completed::before, 
.history-modal .status-dot.done::before {
  background: var(--accent-color);
}

.history-modal .status-dot.running {
  background: var(--warning-color);
  animation: pulse-dot 2s infinite;
}

.history-modal .status-dot.running::before {
  background: var(--warning-color);
  animation: pulse-ring 2s infinite;
}

.history-modal .status-dot.failed, 
.history-modal .status-dot.error {
  background: var(--danger-color);
}

.history-modal .status-dot.failed::before, 
.history-modal .status-dot.error::before {
  background: var(--danger-color);
}

.history-modal .status-dot.paused {
  background: var(--text-muted);
}

.history-modal .status-dot.paused::before {
  background: var(--text-muted);
}

.history-modal .status-dot.active {
  background: var(--accent-color);
  animation: pulse-dot 2s infinite;
}

.history-modal .status-dot.active::before {
  background: var(--accent-color);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.9);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Enhanced Scrollbar Styles for History Modal */
.recent-tasks-list::-webkit-scrollbar,
.sessions-list::-webkit-scrollbar {
  width: 8px;
}

.recent-tasks-list::-webkit-scrollbar-track,
.sessions-list::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
  margin: 8px 0;
}

.recent-tasks-list::-webkit-scrollbar-thumb,
.sessions-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--border-color), var(--text-muted));
  border-radius: 4px;
  border: 1px solid var(--bg-tertiary);
}

.recent-tasks-list::-webkit-scrollbar-thumb:hover,
.sessions-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--text-secondary), var(--primary-color));
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
  .history-modal-content {
    width: 96vw !important;
    max-height: 92vh !important;
    border-radius: 12px !important;
    margin: 16px !important;
  }
  
  .history-content {
    padding: 24px !important;
    padding-top: 20px !important;
  }
  
  .section-header {
    padding-bottom: 20px !important;
    margin-bottom: 24px !important;
  }
  
  .section-header h4 {
    font-size: 20px !important;
  }
  
  .search-filter-bar {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .search-input, .filter-select {
    padding: 12px 16px !important;
    font-size: 14px !important;
  }
  
  .recent-task-item {
    padding: 20px !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
  }
  
  .task-status-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }
  
  .task-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  
  .session-item {
    padding: 16px !important;
    gap: 16px !important;
    margin-bottom: 12px !important;
  }
  
  .session-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  
  .pagination-controls {
    flex-direction: column !important;
    gap: 16px !important;
    text-align: center !important;
    padding: 20px 0 !important;
  }
  
  .page-btn {
    padding: 10px 16px !important;
    font-size: 13px !important;
  }
  
  .view-more-btn {
    padding: 16px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .history-modal-content {
    width: 98vw !important;
    max-height: 95vh !important;
    border-radius: 8px !important;
    margin: 8px !important;
  }
  
  .history-content {
    padding: 20px !important;
    padding-top: 16px !important;
  }
  
  .section-header h4 {
    font-size: 18px !important;
  }
  
  .back-btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
  }
  
  .recent-task-item {
    padding: 16px !important;
    gap: 12px !important;
    border-radius: 12px !important;
  }
  
  .task-status-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
  }
  
  .session-id-badge {
    font-size: 10px !important;
    padding: 4px 8px !important;
  }
  
  .task-timestamp, .session-time {
    font-size: 11px !important;
  }
  
  .task-description {
    font-size: 14px !important;
    -webkit-line-clamp: 3 !important;
    margin-bottom: 12px !important;
  }
  
  .task-meta, .session-details {
    font-size: 12px !important;
    gap: 8px !important;
  }
  
  .task-status-text {
    padding: 3px 8px !important;
    font-size: 11px !important;
  }
  
  .session-item {
    padding: 14px !important;
    gap: 12px !important;
    border-radius: 10px !important;
  }
  
  .session-id {
    font-size: 13px !important;
  }
  
  .empty-state {
    padding: 40px 20px !important;
    min-height: 240px !important;
  }
  
  .empty-state-icon {
    font-size: 56px !important;
    margin-bottom: 20px !important;
  }
  
  .empty-state-title {
    font-size: 18px !important;
    margin-bottom: 12px !important;
  }
  
  .empty-state-description {
    font-size: 14px !important;
    max-width: 280px !important;
  }
}

@media (max-width: 360px) {
  .history-content {
    padding: 16px !important;
  }
  
  .recent-task-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
  }
  
  .task-status-icon {
    align-self: flex-end !important;
    margin-bottom: 8px !important;
  }
  
  .task-header {
    width: 100% !important;
  }
  
  .session-item {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .session-header {
    width: 100% !important;
  }
}

/* Accessibility Enhancements for History Modal */
@media (prefers-reduced-motion: reduce) {
  .recent-task-item,
  .session-item,
  .view-more-btn,
  .back-btn,
  .page-btn {
    transition: none !important;
  }
  
  .recent-task-item:hover,
  .session-item:hover {
    transform: none !important;
  }
  
  .loading-skeleton {
    animation: none !important;
    background: var(--bg-tertiary) !important;
  }
  
  .history-modal .status-dot.running,
  .history-modal .status-dot.active {
    animation: none !important;
  }
  
  .history-modal .status-dot.running::before,
  .history-modal .status-dot.active::before {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* Focus Styles for Keyboard Navigation */
.recent-task-item:focus,
.session-item:focus,
.view-more-btn:focus,
.back-btn:focus {
  outline: 3px solid var(--primary-color) !important;
  outline-offset: 2px !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .recent-task-item,
  .session-item {
    border-width: 2px !important;
  }
  
  .task-status-icon,
  .task-status-text {
    border-width: 2px !important;
  }
  
  .history-modal .status-dot {
    border: 2px solid currentColor !important;
  }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
  .loading-skeleton {
    background: linear-gradient(90deg, 
      rgba(255, 255, 255, 0.1) 25%, 
      rgba(0, 122, 204, 0.2) 50%, 
      rgba(255, 255, 255, 0.1) 75%) !important;
  }
  
  .recent-tasks-list::-webkit-scrollbar-thumb,
  .sessions-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(0, 122, 204, 0.4)) !important;
  }
}

/* File Upload Styles */
.uploaded-files-container {
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 120px;
  overflow-y: auto;
  display: none; /* Hidden by default */
}

.uploaded-files-container .files-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.uploaded-files-container .file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.uploaded-files-container .file-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: var(--spacing-sm);
}

.uploaded-files-container .file-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--danger-color);
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.uploaded-files-container .file-remove-btn:hover {
  background-color: #c82333;
  transform: scale(1.1);
}

.uploaded-files-container .file-remove-btn:active {
  transform: scale(0.95);
}

.uploaded-files-container .error-message {
  padding: var(--spacing-sm);
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px solid var(--danger-color);
  border-radius: var(--radius-sm);
  color: var(--danger-color);
  font-size: var(--font-size-sm);
  text-align: center;
}