/* 
 * Main Stylesheet for Nectar Bot
 * A clean, functional interface for the nectar-bot workflow
 */

/* Base Styles */
:root {
  --primary-color: #4caf50;
  --primary-dark: #388e3c;
  --primary-light: #a5d6a7;
  --accent-color: #ff9800;
  --text-color: #333333;
  --text-light: #767676;
  --background-color: #f5f5f5;
  --card-color: #ffffff;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --success-color: #4caf50;
  --border-color: #e0e0e0;
  --border-radius: 4px;
  --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-color);
  margin-top: 0;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header Styles */
.header {
  background-color: var(--primary-color);
  color: white;
  padding: 16px 20px;
  box-shadow: var(--box-shadow);
}

.header h1 {
  margin: 0;
  font-size: 24px;
  color: white;
}

.header .subtitle {
  font-size: 14px;
  opacity: 0.8;
}

/* Form Styles */
.form-container {
  background-color: var(--card-color);
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-light);
}

.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: var(--primary-dark);
  text-decoration: none;
}

.btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

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

.btn-secondary:hover {
  background-color: #f8f8f8;
}

.error-message {
  color: var(--error-color);
  font-size: 14px;
  margin-top: 5px;
}

/* Dashboard Layout - UPDATED */
.dashboard {
  display: flex;
  gap: 30px;
  margin-top: 20px;
  height: calc(100vh - 150px);
  overflow: hidden;
}

.content-viewer {
  flex: 2.5; /* INCREASED from 2 for wider layout */
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  height: calc(100vh - 150px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.workflow {
  flex: 1.5; /* DECREASED from 1 to compensate */
  background-color: var(--card-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
  height: calc(100vh - 150px);
  overflow-y: auto;
}

/* Right panel styling */
.right-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Tabs */
.tabs {
  display: flex;
  background-color: #f1f1f1;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  white-space: nowrap;
}

.tab-btn {
  padding: 12px 16px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  color: var(--text-light);
}

.tab-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
  background-color: white;
  border-bottom: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 500;
}

.tab-content {
  display: none;
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

.tab-content.active {
  display: block;
}

/* Content Styling */
pre {
  white-space: pre-wrap;
  background-color: #f8f8f8;
  padding: 16px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  font-size: 14px;
  overflow-x: auto;
}

.markdown-preview {
  padding: 20px;
  overflow-y: auto;
}

.markdown-preview h1 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.markdown-preview h2 {
  padding-top: 16px;
}

.markdown-preview code {
  background-color: #f8f8f8;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 85%;
}

.markdown-preview pre code {
  padding: 0;
  background: none;
}

.markdown-preview blockquote {
  border-left: 4px solid var(--primary-light);
  padding-left: 16px;
  margin-left: 0;
  color: var(--text-light);
}

.no-data {
  color: var(--text-light);
  font-style: italic;
  padding: 20px;
  text-align: center;
}

/* Workflow Styling */
.workflow-title {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.workflow-item {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.status-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 16px;
}

.status-indicator.not-started {
  background-color: var(--error-color);
}

.status-indicator.in-progress {
  background-color: var(--warning-color);
  animation: pulse 1.5s infinite;
}

.status-indicator.complete {
  background-color: var(--success-color);
}

.step-name {
  flex: 1;
  font-weight: 500;
}

.step-description {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Task Status */
.task-status {
  margin-top: 30px;
  padding: 20px;
  background-color: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.progress-container {
  height: 10px;
  background-color: #f1f1f1;
  border-radius: 5px;
  margin: 10px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.5s ease;
}

.status-message {
  font-size: 14px;
  color: var(--text-light);
  margin: 10px 0;
}

/* Copy Button Styles */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background-color: var(--primary-light);
  color: white;
}

/* View Toggle Styles */
.view-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.toggle-btn {
  padding: 5px 10px;
  font-size: 12px;
  background-color: #f1f1f1;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.toggle-btn:first-child {
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.toggle-btn:last-child {
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.toggle-btn.active {
  background-color: var(--primary-color);
  color: white;
}

/* Content container with relative positioning for copy button */
.content-container {
  position: relative;
  height: calc(100% - 45px);
  overflow: hidden;
}

/* View mode selector styling - UPDATED */
.view-mode-selector {
    display: flex;
    background-color: #f1f1f1;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
    min-height: 45px;
    align-items: center;
}

.view-mode-btn {
    padding: 10px 14px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.view-mode-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.view-mode-btn.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    border-radius: 3px;
    margin: 2px;
}

/* Export button styling - UPDATED */
.export-pdf-btn,
.enhanced-pdf-btn,
.pdf-settings-btn {
    margin-left: 8px;
    padding: 6px 10px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    margin-top: 3px;
    margin-bottom: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.enhanced-pdf-btn {
    background-color: var(--primary-color);
}

.pdf-settings-btn {
    background-color: #666;
}

.export-pdf-btn:hover:not([disabled]) {
    background-color: #e08600;
}

.enhanced-pdf-btn:hover {
    background-color: var(--primary-dark);
}

.pdf-settings-btn:hover {
    background-color: #555;
}

.export-pdf-btn[disabled] {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Field selector styling */
.field-selector {
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.field-selector h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 18px;
}

.field-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.field-tab-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 10px 12px;
    background-color: #f8f8f8;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.field-tab-btn:hover {
    background-color: #f1f1f1;
}

.field-tab-btn.active {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
    font-weight: 500;
}

/* Type indicators - UPDATED */
.type-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 8px;
}

.type-indicator.conversation {
    background-color: #2196F3;
}

.type-indicator.markdown {
    background-color: #4CAF50;
}

.type-indicator.text {
    background-color: #FF9800;
}

.type-indicator.json {
    background-color: #9C27B0;
}

.type-indicator.html {
    background-color: #FF5722;
}

.type-indicator.code {
    background-color: #607D8B;
}

.type-indicator.unknown {
    background-color: #BBBBBB;
}

/* Content view styling - UPDATED */
#raw-view, 
#conversation-view, 
#markdown-view, 
#formatted-view,
#preview-view {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    display: none;
    padding: 20px;
}

#preview-view {
    padding: 15px;
}

#raw-view.active, 
#conversation-view.active, 
#markdown-view.active, 
#formatted-view.active,
#preview-view.active {
    display: block;
}

/* Ensure the scrolling works properly for each view */
#raw-view {
    white-space: pre-wrap;
    font-family: monospace;
    background-color: #f8f8f8;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

#markdown-view {
    line-height: 1.6;
}

#content-display {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Conversation styling */
.conversation-message {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--border-radius);
    max-width: 85%;
}

.conversation-message.assistant {
    background-color: #f1f8e9;
    border-left: 4px solid var(--primary-color);
    margin-right: auto;
}

.conversation-message.user {
    background-color: #e8f5e9;
    border-right: 4px solid var(--accent-color);
    margin-left: auto;
    text-align: right;
}

.message-role {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.message-content {
    white-space: pre-wrap;
}

/* Info message styling */
.info-message {
    color: #2196F3;
    padding: 16px;
    border: 1px solid #2196F3;
    border-radius: var(--border-radius);
    margin: 16px 0;
}

/* Open in New Tab Button - NEW */
.open-tab-btn {
    padding: 6px 12px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    white-space: nowrap;
}

.open-tab-btn:hover {
    background-color: #1976D2;
}

/* Modal dialog styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
    justify-content: center;
    align-items: center;
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

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

/* Icon Selection Styles */
.icon-search-container {
    display: flex;
    margin-bottom: 10px;
}

#icon-search {
    flex-grow: 1;
    margin-right: 10px;
    padding: 5px;
}

.icon-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    padding: 10px;
}

.loading-icons {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #666;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.icon-option:hover {
    background-color: #f0f0f0;
}

.icon-option.selected {
    background-color: #e0e0e0;
}

.icon-preview {
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 5px;
}

.icon-name {
    font-size: 9px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.selected-icon-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

#selected-icon-preview {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    margin-left: 10px;
}

#selected-icon-name {
    margin-left: 5px;
}

/* Color picker styling */
.color-picker-container {
    display: flex;
    align-items: center;
}

input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-display {
    margin-left: 10px;
    font-family: monospace;
    display: inline-block;
}

/* Warmup Section Styles */
.warmup-section {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.warmup-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.warmup-help {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.warmup-status {
    margin-top: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.warmup-message {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.warmup-message.info {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.warmup-message.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.warmup-message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Multi-model button styles */
.model-buttons {
    display: flex;
    gap: 4px;
    flex-direction: row;
    flex-wrap: wrap;
}

.model-btn {
    padding: 6px 10px;
    border: 2px solid;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 45px;
    text-align: center;
}

.model-btn.claude-37 {
    border-color: #4caf50;
    background-color: #4caf50;
    color: white;
}

.model-btn.claude-37:hover:not(:disabled) {
    background-color: #45a049;
    border-color: #45a049;
}

.model-btn.claude-4 {
    border-color: #2196f3;
    background-color: #2196f3;
    color: white;
}

.model-btn.claude-4:hover:not(:disabled) {
    background-color: #1976d2;
    border-color: #1976d2;
}

.model-btn.claude-45 {
    border-color: #00bcd4;
    background-color: #00bcd4;
    color: white;
}

.model-btn.claude-45:hover:not(:disabled) {
    background-color: #00acc1;
    border-color: #00acc1;
}

.model-btn.claude-opus {
    border-color: #7b1fa2;
    background-color: #7b1fa2;
    color: white;
}

.model-btn.claude-opus:hover:not(:disabled) {
    background-color: #6a1b9a;
    border-color: #6a1b9a;
}

.model-btn.claude-opus:disabled {
    background-color: #ba68c8;
    border-color: #ba68c8;
    color: #ffffff80;
    cursor: not-allowed;
}

.model-btn.claude-opus41 {
    border-color: #9c27b0;
    background-color: #9c27b0;
    color: white;
}

.model-btn.claude-opus41:hover:not(:disabled) {
    background-color: #8e24aa;
    border-color: #8e24aa;
}

.model-btn.claude-opus41:disabled {
    background-color: #ce93d8;
    border-color: #ce93d8;
    color: #ffffff80;
    cursor: not-allowed;
}

.model-btn.grok {
    background-color: #ff1493;
    border-color: #e6127e;
    color: white;
}

.model-btn.grok:hover:not(:disabled) {
    background-color: #e6127e;
    border-color: #cc0f6f;
    color: white;
}

.model-btn.grok:disabled {
    background-color: #ff69b4;
    border-color: #ff69b4;
    color: #ffffff80;
    cursor: not-allowed;
}

.model-btn.claude-45-opus {
    border-color: #ab47bc;
    background-color: #ab47bc;
    color: white;
}

.model-btn.claude-45-opus:hover:not(:disabled) {
    background-color: #9c27b0;
    border-color: #9c27b0;
}

.model-btn.claude-45-opus:disabled {
    background-color: #e1bee7;
    border-color: #e1bee7;
    color: #ffffff80;
    cursor: not-allowed;
}

.model-btn.claude-haiku {
    border-color: #ffa726;
    background-color: #ffa726;
    color: white;
}

.model-btn.claude-haiku:hover:not(:disabled) {
    background-color: #fb8c00;
    border-color: #fb8c00;
}

.model-btn.claude-haiku:disabled {
    background-color: #ffcc80;
    border-color: #ffcc80;
    color: #ffffff80;
    cursor: not-allowed;
}

.model-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.model-name {
    display: block;
    font-weight: bold;
}

/* Utilities */
.hidden {
  display: none;
}

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

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Loading Animation */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Responsive Adjustments - UPDATED */
@media (max-width: 1024px) {
  .dashboard {
    gap: 20px;
  }
  
  .content-viewer {
    flex: 2.2;
  }
  
  .workflow {
    flex: 1.8;
  }
}

@media (max-width: 768px) {
  .dashboard {
    flex-direction: column;
    height: auto;
  }
  
  .content-viewer, .workflow {
    flex: none;
    height: auto;
    max-height: 500px;
  }
  
  .container {
    padding: 10px;
  }
  
  .view-mode-selector {
    flex-wrap: wrap;
    height: auto;
  }
  
  .view-mode-btn {
    font-size: 12px;
    padding: 8px 10px;
  }
  
  .model-buttons {
    flex-direction: column;
  }
  
  .model-btn {
    min-width: 60px;
  }
}