/* ============================================
   Antigravity Project Factory — Styles
   Premium dark theme with glass morphism
   ============================================ */

:root {
    --bg-primary: #0a0b0f;
    --bg-secondary: #12141c;
    --bg-card: #181b27;
    --bg-glass: rgba(24, 27, 39, 0.7);
    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(99, 102, 241, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-hover: #818cf8;
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.2);
    --warning: #f59e0b;
    --error: #ef4444;
    --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-2: linear-gradient(135deg, #0a0b0f 0%, #12141c 100%);
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background ambient glow */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -15%;
    width: 50%;
    height: 50%;
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.app {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    background: rgba(10, 11, 15, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-icon {
    font-size: 24px;
    animation: float 3s ease-in-out infinite;
}

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

.logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-active);
    color: var(--accent);
    background: var(--accent-glow);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    transition: var(--transition);
}

.status-dot.online { background: var(--success); box-shadow: 0 0 8px var(--success-glow); }

/* Main */
.main {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 24px;
    position: relative;
}

/* Steps */
.step { animation: fadeIn 0.5s ease; }
.step.hidden { display: none; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-header {
    margin-bottom: 32px;
}

.step-number {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    margin-bottom: 8px;
    padding: 4px 12px;
    background: var(--accent-glow);
    border-radius: 20px;
}

.step-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-top: 12px;
    line-height: 1.2;
}

.step-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Textarea */
.input-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.input-container:focus-within {
    border-color: var(--border-active);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    min-height: 140px;
}

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

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.char-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 4px 16px var(--success-glow);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--success-glow);
}

.btn-icon { font-size: 16px; }

/* Analysis Preview */
.analysis-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.8;
}

.analysis-preview h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.analysis-preview .tag {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px 4px;
    background: var(--accent-glow);
    color: var(--accent-hover);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Questions */
.questions-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.question-card:focus-within {
    border-color: var(--border-active);
}

.question-label {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.question-why {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.question-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.question-input:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.question-options {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.option-btn {
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.option-btn:hover, .option-btn.selected {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.questions-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
}

/* Blueprint */
.blueprint-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.blueprint-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    line-height: 1.8;
    font-size: 15px;
    white-space: pre-line;
}

.blueprint-json {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow-x: auto;
}

.blueprint-json pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.blueprint-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
}

/* Loading */
.loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 11, 15, 0.85);
    backdrop-filter: blur(12px);
    z-index: 200;
}

.loading.hidden { display: none; }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 640px) {
    .header { padding: 16px 20px; }
    .main { padding: 32px 16px; }
    .step-header h2 { font-size: 24px; }
    .questions-footer, .blueprint-footer, .input-footer {
        flex-direction: column;
        gap: 12px;
    }
    .btn { width: 100%; justify-content: center; }
}
