/* Global CSS Variables & Theme Setup */
:root {
  --color-bg: #0b0f19;
  --color-sidebar: #0f1322;
  --color-card-bg: rgba(20, 24, 38, 0.65);
  --color-card-border: rgba(255, 255, 255, 0.08);
  --color-card-hover: rgba(255, 255, 255, 0.12);
  
  /* Primary accents */
  --color-primary: #d4af37; /* Cinematic Gold */
  --color-primary-rgb: 212, 175, 55;
  --color-primary-glow: rgba(212, 175, 55, 0.15);
  --color-primary-hover: #e5c158;
  
  --color-secondary: #3b82f6; /* Electric Blue */
  --color-secondary-rgb: 59, 130, 246;
  --color-secondary-glow: rgba(59, 130, 246, 0.15);
  
  /* Status Colors */
  --color-success: #10b981; /* Emerald Green */
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-error: #ef4444; /* Vivid Red */
  --color-error-bg: rgba(239, 68, 68, 0.15);
  --color-warning: #f59e0b; /* Amber */
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  
  /* Text and Outlines */
  --color-on-surface: #e2e8f0;
  --color-on-surface-muted: #94a3b8;
  --color-outline: rgba(148, 163, 184, 0.2);
  --color-outline-focus: #d4af37;
  
  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-on-surface);
  font-family: var(--font-sans);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
}

/* Custom Scrollbars */
.scrollable {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.scrollable::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.scrollable::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* App Main Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Side Navigation Bar */
.global-sidebar {
  width: 280px;
  background-color: var(--color-sidebar);
  border-right: 1px solid var(--color-outline);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  padding: 20px;
  justify-content: space-between;
  z-index: 10;
}

.brand-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -20px -20px 24px -20px; /* Pull to edges of sidebar padding */
  padding: 0;
  width: calc(100% + 40px);
}

.brand-logo {
  font-size: 24px;
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.3);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-logo-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover; /* Cover the container or use 'contain' depending on preference, usually 'cover' or 'fill' will stretch it if aspect ratio allows, let's use contain so it isn't cropped, but maybe it just scales up */
  display: block;
}

.top-nav-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
}

/* Navigation Tabs */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--color-on-surface-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--color-on-surface);
}

.nav-item.active {
  background-color: var(--color-primary-glow);
  color: var(--color-primary);
  border-color: rgba(var(--color-primary-rgb), 0.2);
  box-shadow: inset 0 0 12px rgba(var(--color-primary-rgb), 0.05);
}

.nav-item.dragging {
  opacity: 0.4;
  border: 1px dashed var(--color-primary) !important;
  background: rgba(34, 211, 238, 0.05) !important;
}

.nav-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Global Configurations (API & Balance) */
.global-config {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--color-outline);
}

.config-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  padding: 12px;
}

.config-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-on-surface-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.balance-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.balance-label {
  font-size: 9px;
  color: var(--color-on-surface-muted);
  display: block;
  margin-bottom: 4px;
}

.balance-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-success);
  font-family: var(--font-mono);
}

.balance-value.cyan {
  color: #06b6d4;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #1e1b10;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.3);
}

.btn-transfer {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(79, 172, 254, 0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  animation: pulse-glow 2s infinite alternate;
}

.btn-transfer:hover {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 0 15px rgba(79, 172, 254, 0.7);
  transform: translateY(-1px);
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 5px rgba(79, 172, 254, 0.3); }
  100% { box-shadow: 0 0 12px rgba(79, 172, 254, 0.6); }
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-on-surface);
  border-color: var(--color-card-border);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon-only {
  background: none;
  border: none;
  color: var(--color-on-surface-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-only:hover {
  color: var(--color-on-surface);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Password input wrapper */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 36px;
}

.btn-toggle-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--color-on-surface-muted);
  cursor: pointer;
  font-size: 14px;
}

/* Inputs */
.input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-card-border);
  color: var(--color-on-surface);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.input-field:focus {
  border-color: var(--color-outline-focus);
  box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.15);
}

.input-field::placeholder {
  color: var(--color-on-surface-muted);
  opacity: 0.5;
}

.input-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-on-surface-muted);
  margin-bottom: 6px;
  display: block;
}

/* Main Dashboard Workspace */
.workspace-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg);
}

/* Header */
.workspace-header {
  height: 60px;
  border-bottom: 1px solid var(--color-outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background-color: rgba(15, 19, 34, 0.4);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.header-title-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
}

.header-badge {
  font-size: 10px;
  padding: 2px 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-card-border);
  color: var(--color-on-surface-muted);
  border-radius: 4px;
}

/* Workspace content columns */
.module-container {
  display: none; /* Controlled by JS tab routing */
  height: 100%;
  overflow: hidden;
}

.module-container.active {
  display: flex;
  height: 100%;
}

/* Main Split View Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr minmax(240px, 280px);
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* Split panels */
.panel-section {
  border-right: 1px solid var(--color-outline);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-section:last-child {
  border-right: none;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-outline);
  background-color: rgba(15, 19, 34, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.panel-body {
  flex-grow: 1;
  padding: 20px;
}

/* Forms layout */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.text-mono {
  font-family: var(--font-mono);
}

.textarea-field {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

/* Image Upload Widget */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.upload-zone:hover {
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.02);
}

.upload-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.7;
}

.upload-text {
  font-size: 12px;
  color: var(--color-on-surface-muted);
  line-height: 1.4;
}

.upload-hint {
  font-size: 10px;
  color: var(--color-on-surface-muted);
  opacity: 0.5;
  margin-top: 6px;
}

.upload-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.upload-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.btn-remove-file {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 3;
}

.btn-remove-file:hover {
  background: #ef4444;
}

/* Canvas Viewport */
.canvas-container {
  background-color: #080b12;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 300px;
  border-radius: 8px;
  border: 1px solid var(--color-outline);
  overflow: hidden;
}

.canvas-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--color-on-surface-muted);
}

.canvas-placeholder-icon {
  font-size: 48px;
  opacity: 0.3;
}

.canvas-placeholder h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-on-surface);
}

.canvas-placeholder p {
  font-size: 12px;
  max-width: 240px;
  text-align: center;
  opacity: 0.7;
}

/* Loading Overlay inside Canvas */
.canvas-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212, 175, 55, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Task Badge Status */
.task-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-outline);
}

.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-idle {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-on-surface-muted);
}

.badge-running {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  animation: pulse-glow-run 2s infinite;
}

.badge-success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
}

.badge-failed {
  background-color: var(--color-error-bg);
  color: var(--color-error);
}

@keyframes pulse-glow-run {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; filter: drop-shadow(0 0 4px var(--color-warning)); }
}

/* Output visualization results */
.canvas-result {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-result img, .canvas-result video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.script-viewer {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #c9d1d9;
  text-align: left;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

/* Result Actions Panel */
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* History listing panels */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--color-card-border);
  background: rgba(255, 255, 255, 0.01);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.15);
}

.history-item.active {
  background: var(--color-primary-glow);
  border-color: var(--color-primary);
}

.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.history-title {
  font-size: 12px;
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-status {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
}

.history-desc {
  font-size: 10px;
  color: var(--color-on-surface-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.history-time {
  font-size: 8px;
  color: var(--color-on-surface-muted);
  opacity: 0.5;
  text-align: right;
  margin-top: 6px;
}

.empty-state {
  color: var(--color-on-surface-muted);
  font-size: 12px;
  text-align: center;
  padding: 40px 10px;
  font-style: italic;
  opacity: 0.5;
}

/* Console logs debug footer */
.console-logs {
  background: #06080e;
  border-top: 1px solid var(--color-outline);
  padding: 8px 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #cbd5e1;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  flex-shrink: 0;
}

.console-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.console-text.info { color: #60a5fa; }
.console-text.success { color: #34d399; }
.console-text.error { color: #f87171; }
.console-text.warning { color: #fbbf24; }

/* Progress bar */
.progress-bar-container {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

.hidden {
  display: none !important;
}

.hidden-file-input {
  display: none;
}

/* Extra grid elements */
.split-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Custom styled scrollbars for specific items */
.form-scroll {
  overflow-y: auto;
  padding-right: 4px;
}

/* Highlighted stats under canvas */
.canvas-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--color-outline);
  border-radius: 6px;
  padding: 8px 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 9px;
  color: var(--color-on-surface-muted);
}

.stat-value {
  font-size: 11px;
  font-weight: 600;
}

/* Workflow pipeline flow/transfer controls */
.pipeline-transfer-container {
  margin-top: 12px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px dashed rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
}

.pipeline-transfer-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pipeline-transfer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-pipeline {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-outline);
  color: var(--color-on-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-pipeline:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Modal Overlay & Container */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(6, 14, 32, 0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.15s ease;
}

.modal-container {
  background-color: #171f33;
  border: 1px solid var(--color-outline);
  border-radius: 8px;
  width: 90vw;
  max-width: 1100px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 30px rgba(34, 211, 238, 0.1);
  overflow: hidden;
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-outline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255,255,255,0.02);
}

.modal-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--color-on-surface-muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  overflow: hidden;
}

.canvas-workspace {
  background-color: #060e20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  position: relative;
}

#editor-canvas {
  background-color: #ffffff;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  cursor: crosshair;
  max-width: 100%;
  max-height: 100%;
}

.canvas-toolbox {
  background-color: #131b2e;
  border-left: 1px solid var(--color-outline);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.toolbox-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbox-section h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tool-btn {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-outline);
  color: var(--color-on-surface);
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  border-color: var(--color-primary);
  background-color: rgba(34, 211, 238, 0.05);
}

.tool-btn.active {
  background-color: var(--color-primary);
  color: #00363e;
  border-color: var(--color-primary);
  font-weight: 600;
}

.tool-btn svg {
  stroke: currentColor;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-item label {
  font-size: 10px;
  color: var(--color-on-surface-muted);
}

.setting-item input[type="range"] {
  width: 100%;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--color-outline);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: rgba(255,255,255,0.02);
}

/* Module log console */
.module-log-panel {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-outline);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.module-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.module-log-console {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #a5f3fc; /* Cyan text */
  max-height: 80px;
  height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.4;
  scrollbar-width: thin;
}

.log-status-ready { color: var(--color-success); }
.log-status-running { color: var(--color-primary); animation: pulse 1.5s infinite; }
.log-status-failed { color: var(--color-error); }

/* Asset Center Styles */
.asset-cat-btn:hover {
  background: rgba(34, 211, 238, 0.05) !important;
  border-color: var(--color-primary) !important;
}

.asset-cat-btn.active {
  background: var(--color-primary) !important;
  color: #000 !important;
  border-color: var(--color-primary) !important;
  font-weight: 600;
}

.assets-grid {
  scrollbar-width: thin;
}

.asset-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-outline);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.asset-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.1);
}

.asset-card-preview {
  width: 100%;
  height: 120px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--color-outline);
}

.asset-card-preview img, .asset-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-card-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--color-text-muted);
}

.asset-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 6px;
}

.asset-action-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--color-outline);
  color: var(--color-text);
  font-size: 10px;
  padding: 3px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.asset-action-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--color-text);
}

.asset-action-btn.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* Autocomplete Mentions Popover */
.autocomplete-popover {
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.5);
  border-color: var(--color-primary);
}

.popover-item {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.popover-item:hover, .popover-item.active {
  background: rgba(34, 211, 238, 0.1);
  color: var(--color-text);
}

.popover-item-icon {
  font-size: 12px;
}

.popover-item-name {
  font-weight: 600;
  flex: 1;
}

.popover-item-type {
  font-size: 9px;
  opacity: 0.6;
}

/* Mention loading banner */
.mention-loader-banner {
  background: rgba(34, 211, 238, 0.1);
  border: 1px dashed var(--color-primary);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #a5f3fc;
}

.mention-loader-btn {
  background: var(--color-primary);
  border: none;
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 10px;
  transition: opacity 0.15s;
}

.mention-loader-btn:hover {
  opacity: 0.9;
}/* Unique position styling for upload zone interactive triggers to prevent overlap */
.upload-zone {
  position: relative !important;
}

/* 📂 Asset library import trigger - Fixed at bottom-right */
.btn-import-from-library {
  position: absolute !important;
  bottom: 6px !important;
  right: 6px !important;
  top: auto !important; /* Force override top */
  z-index: 10 !important;
}

/* ✕ Remove preview media button - Fixed at top-right */
.upload-remove-btn, .btn-remove-file, .btn-remove-preview {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  bottom: auto !important; /* Force override bottom */
  z-index: 12 !important;
  width: 20px !important;
  height: 20px !important;
  line-height: 18px !important;
  text-align: center !important;
  background: rgba(239, 68, 68, 0.8) !important; /* Translucent Red */
  color: #ffffff !important;
  border: none !important;
  border-radius: 50% !important; /* Perfect Circle */
  cursor: pointer !important;
  font-size: 11px !important;
  font-weight: bold !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.15s ease, transform 0.1s ease !important;
}

.upload-remove-btn:hover, .btn-remove-file:hover, .btn-remove-preview:hover {
  background: rgb(220, 38, 38) !important; /* Solid Darker Red on hover */
  transform: scale(1.1);
}

/* Hide workflow long ID badges in panel headers for cleaner UI */
.header-badge {
  display: none !important;
}


/* ===== FILMING & DIRECTING ULOAD BOX WIDGET STYLES ===== */
.filming-img-box,
.directing-img-box {
  width: 100%;
  min-height: 90px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.18) !important;
  border-radius: 8px !important;
  position: relative !important;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: all 0.25 ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.filming-img-box:hover,
.directing-img-box:hover {
  border-color: var(--color-primary) !important;
  background: rgba(34, 211, 238, 0.06) !important;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
}

.filming-img-box .preview-area,
.directing-img-box .preview-area {
  width: 100%;
  height: 100%;
  min-height: 90px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  text-align: center !important;
  padding: 8px;
  box-sizing: border-box !important;
}

.filming-img-box .preview-area img,
.directing-img-box .preview-area img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  border-radius: 6px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.filming-img-box .placeholder-text,
.directing-img-box .placeholder-text {
  color: var(--color-on-surface-muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  user-select: none !important;
  pointer-events: none !important;
  z-index: 1;
}

.filming-img-box .delete-btn,
.directing-img-box .delete-btn {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  background: rgba(239, 68, 68, 0.85) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50% !important;
  width: 22px !important;
  height: 22px !important;
  font-size: 14px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
  z-index: 10 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
}

.filming-img-box .delete-btn:hover,
.directing-img-box .delete-btn:hover {
  transform: scale(1.15);
  background: rgba(239, 68, 68, 1) !important;
}

/* Dark Theme Select & Option Dropdown Fix */
select, select.input-field {
  background-color: #1a1d2e !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

select option {
  background-color: #141724 !important;
  color: #ffffff !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
}

select option:checked, select option:hover {
  background-color: #f5a623 !important;
  color: #000000 !important;
}

