/* OpenAgent.Mom — Dark Theme UI */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --bg-input: #16161f;
    --border-color: #2a2a3a;
    --border-light: #333345;
    --text-primary: #e8e8f0;
    --text-secondary: #9898aa;
    --text-muted: #6a6a7a;
    --accent: #6c5ce7;
    --accent-hover: #7c6cf7;
    --accent-dim: rgba(108, 92, 231, 0.15);
    --green: #00d68f;
    --green-hover: #00e69f;
    --green-dim: rgba(0, 214, 143, 0.15);
    --red: #ff6b6b;
    --yellow: #ffd93d;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    color: var(--accent-hover);
}

code {
    font-family: var(--font-mono);
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}

/* ─── Buttons ─── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
}

.btn-large {
    padding: 16px 36px;
    font-size: 1.125rem;
    border-radius: var(--radius);
}

.btn-arrow {
    font-size: 1.2em;
    transition: transform 0.2s;
}
.btn:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-generate {
    background: var(--green);
    color: #0a0a0f;
    font-weight: 600;
    padding: 14px 32px;
    font-size: 1.0625rem;
    border-radius: var(--radius);
    width: 100%;
    justify-content: center;
}
.btn-generate:hover {
    background: var(--green-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 214, 143, 0.4);
}

.btn-download {
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
}
.btn-download:hover {
    background: var(--accent-hover);
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
}
.btn-copy:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-send {
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.btn-send:hover {
    background: var(--accent-hover);
}
.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Logo ─── */

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-dot {
    color: var(--accent);
}

/* ─── Landing Page ─── */

.landing {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
}

.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 24px;
    border: 1px solid rgba(108, 92, 231, 0.3);
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero-highlight {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-price {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.price-tag {
    background: var(--green-dim);
    color: var(--green);
    font-weight: 700;
    font-size: 1rem;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 214, 143, 0.3);
}

.price-note {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ─── How It Works ─── */

.how-it-works {
    padding: 60px 0;
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 40px;
}

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

.step {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px 24px;
    position: relative;
    transition: border-color 0.2s;
}
.step:hover {
    border-color: var(--accent);
}

.step-number {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
}

.step-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.step h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ─── What is OpenClaw ─── */

.what-is-openclaw {
    padding: 40px 0 80px;
}

.what-is-openclaw h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.info-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.info-card strong {
    color: var(--text-primary);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.file-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-input);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.file-item code {
    background: none;
    padding: 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.875rem;
}

.file-item span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ─── Footer ─── */

.landing-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ─── Wizard Page ─── */

.wizard-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100dvh;
}

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

/* ─── Progress Bar ─── */

.progress-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s;
}

.progress-step.active .step-dot {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(108, 92, 231, 0.5);
}

.progress-step.completed .step-dot {
    background: var(--green);
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-step.active .step-label {
    color: var(--text-primary);
}

.progress-step.completed .step-label {
    color: var(--green);
}

.progress-line {
    width: 24px;
    height: 2px;
    background: var(--border-color);
}

/* ─── Chat Container ─── */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* ─── Chat Messages ─── */

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

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

.message-ai {
    align-self: flex-start;
}

.message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.message-ai .message-avatar {
    background: var(--accent-dim);
}

.message-user .message-avatar {
    background: var(--green-dim);
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    line-height: 1.6;
    word-break: break-word;
}

.message-ai .message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
}

.message-user .message-bubble {
    background: var(--accent);
    color: #fff;
    border-top-right-radius: 4px;
}

.message-bubble p {
    margin-bottom: 8px;
}
.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble strong {
    font-weight: 600;
}

.message-bubble ul, .message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin-bottom: 4px;
}

.message-bubble code {
    background: rgba(255,255,255,0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.85em;
}

.message-ai .message-bubble code {
    background: var(--bg-input);
}

/* ─── Typing Indicator ─── */

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── Chat Input ─── */

.chat-input-area {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.chat-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9375rem;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s;
}

#chatInput:focus {
    border-color: var(--accent);
}

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

/* ─── Generate Bar ─── */

.generate-bar {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    text-align: center;
}

.generate-price {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ─── Payment Options ─── */

.payment-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.btn-stripe-pay {
    background: var(--green);
    color: #0a0a0f;
    font-weight: 600;
    padding: 14px 32px;
    font-size: 1.0625rem;
    border-radius: var(--radius);
    width: 100%;
    justify-content: center;
}
.btn-stripe-pay:hover {
    background: var(--green-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 214, 143, 0.4);
}
.btn-stripe-pay:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.paypal-divider {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.paypal-divider::before,
.paypal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

#paypalButtonContainer {
    width: 100%;
    min-height: 45px;
}

/* ─── File Preview ─── */

.file-preview {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.preview-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.preview-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 24px 0;
    overflow-x: auto;
    flex-shrink: 0;
}

.preview-tab {
    padding: 8px 16px;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.preview-tab:hover {
    color: var(--text-secondary);
}

.preview-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    position: relative;
}

.preview-content pre {
    margin: 0;
}

.preview-content code {
    background: none;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.7;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

.preview-content .btn-copy {
    position: absolute;
    top: 16px;
    right: 24px;
}

/* ─── Loading / Generating Overlay ─── */

.generating-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.generating-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    max-width: 400px;
}

.generating-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}

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

.generating-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.generating-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ─── Error Toast ─── */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--red);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    color: var(--red);
    font-size: 0.875rem;
    z-index: 200;
    animation: slideUp 0.3s ease;
    max-width: 400px;
}

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

/* ─── Responsive ─── */

@media (max-width: 768px) {
    .hero {
        padding: 48px 0 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    .wizard-nav {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .progress-bar {
        width: 100%;
        justify-content: center;
    }

    .step-label {
        display: none;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-input-area {
        padding: 12px 16px 16px;
    }

    .message {
        max-width: 92%;
    }

    .files-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .preview-tabs {
        padding: 8px 16px 0;
    }
}

@media (max-width: 480px) {
    .files-grid {
        grid-template-columns: 1fr;
    }

    .progress-line {
        width: 12px;
    }
}

/* ─── Scrollbar ─── */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ─── New Session Button ─── */

.btn-new-session {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn-new-session:hover {
    border-color: var(--accent);
    color: var(--accent);
}
