/* styles.css - Team-C Premium Design System
   Sleek Dark Mode, Modern Typography, Glassmorphism, and Fluid Animations.
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* HSL Color System */
  --bg-main: #060913;
  --bg-surface: rgba(13, 19, 39, 0.45);
  --bg-surface-hover: rgba(22, 33, 62, 0.6);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.15);
  --secondary: #ec4899; /* Pink */
  --accent: #14b8a6; /* Teal */
  --warning: #f59e0b; /* Amber */
  --danger: #ef4444; /* Rose */
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;
  
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Inter', sans-serif;
  
  --blur-radius: 16px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.5);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  padding: 40px 20px;
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(236, 72, 153, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(20, 184, 166, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Grid & Layout Containers */
.container {
  max-width: 1280px;
  margin: 0 auto;
}

/* Glassmorphic Panel Base */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(var(--blur-radius));
  -webkit-backdrop-filter: blur(var(--blur-radius));
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
}

.title-gradient {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 30%, #a5b4fc 70%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.title-pulse {
  width: 14px;
  height: 14px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  display: inline-block;
  animation: pulse-glow 2s infinite;
}

header p {
  color: var(--text-muted);
  font-size: 1.15rem;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

/* Team Roster Grid */
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.agent-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.agent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0.7;
}

.agent-card.agent-1::before { background: #3b82f6; }
.agent-card.agent-2::before { background: #10b981; }
.agent-card.agent-3::before { background: #8b5cf6; }
.agent-card.agent-4::before { background: #ec4899; }
.agent-card.agent-5::before { background: #f59e0b; }

.agent-card:hover {
  transform: translateY(-4px);
  background: var(--bg-surface-hover);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4), 0 0 12px var(--primary-glow);
  border-color: var(--border-active);
}

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

.agent-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dark);
  text-transform: uppercase;
}

.agent-icon {
  font-size: 1.5rem;
}

.agent-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.agent-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.agent-prompt-trigger {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.agent-prompt-trigger:hover {
  text-decoration: underline;
}

/* Control & Process Section */
.control-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

/* Trigger panel */
.trigger-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.text-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.quick-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.topic-tag:hover, .topic-tag.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: #fff;
}

/* Buttons */
.btn-trigger {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  transition: var(--transition-smooth);
  width: 100%;
}

.btn-trigger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
}

.btn-trigger:active:not(:disabled) {
  transform: translateY(0);
}

.btn-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Flow Tracker */
.flow-tracker {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0.5;
  transition: var(--transition-smooth);
}

.flow-step.active {
  opacity: 1;
}

.flow-step.completed {
  opacity: 0.8;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  position: relative;
}

.flow-step.active .step-circle {
  border-color: var(--primary);
  background: var(--bg-main);
  color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.flow-step.completed .step-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-main);
}

.step-info {
  display: flex;
  flex-direction: column;
}

.step-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.step-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.flow-step.active .step-status {
  color: var(--primary);
  font-weight: 500;
}

.flow-step.completed .step-status {
  color: var(--accent);
}

/* Results Showcase Panel */
.tabs-container {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
  overflow-x: auto;
  gap: 4px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: var(--primary);
  border-color: var(--primary);
}

.output-pane {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.output-pane.active {
  display: block;
}

.output-scroll {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  max-height: 550px;
  overflow-y: auto;
}

/* Styled Content Inside Output Scroll */
.output-scroll h3 {
  font-family: var(--font-display);
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.output-scroll p {
  margin-bottom: 12px;
  color: var(--text-main);
}

.output-scroll table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}

.output-scroll th {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 2px solid var(--border-light);
}

.output-scroll td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.output-scroll tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.output-scroll ul, .output-scroll ol {
  margin-left: 20px;
  margin-bottom: 16px;
}

.output-scroll li {
  margin-bottom: 6px;
}

/* Dialog / Modal Styling (Sleek light-dismiss overlay) */
dialog {
  margin: auto;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: #0d1222;
  color: var(--text-main);
  padding: 0;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  outline: none;
}

dialog::backdrop {
  background: rgba(4, 6, 15, 0.85);
  backdrop-filter: blur(10px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.dialog-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.dialog-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dialog-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

.dialog-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.edit-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-textarea {
  width: 100%;
  height: 480px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  font-family: monospace;
  font-size: 0.9rem;
  resize: none;
  outline: none;
  transition: var(--transition-smooth);
}

.editor-textarea:focus {
  border-color: var(--primary);
}

.preview-pane {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  overflow-y: auto;
  height: 480px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  background: rgba(255,255,255,0.01);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: #fff;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background: var(--primary);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background: #4f46e5;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Animations */
@keyframes pulse-glow {
  0% { transform: scale(1); box-shadow: 0 0 12px var(--accent); }
  50% { transform: scale(1.15); box-shadow: 0 0 24px var(--accent), 0 0 8px rgba(20, 184, 166, 0.4); }
  100% { transform: scale(1); box-shadow: 0 0 12px var(--accent); }
}

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

@keyframes bounce-effect {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Responsive Scaling */
@media (max-width: 900px) {
  .control-grid {
    grid-template-columns: 1fr;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .editor-textarea, .preview-pane {
    height: 300px;
  }
  .kanban-board {
    grid-template-columns: 1fr !important;
  }
}

/* Kanban Board Styling */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.kanban-col {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition-smooth);
}

.kanban-col:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.kanban-col-header {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.col-agent {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  position: relative;
  transition: var(--transition-smooth);
}

.kanban-card.active {
  background: rgba(99, 102, 241, 0.03);
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
  animation: card-active-glow 2s infinite ease-in-out;
}

.kanban-card.completed {
  background: rgba(20, 184, 166, 0.03);
  border-color: var(--accent);
  box-shadow: 0 4px 15px rgba(20, 184, 166, 0.1);
}

.kcard-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  max-width: 75%;
}

.kcard-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.kcard-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}

.kcard-badge.todo {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dark);
}

.kcard-badge.active {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  animation: kcard-pulse 1.5s infinite;
}

.kcard-badge.completed {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent);
}

@keyframes kcard-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.scanned-logs {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.scanned-logs div {
  font-size: 0.7rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1.3;
}
