:root {
  --nexus-bg: #0a0a0f;
  --nexus-surface: #1a1a24;
  --nexus-elevated: #232331;
  --nexus-cyan: #00f3ff;
  --nexus-purple: #a855f7;
  --nexus-pink: #ec4899;
  --nexus-green: #10b981;
  --nexus-text: #f8fafc;
  --nexus-text-secondary: #cbd5e1;
  --nexus-ai-bg: rgba(16, 185, 129, 0.1);
  --nexus-ai-border: #10b981;
}

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

body {
  background: var(--nexus-bg);
  color: var(--nexus-text);
  font-family: "Inter", system-ui, sans-serif;
  height: 100vh;
  overflow: hidden;
}

.ai-status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--nexus-ai-bg);
  border-bottom: 2px solid var(--nexus-ai-border);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.ai-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--nexus-ai-border);
  animation: pulse 2s infinite;
}

.ai-model-info {
  font-weight: 600;
  color: var(--nexus-ai-border);
}

.ai-loading {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.ai-loading.active {
  display: flex;
}

.ai-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 400px;
  height: 500px;
  background: var(--nexus-surface);
  border: 2px solid var(--nexus-ai-border);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.ai-chat-panel.active {
  display: flex;
}

.ai-chat-header {
  padding: 16px;
  background: rgba(16, 185, 129, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 16px 16px 0 0;
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--nexus-ai-border);
}

.ai-chat-close {
  background: rgba(255, 255, 255, 0.1);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ai-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-message {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.5;
}

.ai-message.user {
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid rgba(0, 243, 255, 0.3);
  align-self: flex-end;
  margin-left: auto;
}

.ai-message.assistant {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  align-self: flex-start;
}

.ai-code-block {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  overflow-x: auto;
}

.ai-chat-input {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--nexus-surface);
  display: flex;
  gap: 12px;
}

.ai-chat-input textarea {
  flex: 1;
  background: var(--nexus-bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  color: var(--nexus-text);
  font-family: inherit;
  resize: none;
  min-height: 60px;
  max-height: 120px;
  outline: none;
}

.ai-chat-input textarea:focus {
  border-color: var(--nexus-ai-border);
}

.ai-send-button {
  background: var(--nexus-ai-border);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.ai-send-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.ai-generate-component {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--nexus-surface);
  border: 2px solid var(--nexus-ai-border);
  border-radius: 16px;
  padding: 32px;
  width: 600px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 10001;
  display: none;
}

.ai-generate-component.active {
  display: block;
}

.ai-prompt-input {
  width: 100%;
  min-height: 120px;
  background: var(--nexus-bg);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  color: var(--nexus-text);
  font-family: inherit;
  font-size: 16px;
  margin: 20px 0;
  resize: vertical;
  outline: none;
}

.ai-generate-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.ai-option {
  padding: 12px;
  background: var(--nexus-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.ai-option:hover {
  border-color: var(--nexus-ai-border);
  transform: translateY(-2px);
}

.ai-option.active {
  background: var(--nexus-ai-bg);
  border-color: var(--nexus-ai-border);
}

.ai-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--nexus-ai-border);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  z-index: 10000;
  transition: transform 0.2s ease;
}

.ai-widget:hover {
  transform: scale(1.1);
}

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--nexus-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  transition: opacity 0.5s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top: 5px solid var(--nexus-ai-border);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.nexus-container {
  display: none;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: var(--nexus-surface);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

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

.nexus-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
}

.nav-item {
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: var(--nexus-text-secondary);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--nexus-text);
}

.nav-item.active {
  background: var(--nexus-ai-border);
  color: white;
}

.ai-sidebar-section {
  margin-top: 30px;
  padding: 16px;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 12px;
}

.ai-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ai-quick-action {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--nexus-ai-border);
  color: var(--nexus-ai-border);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.ai-quick-action:hover {
  background: var(--nexus-ai-border);
  color: white;
  transform: translateY(-1px);
}

.main-content {
  background: var(--nexus-bg);
  padding: 30px;
  overflow-y: auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--nexus-text);
  cursor: pointer;
  display: none;
}

.tabs-header {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.tab-header-item {
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tab-header-item.active {
  background: var(--nexus-ai-bg);
  color: var(--nexus-ai-border);
}

.tab-content .tab-pane {
  display: none;
}

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

.welcome-screen {
  max-width: 900px;
  margin: 0 auto;
}

.welcome-title {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--nexus-ai-border), var(--nexus-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.welcome-subtitle {
  font-size: 18px;
  color: var(--nexus-text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
}

.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.quick-start-card {
  background: var(--nexus-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quick-start-card:hover {
  transform: translateY(-4px);
  border-color: var(--nexus-ai-border);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.ai-prompt-example {
  background: var(--nexus-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: var(--nexus-text-secondary);
}

.ai-prompt-example:hover {
  border-color: var(--nexus-ai-border);
  transform: translateX(4px);
}

.app-canvas {
  position: relative;
  width: 100%;
  height: 600px;
  background: var(--nexus-surface);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.component-palette {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 250px;
  background: var(--nexus-elevated);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.component-item {
  padding: 12px;
  background: var(--nexus-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: grab;
  transition: all 0.2s ease;
  font-size: 14px;
}

.component-item:hover {
  border-color: var(--nexus-ai-border);
  transform: translateY(-2px);
}

.ai-enhanced {
  border-left: 4px solid var(--nexus-ai-border);
}

.ai-code-example {
  background: var(--nexus-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-code-example:hover {
  border-color: var(--nexus-ai-border);
  transform: translateY(-4px);
}

.cli-widget {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 500px;
  background: var(--nexus-surface);
  border: 2px solid var(--nexus-ai-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.cli-widget.active {
  display: flex;
}

.cli-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cli-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--nexus-ai-border);
}

.cli-close {
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cli-body {
  padding: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  max-height: 260px;
  overflow: auto;
}

.cli-command {
  flex: 1;
  margin-left: 8px;
  background: transparent;
  border: none;
  color: var(--nexus-text);
  outline: none;
}

.cli-prompt {
  color: var(--nexus-ai-border);
}

.theme-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--nexus-elevated);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@media (max-width: 768px) {
  .nexus-container {
    grid-template-columns: 1fr;
  }
  .menu-toggle {
    display: block;
  }
}
