/* Input and Control Styles - VibeSurf Extension */

/* 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);
}

/* Control Panel Error State */
.control-panel.error-state {
  background-color: rgba(220, 53, 69, 0.05);
  border-left: 4px solid var(--danger-color);
  border-color: rgba(220, 53, 69, 0.2);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
}

.control-panel.error-state::before {
  content: '⚠️ Error occurred - task controls remain available';
  display: block;
  font-size: var(--font-size-xs);
  color: var(--danger-color);
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background-color: rgba(220, 53, 69, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(220, 53, 69, 0.2);
  font-weight: var(--font-weight-medium);
}

.control-panel.error-state .control-btn {
  border-color: rgba(220, 53, 69, 0.3);
  background-color: rgba(255, 255, 255, 0.9);
}

.control-panel.error-state .control-btn:hover {
  background-color: var(--bg-primary);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* 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;
}

.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;
}

/* 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;
}

/* Warning modal styles removed - consolidated in components.css to avoid conflicts */

/* 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;
}

/* Tab Selection Dropdown */
.tab-selector-dropdown {
  position: fixed !important;
  z-index: 1000;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow: hidden;
  display: none;
}

.tab-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.tab-selector-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.tab-selector-close {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

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

.tab-selector-content {
  max-height: 200px;
  overflow-y: auto;
  padding: var(--spacing-xs);
}

.tab-selector-controls {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--spacing-xs);
}

.select-all-option {
  font-weight: var(--font-weight-medium);
  color: var(--primary-color);
}

.tab-options-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.tab-option:hover {
  background: var(--bg-hover);
}

.tab-option.active-tab {
  background: rgba(144, 238, 144, 0.3);
  border: 1px solid rgba(144, 238, 144, 0.6);
  box-shadow: 0 2px 4px rgba(144, 238, 144, 0.2);
}

.tab-option.active-tab .tab-name {
  color: #2d5a2d;
  font-weight: var(--font-weight-medium);
}

.tab-option.active-tab .tab-id {
  color: #1a4d1a;
  font-weight: var(--font-weight-medium);
}

.tab-radio {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tab-name {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Remove footer and buttons for single-select auto-confirm */

/* Tab selection indicator in textarea */
.task-input.has-selected-tabs {
  border-color: var(--primary-color);
  background: rgba(0, 122, 204, 0.02);
}

/* Selected tabs display */
.selected-tabs-indicator {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: var(--primary-color);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  pointer-events: none;
  z-index: 2;
}