:root {
  --bg-primary: #0a0b0e;
  --bg-secondary: #12141c;
  --glass-bg: rgba(20, 24, 38, 0.6);
  --glass-border: rgba(255, 255, 255, 0.06);
  --text-primary: #f1f3f9;
  --text-secondary: #949aab;
  
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.4);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.4);
  
  --status-online: #10b981;
  --status-offline: #ef4444;
  --status-warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.glass-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: float 3s ease-in-out infinite;
}

.logo-area h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Badges */
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-badge.online .status-dot {
  background-color: var(--status-online);
  box-shadow: 0 0 10px var(--status-online);
}

.status-badge.offline .status-dot {
  background-color: var(--status-offline);
  box-shadow: 0 0 10px var(--status-offline);
}

/* Layout Main */
.app-main {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.chat-section {
  grid-row: span 2;
}

.panel-section {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.panel-header .subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Chat Log */
.chat-log {
  flex-grow: 1;
  min-height: 350px;
  max-height: 500px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.message {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
  font-size: 14px;
  word-wrap: break-word;
}

.message.system {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  align-self: center;
  text-align: center;
  font-size: 12px;
  max-width: 100%;
}

.message.user {
  background: linear-gradient(135deg, var(--accent-purple), #6d28d9);
  color: #fff;
  align-self: flex-end;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.message.agent {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  align-self: flex-start;
}

/* Input Area */
.chat-input-area {
  display: flex;
  gap: 10px;
}

.chat-input-area input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.chat-input-area input:focus {
  border-color: var(--accent-purple);
}

.glow-btn {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.glow-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.glow-btn:active {
  transform: translateY(1px);
}

/* Plans Card */
.plan-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.plan-empty-state {
  text-align: center;
  color: var(--text-secondary);
}

.plan-empty-state .icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.plan-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-details h3 {
  font-size: 16px;
  font-weight: 600;
}

.plan-details p {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.plan-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.plan-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.plan-btn.approve {
  background: var(--status-online);
  color: #fff;
}

.plan-btn.approve:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.plan-btn.reject {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--status-offline);
}

.plan-btn.reject:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-height: 150px;
  max-height: 300px;
  overflow-y: auto;
}

.project-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  cursor: pointer;
}

.project-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
  border-color: rgba(139, 92, 246, 0.3);
}

.project-card.selected {
  background: rgba(139, 92, 246, 0.08);
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px var(--accent-purple-glow);
}

.project-info h4 {
  font-size: 14px;
  font-weight: 500;
}

.project-info .git-info {
  font-size: 11px;
  color: var(--text-secondary);
}

.project-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

/* Spinner */
.loading-spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Responsive */
@media (max-width: 768px) {
  .app-main {
    grid-template-columns: 1fr;
  }
  
  .chat-section {
    grid-row: auto;
    order: 2;
  }
  
  .plan-section {
    order: 1;
  }
  
  .status-section {
    order: 3;
  }
}
