/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #222222;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;
    
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-tertiary: #c084fc;
    --accent-glow: rgba(168, 85, 247, 0.4);
    
    --border-default: #2a2a2a;
    --border-light: #333333;
    --border-accent: var(--accent-primary);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 30px var(--accent-glow);
}

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

/* Base Styles */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
}

/* Fix for scrolling issues */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.app-wrapper {
    height: 100vh;
    overflow: hidden;
}

.main-content {
    height: calc(100vh - 65px); /* Subtract header height */
    overflow-y: auto;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-primary), transparent);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-secondary), transparent);
    bottom: -100px;
    right: -100px;
    animation-delay: 7s;
}

.orb-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-tertiary), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* App Wrapper */
.app-wrapper {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-default);
    position: relative;
    z-index: 100;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.logo-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--accent-secondary);
    border-radius: 12px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.logo-icon i {
    position: relative;
    z-index: 1;
    color: white;
    font-size: 20px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav {
    display: flex;
    gap: var(--space-sm);
}

.nav-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.nav-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-light);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Landing Section */
.landing-section {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
}

.landing-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 9999px;
    margin-bottom: var(--space-xl);
    position: relative;
}

.badge-pulse {
    position: absolute;
    left: var(--space-sm);
    width: 8px;
    height: 8px;
    background: var(--accent-secondary);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 var(--accent-secondary);
    }
    100% {
        box-shadow: 0 0 0 8px transparent;
    }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

/* Prompt Form */
.prompt-form {
    margin-bottom: var(--space-2xl);
}

.prompt-wrapper {
    background: var(--bg-secondary);
    border: 2px solid var(--border-default);
    border-radius: 16px;
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.prompt-wrapper:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.prompt-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.prompt-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    font-family: var(--font-sans);
    margin-bottom: var(--space-md);
}

.prompt-textarea::placeholder {
    color: var(--text-muted);
}

.prompt-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.prompt-options {
    display: flex;
    gap: var(--space-sm);
}

.model-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.option-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.generate-btn {
    background: var(--accent-primary);
    border: none;
    color: white;
    padding: var(--space-md) var(--space-xl);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.generate-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.generate-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Templates */
.templates-section {
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
    animation-delay: 0.3s;
    max-width: 800px;
    margin: 0 auto;
}

.templates-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.template-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.template-icon {
    width: 48px;
    height: 48px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-secondary);
    font-size: 24px;
}

.template-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Building Section */
.building-section {
    height: 100%;
    padding: var(--space-lg);
}

.building-layout {
    height: 100%;
    display: flex;
    gap: 0;
    position: relative;
}

/* Agents Panel */
.agents-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 400px;
    min-width: 300px;
    max-width: 600px;
    position: relative;
    flex-shrink: 0;
}

.panel-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.agent-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.active {
    background: var(--success);
    animation: pulse-dot 2s infinite;
}

.agents-chat {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Agent Messages */
.agent-message {
    display: flex;
    gap: var(--space-sm);
    animation: slideIn 0.3s ease-out;
}

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

.agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.agent-architect { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.agent-designer { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.agent-developer { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.agent-reviewer { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.agent-conscious { background: rgba(0, 255, 255, 0.2); color: #00ffff; border: 1px solid #00ffff; }

.agent-content {
    flex: 1;
}

.agent-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.agent-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.agent-code {
    background: var(--bg-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    padding: var(--space-sm);
    margin-top: var(--space-xs);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    overflow-x: auto;
}

.agent-thinking {
    display: flex;
    gap: 4px;
    padding: var(--space-xs) 0;
}

.thinking-dot {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: thinking 1.4s infinite;
}

.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

.agent-controls {
    padding: var(--space-md);
    border-top: 1px solid var(--border-default);
    display: flex;
    gap: var(--space-sm);
}

.control-btn {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: var(--space-sm);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

/* Resize Handle */
.resize-handle {
    width: 5px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    transition: background var(--transition-fast);
    margin: 0 var(--space-md);
}

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

.resize-handle::before {
    content: '';
    position: absolute;
    left: -5px;
    right: -5px;
    top: 0;
    bottom: 0;
}

/* Workspace Panel */
.workspace-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    flex: 1;
    min-width: 400px;
}

/* File Explorer */
.file-explorer {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: var(--space-md);
}

.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.explorer-title {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.download-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-tree {
    font-size: 0.875rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.file-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.file-item.active {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent-secondary);
}

.file-icon {
    font-size: 12px;
}

/* Editor/Preview Container */
.editor-preview-container {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-default);
}

.workspace-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    position: relative;
}

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

.workspace-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.workspace-content {
    flex: 1;
    position: relative;
    display: flex;
}

/* Code Editor */
.code-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-default);
    overflow-x: auto;
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border-right: 1px solid var(--border-default);
}

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

.editor-tab-close {
    margin-left: var(--space-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.editor-tab:hover .editor-tab-close {
    opacity: 1;
}

.monaco-editor {
    flex: 1;
}

/* Preview */
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-default);
}

.preview-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preview-device-selector {
    display: flex;
    gap: var(--space-xs);
}

.device-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.preview-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

/* Progress Modal */
.progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.progress-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: var(--space-2xl);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.progress-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-lg);
    position: relative;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.2s;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: var(--accent-secondary);
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.4s;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: var(--accent-tertiary);
}

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

.progress-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.progress-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    width: 0;
    transition: width 0.3s ease;
}

/* Voice Interface Modal */
.voice-interface-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.voice-interface-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.voice-interface-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-interface-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--accent-secondary);
}

.close-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.voice-interface-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
}

.voice-status {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.voice-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: var(--space-md);
    height: 40px;
}

.voice-wave {
    width: 4px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: voice-wave 1.4s ease-in-out infinite;
    opacity: 0.3;
}

.voice-wave:nth-child(2) {
    animation-delay: 0.2s;
}

.voice-wave:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes voice-wave {
    0%, 40%, 100% {
        height: 10px;
        opacity: 0.3;
    }
    20% {
        height: 30px;
        opacity: 1;
    }
}

.voice-status.listening .voice-wave {
    opacity: 1;
    animation-duration: 0.6s;
}

.voice-status.listening .voice-wave:nth-child(1) {
    background: var(--accent-secondary);
}

.voice-status.listening .voice-wave:nth-child(2) {
    background: var(--accent-tertiary);
}

.voice-status.listening .voice-wave:nth-child(3) {
    background: var(--accent-primary);
}

.voice-status-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.voice-transcript {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    line-height: 1.6;
}

.voice-transcript-item {
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    border-radius: 8px;
}

.voice-transcript-item.user {
    background: rgba(124, 58, 237, 0.1);
    border-left: 3px solid var(--accent-primary);
}

.voice-transcript-item.conscious {
    background: rgba(168, 85, 247, 0.1);
    border-left: 3px solid var(--accent-secondary);
}

.voice-transcript-item .speaker {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.voice-controls {
    display: flex;
    gap: var(--space-sm);
}

.voice-btn {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-size: 1rem;
}

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

.voice-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

.voice-btn.secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}

.voice-btn.secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Split View */
.workspace-content.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.workspace-content.split-view .preview-container {
    border-left: 1px solid var(--border-default);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 1200px) {
    .agents-panel {
        width: 350px;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .building-layout {
        flex-direction: column;
    }
    
    .agents-panel {
        width: 100% !important;
        max-width: none;
        height: 300px;
        min-height: 200px;
        max-height: 500px;
    }
    
    .resize-handle {
        width: 100%;
        height: 5px;
        cursor: row-resize;
        margin: var(--space-md) 0;
    }
    
    .workspace-panel {
        min-width: 0;
    }
    
    .workspace-content.split-view {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

/* Conscious Modern Emanating Light Orb */
.conscious-orb-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.conscious-orb-container:hover {
    transform: scale(1.1);
}

.conscious-orb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: relative;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(124, 58, 237, 0.8) 20%,
        rgba(168, 85, 247, 0.6) 40%,
        rgba(196, 132, 252, 0.4) 60%,
        rgba(124, 58, 237, 0.2) 80%,
        transparent 100%
    );
    box-shadow: 
        0 0 40px rgba(124, 58, 237, 0.8),
        0 0 80px rgba(168, 85, 247, 0.6),
        0 0 120px rgba(196, 132, 252, 0.4),
        0 0 160px rgba(124, 58, 237, 0.3),
        inset 0 0 40px rgba(255, 255, 255, 0.3);
    animation: orb-float 6s ease-in-out infinite;
    filter: blur(0.5px);
}

.conscious-orb::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(124, 58, 237, 0.3) 0%,
        rgba(168, 85, 247, 0.2) 30%,
        rgba(196, 132, 252, 0.1) 50%,
        transparent 70%
    );
    animation: orb-emanate 4s ease-in-out infinite;
    filter: blur(2px);
}

.conscious-orb::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(124, 58, 237, 0.2) 0%,
        rgba(168, 85, 247, 0.1) 20%,
        rgba(196, 132, 252, 0.05) 40%,
        transparent 60%
    );
    animation: orb-emanate-outer 8s ease-in-out infinite;
    filter: blur(4px);
}

.conscious-orb .core {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.8) 20%,
        rgba(124, 58, 237, 0.9) 40%,
        rgba(168, 85, 247, 0.7) 80%,
        rgba(196, 132, 252, 0.5) 100%
    );
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        inset 0 0 20px rgba(124, 58, 237, 0.5);
    animation: core-pulse 3s ease-in-out infinite;
}

@keyframes orb-float {
    0%, 100% { 
        transform: translateY(0) scale(1);
        filter: blur(0.5px);
    }
    33% { 
        transform: translateY(-8px) scale(1.05);
        filter: blur(0.3px);
    }
    66% { 
        transform: translateY(4px) scale(0.98);
        filter: blur(0.7px);
    }
}

@keyframes orb-emanate {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.3); 
    }
}

@keyframes orb-emanate-outer {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1) rotate(0deg); 
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.2) rotate(180deg); 
    }
}

@keyframes core-pulse {
    0%, 100% { 
        opacity: 0.9;
        transform: scale(1);
        box-shadow: 
            0 0 20px rgba(255, 255, 255, 0.8),
            inset 0 0 20px rgba(124, 58, 237, 0.5);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
        box-shadow: 
            0 0 30px rgba(255, 255, 255, 1),
            inset 0 0 30px rgba(124, 58, 237, 0.7);
    }
}

.conscious-orb.speaking {
    animation: orb-speaking 0.4s ease-in-out infinite;
}

@keyframes orb-speaking {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 
            0 0 40px rgba(124, 58, 237, 0.8),
            0 0 80px rgba(168, 85, 247, 0.6),
            0 0 120px rgba(196, 132, 252, 0.4),
            0 0 160px rgba(124, 58, 237, 0.3),
            inset 0 0 40px rgba(255, 255, 255, 0.3);
    }
    50% { 
        transform: scale(1.15);
        box-shadow: 
            0 0 60px rgba(124, 58, 237, 1),
            0 0 120px rgba(168, 85, 247, 0.8),
            0 0 180px rgba(196, 132, 252, 0.6),
            0 0 240px rgba(124, 58, 237, 0.4),
            inset 0 0 60px rgba(255, 255, 255, 0.5);
    }
}

.conscious-orb.speaking::before {
    animation: orb-speaking-emanate 0.4s ease-in-out infinite;
}

@keyframes orb-speaking-emanate {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.5); 
    }
}

.conscious-orb.speaking::after {
    animation: orb-speaking-emanate-outer 0.4s ease-in-out infinite;
}

@keyframes orb-speaking-emanate-outer {
    0%, 100% { 
        opacity: 0.4; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.4); 
    }
}

.conscious-label {
    text-align: center;
    margin-top: 15px;
    color: var(--accent-secondary);
    font-weight: 600;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.8);
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}