:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --background: #0a0a0f;
    --surface: #15151f;
    --surface-light: #1f1f2e;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border: #27272a;
    --success: #10b981;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 15px;
}

.nav a:hover {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 70px;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

/* App Section */
.app-section {
    min-height: 100vh;
    padding-top: 70px;
}

.app-layout {
    display: flex;
    height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.new-project-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.new-project-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.projects-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.project-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.project-item:hover {
    background: var(--surface-light);
}

.project-item.active {
    background: var(--primary);
}

.project-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.project-date {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.prompt-section {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.prompt-section h2 {
    font-size: 24px;
    margin-bottom: 16px;
}

.prompt-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#promptInput {
    flex: 1;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    min-height: 100px;
}

#promptInput:focus {
    outline: none;
    border-color: var(--primary);
}

.generate-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.2s;
}

.generate-btn:hover {
    transform: translateY(-1px);
}

/* Preview Section */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.tab:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    flex: 1;
    position: relative;
}

.tab-pane {
    display: none;
    height: 100%;
    position: relative;
}

.tab-pane.active {
    display: block;
}

#previewFrame {
    width: 100%;
    height: 100%;
    background: white;
}

pre {
    margin: 0;
    height: 100%;
    overflow: auto;
    background: var(--background);
}

code {
    display: block;
    padding: 24px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e5e7eb;
}

.copy-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Features Section */
.features {
    padding: 120px 0;
    background: var(--surface);
}

.section-title {
    font-size: 42px;
    text-align: center;
    margin-bottom: 64px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.feature-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    transition: transform 0.3s, border-color 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* How it works */
.how-it-works {
    padding: 120px 0;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
    margin-top: 64px;
}

.step {
    text-align: center;
}

.step-number {
    width: 64px;
    height: 64px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 24px;
}

.step h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.step p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Footer */
.footer {
    padding: 48px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .nav {
        display: none;
    }

    .prompt-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .generate-btn {
        justify-content: center;
    }
}

