/* --- DESIGN SYSTEM DE ALTA INTENSIDADE (AUTON.MAX) --- */

:root {
  --bg-color: #0c081d;
  --bg-gradient: linear-gradient(135deg, #090615 0%, #0d0925 50%, #06111e 100%);
  --panel-bg: rgba(14, 11, 30, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f0edfa;
  --text-secondary: #9ea7c1;
  --neon-cyan: #00f2fe;
  --neon-blue: #4facfe;
  --neon-violet: #8e2de2;
  --neon-purple: #4a00e0;
  --neon-green: #00e676;
  --neon-orange: #ff9100;
  --neon-red: #ff1744;
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Glows */
.glow-bg-1 {
  position: absolute;
  top: 15%; left: 10%;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(142, 45, 226, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 0; pointer-events: none; filter: blur(40px);
}
.glow-bg-2 {
  position: absolute;
  bottom: 20%; right: 10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 0; pointer-events: none; filter: blur(50px);
}

/* === WORKSPACE LAYOUT === */
.workspace-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  z-index: 10;
}

/* SIDEBAR ESQUERDA */
.sidebar {
  width: 260px;
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  background: rgba(8, 5, 20, 0.95);
  backdrop-filter: blur(10px);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--panel-border);
}

.sidebar-header h2 {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-add-project {
  font-size: 13px;
  font-family: var(--font-main);
  font-weight: 500;
  color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  border: 1px dashed rgba(0, 242, 254, 0.3);
  transition: all 0.2s;
}
.btn-add-project:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--neon-cyan);
}

.projects-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.project-item {
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.project-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.project-item.active {
  background: linear-gradient(90deg, rgba(79, 172, 254, 0.15) 0%, rgba(0,0,0,0) 100%);
  border-left: 3px solid var(--neon-cyan);
  color: var(--text-primary);
  font-weight: 600;
}

/* WORKERS CATALOG */
.workers-catalog {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.worker-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s;
}
.worker-card:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
  transform: translateY(-2px);
}
.worker-icon {
  font-size: 20px;
}
.worker-info {
  display: flex;
  flex-direction: column;
}
.worker-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.worker-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--panel-border);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.media-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 242, 254, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
.sidebar-video {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.65;
  mix-blend-mode: screen;
  transition: opacity 0.3s ease;
}
.sidebar-video:hover {
  opacity: 1;
}
.license-info {
  margin-top: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  opacity: 0.7;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0, 230, 118, 0.08);
  border: 1px solid rgba(0, 230, 118, 0.25);
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}
.status-pulse-green {
  width: 6px; height: 6px;
  background-color: var(--neon-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulse 1.8s infinite;
}

/* ÁREA PRINCIPAL DIREITA */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* TOP HEADER COM ABAS */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(8, 5, 20, 0.8);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
}

.logo-area {
  display: flex;
  align-items: center;
  position: relative;
}
.logo-glow {
  position: absolute;
  width: 60px; height: 30px;
  background: var(--neon-cyan);
  filter: blur(25px); opacity: 0.5; left: -10px;
}
.logo-text {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--text-primary) 0%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: 1;
}
.logo-accent {
  background: linear-gradient(90deg, var(--neon-cyan) 0%, var(--neon-violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes neonPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 5px #00f0ff); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 20px #00f0ff) drop-shadow(0 0 35px #0088ff); }
  100% { transform: scale(1); filter: drop-shadow(0 0 5px #00f0ff); }
}
.pulsing-active {
  animation: neonPulse 1.5s infinite ease-in-out;
}

.tabs {
  display: flex;
  gap: 15px;
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-family: var(--font-main);
  font-weight: 600;
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  color: var(--neon-cyan);
  border-bottom: 2px solid var(--neon-cyan);
}

/* CONTEÚDO DAS ABAS */
.tabs-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.tab-pane {
  display: none;
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  padding: 24px 40px;
  overflow-y: auto;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ABA 1: EXECUÇÃO (CHAT LIVE) GRID */
.execution-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  height: 100%;
}

.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.glass-panel h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Inputs & Buttons */
textarea {
  width: 100%;
  background: rgba(5, 3, 15, 0.5);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 14px;
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  margin-bottom: 16px;
}
textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
  background: rgba(5, 3, 15, 0.8);
}
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
  border: none;
  border-radius: 10px;
  color: #05030f;
  font-weight: 700;
  font-size: 15px;
  padding: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(0, 242, 254, 0.5); }
.btn-glow {
  position: absolute;
  width: 100%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.4), rgba(255,255,255,0));
  transform: skewX(-30deg) translateX(-150%);
  transition: all 0.6s ease;
}
.btn-primary:hover .btn-glow { transform: skewX(-30deg) translateX(150%); }

.btn-text {
  background: none; border: none;
  color: var(--neon-cyan);
  cursor: pointer;
  font-size: 12px; font-family: var(--font-mono);
  transition: all 0.2s ease;
}
.btn-text:hover { text-shadow: 0 0 8px var(--neon-cyan); text-decoration: underline; }

/* Console Terminal */
.terminal-view {
  background-color: rgba(5,3,15,0.5);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.terminal-line { margin-bottom: 4px; word-break: break-all; }
.info-line { color: #8ec5fc; }
.warn-line { color: #ffe082; }
.error-line { color: #ff8a80; }
.system-line { color: #a7ffeb; opacity: 0.7; }
.debug-line { color: #c5e1a5; opacity: 0.6; }

/* Mode selector */
.mode-selector {
  display: flex; align-items: center; gap: 10px; margin-bottom: 15px;
}
.toggle-switch {
  position: relative; display: inline-block; width: 40px; height: 20px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--panel-border); transition: .4s; border-radius: 20px;
}
.slider:before {
  position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px;
  background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-red); }
input:checked + .slider:before { transform: translateX(20px); }
#mode-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }

/* Badges Status */
.badge-status { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; }
.state-created { background: rgba(158, 167, 193, 0.15); color: var(--text-secondary); border: 1px solid rgba(158, 167, 193, 0.3); }
.state-planning { background: rgba(79, 172, 254, 0.15); color: var(--neon-cyan); border: 1px solid rgba(79, 172, 254, 0.3); }
.state-executing { background: rgba(255, 145, 0, 0.15); color: var(--neon-orange); border: 1px solid rgba(255, 145, 0, 0.3); animation: pulse-border 1.5s infinite; }
.state-completed { background: rgba(0, 230, 118, 0.15); color: var(--neon-green); border: 1px solid rgba(0, 230, 118, 0.3); }
.state-failed { background: rgba(255, 23, 68, 0.15); color: var(--neon-red); border: 1px solid rgba(255, 23, 68, 0.3); }
.state-empty { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

/* Timeline e monitor ativo */
.card-header-flex { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--panel-border); padding-bottom: 12px; margin-bottom: 18px; }
.empty-state-large { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-secondary); padding: 40px 0; gap: 14px; text-align: center; font-size: 14px; }
.timeline-container { display: flex; flex-direction: column; gap: 16px; position: relative; padding-left: 20px; margin-top: 14px; }
.timeline-container::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--panel-border); }
.timeline-node { position: relative; }
.timeline-node::before { content: ''; position: absolute; left: -19px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--text-secondary); border: 2px solid var(--bg-color); }
.timeline-node.executing::before { background: var(--neon-orange); box-shadow: 0 0 8px var(--neon-orange); animation: pulse-node 1.5s infinite; }
.timeline-node.completed::before { background: var(--neon-green); }
.timeline-node.failed::before { background: var(--neon-red); }
.task-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.task-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.task-worker-badge { font-family: var(--font-mono); font-size: 10px; background: rgba(255, 255, 255, 0.05); padding: 2px 8px; border-radius: 4px; }
.subtasks-list { background: rgba(0, 0, 0, 0.2); border-radius: 8px; padding: 12px; margin-top: 6px; border-left: 3px solid rgba(255, 255, 255, 0.05); }
.subtask-item { margin-bottom: 10px; }
.subtask-item:last-child { margin-bottom: 0; }
.subtask-title-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.actions-list { display: flex; flex-direction: column; gap: 6px; padding-left: 12px; border-left: 1px dashed rgba(255, 255, 255, 0.08); margin-top: 4px; }
.action-item { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-secondary); background: rgba(255, 255, 255, 0.01); padding: 4px 8px; border-radius: 4px; }
.action-type { font-family: var(--font-mono); color: var(--neon-cyan); }

/* Markdown Results */
.result-box { background: rgba(0, 242, 254, 0.03); border: 1px solid rgba(0, 242, 254, 0.15); border-radius: 10px; padding: 20px; margin-top: 20px; }
.result-box h3 { font-size: 15px; color: var(--neon-cyan); margin-bottom: 12px; border-bottom: 1px solid rgba(0, 242, 254, 0.1); padding-bottom: 6px; }
.markdown-body { font-size: 14px; line-height: 1.6; color: var(--text-primary); }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 16px 0 8px 0; color: #fff; }
.markdown-body h1 { font-size: 20px; }
.markdown-body h2 { font-size: 16px; }
.markdown-body h3 { font-size: 14px; }
.markdown-body p { margin-bottom: 12px; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; margin-bottom: 12px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body code { font-family: var(--font-mono); background: rgba(255, 255, 255, 0.08); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ABA 2: MISSÕES DO PROJETO */
.missions-queue-container-vertical { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding-top: 15px; }
.queue-item { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 16px; cursor: pointer; transition: all 0.25s ease; }
.queue-item:hover, .queue-item.active { background: rgba(79, 172, 254, 0.05); border-color: var(--neon-blue); }
.queue-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.queue-id { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); }
.queue-obj { font-size: 14px; line-height: 1.5; }

/* ABA 3: WORKSPACE FILES */
.workspace-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; height: 100%; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; overflow-y: auto; height: 100%; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(255, 255, 255, 0.02); border-radius: 6px; cursor: pointer; border: 1px solid transparent; transition: all 0.2s; }
.file-item:hover { background: rgba(255,255,255,0.05); border-color: var(--panel-border); }
.file-icon { font-size: 18px; }
.file-name { font-size: 13px; color: var(--text-primary); word-break: break-all; }
.file-preview-content { height: 100%; overflow-y: auto; background: rgba(5,3,15,0.5); border-radius: 8px; padding: 20px; border: 1px solid var(--panel-border); margin-top: 15px; }

/* Utilities */
.loader-small { width: 20px; height: 20px; border: 2px solid var(--panel-border); border-top-color: var(--neon-cyan); border-radius: 50%; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse-border { 0% { border-color: rgba(255, 145, 0, 0.3); } 50% { border-color: rgba(255, 145, 0, 0.8); } 100% { border-color: rgba(255, 145, 0, 0.3); } }
@keyframes pulse-node { 0% { box-shadow: 0 0 4px var(--neon-orange); } 50% { box-shadow: 0 0 12px var(--neon-orange); } 100% { box-shadow: 0 0 4px var(--neon-orange); } }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.01); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 242, 254, 0.3); }
