/* Voxyz Stage Styles */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-card: #16161e;
  --text-primary: #e8e8ec;
  --text-secondary: #9898a6;
  --text-muted: #5c5c6e;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #2a2a3a;
  --live-color: #ef4444;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

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

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 24px;
  color: var(--accent);
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-secondary:hover {
  background: var(--bg-tertiary);
}

.btn-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-control:hover {
  background: var(--bg-card);
}

/* Main */
.main {
  padding: 24px 0;
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-item h1 {
  font-size: 28px;
  font-weight: 700;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 20px;
  font-size: 12px;
  color: var(--live-color);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--live-color);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 8px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
}

.tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon {
  font-size: 16px;
}

/* Welcome */
.welcome {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.welcome.collapsed {
  padding: 12px 24px;
}

.welcome.collapsed .welcome-content {
  display: none;
}

.welcome.collapsed::after {
  content: '💡 Click to expand';
  font-size: 12px;
  color: var(--text-muted);
}

.welcome p:first-child {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.welcome .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

/* Skeleton Loading */
.skeleton {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 20px;
}

.skeleton-stat {
  flex: 1;
  height: 60px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton.loaded {
  display: none;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: help;
  transition: all 0.2s;
  padding: 8px 12px;
  border-radius: 6px;
}

.stat:hover {
  background: var(--bg-tertiary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s ease;
}

.stat:hover .stat-value {
  transform: scale(1.1);
}

/* Stats Legend */
.stats-legend {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.stats-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Agent Cards */
.agent-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.agent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  opacity: 0;
  transition: opacity 0.3s;
}

.agent-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.agent-card:hover::before {
  opacity: 1;
}

.agent-card.status-active {
  border-left: 3px solid var(--success);
}

.agent-card.status-active::before {
  background: var(--success);
  opacity: 1;
}

.agent-card.status-idle {
  border-left: 3px solid var(--text-muted);
  opacity: 0.8;
}

.agent-card.expanded {
  grid-column: span 2;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-secondary));
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-avatar {
  width: 48px;
  height: 48px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
}

/* Heartbeat animation for active agents */
.agent-avatar.heartbeat {
  animation: heartbeat 2s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.agent-info {
  flex: 1;
}

.agent-name {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.affect-emoji {
  font-size: 14px;
  cursor: help;
  transition: transform 0.2s;
}

.affect-emoji:hover {
  transform: scale(1.2);
}

.agent-model {
  font-size: 12px;
  color: var(--text-secondary);
}

.agent-task {
  font-size: 13px;
  color: var(--text-primary);
  margin: 8px 0;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: 6px;
}

.agent-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* Card Action Buttons */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.agent-card:hover .card-actions {
  opacity: 1;
  transform: translateY(0);
}

.card-action-btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.card-action-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.agent-thinking {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
  position: relative;
  animation: fadeIn 0.4s ease-out;
}

.agent-thinking::before {
  content: '🧠';
  position: absolute;
  top: -8px;
  left: -8px;
  font-size: 12px;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 10px;
  color: white;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
  font-style: italic;
  line-height: 1.5;
  position: relative;
}

.agent-thinking::before {
  content: '🧠 思考中';
  display: block;
  font-size: 10px;
  color: var(--accent);
  font-style: normal;
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.agent-progress {
  margin: 8px 0;
}

.progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.agent-status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-active {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.status-idle {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.agent-conversations {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.agent-card:hover .agent-conversations,
.agent-card.expanded .agent-conversations {
  max-height: 200px;
  padding-top: 12px;
}

.convo-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.convo-title::before {
  content: '💬';
  font-size: 10px;
}

.convo-item {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 0;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  margin-left: 4px;
  transition: all 0.2s;
}

.convo-item:hover {
  background: rgba(99, 102, 241, 0.1);
  border-left-color: var(--success);
}

/* Mission Progress */
.mission-progress {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

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

.mission-title {
  font-size: 14px;
  color: var(--text-muted);
}

.mission-name {
  font-size: 14px;
  font-weight: 600;
}

.mission-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.mission-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.mission-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* Tab Content */
.tab-content {
  min-height: 400px;
}

.tab-pane {
  display: none;
}

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

/* Feed */
.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-item {
  display: flex;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  align-items: flex-start;
  animation: slideIn 0.3s ease-out;
}

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

.feed-item:nth-child(1) { animation-delay: 0.05s; }
.feed-item:nth-child(2) { animation-delay: 0.1s; }
.feed-item:nth-child(3) { animation-delay: 0.15s; }
.feed-item:nth-child(4) { animation-delay: 0.2s; }
.feed-item:nth-child(5) { animation-delay: 0.25s; }

.feed-item:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  transform: scale(1.01);
}

.feed-time {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 55px;
  font-family: monospace;
}

.feed-agent {
  font-weight: 600;
  min-width: 70px;
  font-size: 13px;
  color: var(--accent);
}

.feed-icon {
  font-size: 16px;
  min-width: 24px;
  text-align: center;
}

.feed-type {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 2px;
}

.feed-content {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

.feed-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.feed-expand {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  text-align: center;
  background: var(--bg-tertiary);
  border-radius: 6px;
  transition: all 0.2s;
}

.feed-expand:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* New event highlight animation */
.feed-item-new {
  animation: newEventPulse 2s ease-in-out;
  border-left: 3px solid var(--success);
}

@keyframes newEventPulse {
  0% { 
    background: rgba(34, 197, 94, 0.2);
    transform: translateX(-5px);
  }
  50% { 
    background: rgba(34, 197, 94, 0.1);
  }
  100% { 
    background: var(--bg-secondary);
    transform: translateX(0);
  }
}

/* Listening */
.listening {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.pulse {
  animation: pulse 1s infinite;
}

/* Tasks */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.task-status {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
}

.task-status.done {
  background: var(--success);
  border-color: var(--success);
}

.task-content {
  flex: 1;
}

.task-title {
  font-size: 14px;
  font-weight: 500;
}

.task-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Social */
.social-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-item {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.social-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.social-agent {
  font-weight: 600;
}

.social-time {
  font-size: 12px;
  color: var(--text-muted);
}

.social-content {
  font-size: 14px;
  line-height: 1.6;
}

.social-likes {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* CTA Banner */
.cta-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.cta-banner span {
  font-size: 14px;
}

.cta-buttons {
  display: flex;
  gap: 8px;
}

.dismiss-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    position: relative;
  }
  
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 0 0 12px 12px;
    border: 1px solid var(--border);
    border-top: none;
    z-index: 100;
  }
  
  .nav.active {
    display: flex;
  }
  
  .nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  
  .nav a:last-child {
    border-bottom: none;
  }
  
  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    margin-right: 12px;
  }
  
  .mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
  }
  
  .mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  
  .header-actions {
    margin-left: auto;
  }
  
  .status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .status-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tabs {
    width: 100%;
    overflow-x: auto;
  }
  
  .agent-cards {
    grid-template-columns: 1fr;
  }
  
  .cta-banner {
    flex-direction: column;
    width: 90%;
    max-width: 400px;
  }
}

/* Mobile menu button hidden on desktop */
@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
}
