/* OpenAI on Bedrock Demo - Styles */

:root {
    --color-openai: #10a37f;
    --color-openai-hover: #0d8c6d;
    --color-sol: #f97316;
    --color-reasoning: #8b5cf6;
    --color-codex: #06b6d4;
    --color-bg: #0d0d0d;
    --color-surface: #1a1a1a;
    --color-surface-hover: #262626;
    --color-text: #ececec;
    --color-text-muted: #8e8e8e;
    --color-border: #2e2e2e;
    --color-error: #ef4444;
    --color-success: #10b981;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Soehne', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
}

.hidden { display: none !important; }

/* ─── Auth Screen ─────────────────────────────────────────── */
.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 2.5rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.logo h1 { font-size: 1.4rem; font-weight: 600; }
.tagline { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.15rem; }

.auth-form { margin-top: 1.5rem; text-align: left; }
.form-group { margin-bottom: 0.75rem; }

.form-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--color-openai); }
.form-input::placeholder { color: var(--color-text-muted); opacity: 0.6; }

.auth-switch {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-align: center;
}
.auth-switch a { color: var(--color-openai); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.auth-error {
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: var(--color-error);
    font-size: 0.82rem;
    text-align: center;
}

.form-info { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 1rem; text-align: center; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.btn-primary { background: var(--color-openai); color: #fff; }
.btn-primary:hover { background: var(--color-openai-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-surface-hover); color: var(--color-text); }
.btn-large { padding: 0.75rem 2rem; font-size: 0.95rem; }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Header ──────────────────────────────────────────────── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.header-left { display: flex; align-items: center; gap: 0.6rem; }
.header-title { font-weight: 600; font-size: 0.95rem; }
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.user-email { font-size: 0.8rem; color: var(--color-text-muted); }

/* ─── Tabs ────────────────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 0 1.5rem;
    gap: 0;
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.9rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tab:hover { color: var(--color-text); background: var(--color-surface-hover); }
.tab.active { color: var(--color-text); border-bottom-color: var(--color-openai); }
.tab-model { font-size: 0.9rem; font-weight: 600; }
.tab-desc { font-size: 0.72rem; opacity: 0.7; }

/* ─── Main Content ────────────────────────────────────────── */
#main-screen { display: flex; flex-direction: column; min-height: 100vh; }

main {
    flex: 1;
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

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

.tab-hero { margin-bottom: 1.5rem; }
.tab-hero h2 { font-size: 1.4rem; margin: 0.5rem 0 0.4rem; font-weight: 600; }
.description { color: var(--color-text-muted); font-size: 0.87rem; line-height: 1.5; }

/* Model Badges */
.model-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: 'SF Mono', monospace;
    letter-spacing: 0.02em;
}
.badge-sol { background: rgba(249, 115, 22, 0.15); color: var(--color-sol); }
.badge-reasoning { background: rgba(139, 92, 246, 0.15); color: var(--color-reasoning); }
.badge-codex { background: rgba(6, 182, 212, 0.15); color: var(--color-codex); }

/* Codex presets */
.codex-presets {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.preset-btn {
    padding: 0.4rem 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.preset-btn:hover { border-color: var(--color-codex); color: var(--color-codex); }
.preset-btn.active { background: rgba(6, 182, 212, 0.1); border-color: var(--color-codex); color: var(--color-codex); }

/* Textarea */
.textarea-wrapper { margin-bottom: 1rem; }

textarea {
    width: 100%;
    padding: 0.9rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.87rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}
textarea:focus { outline: none; border-color: var(--color-openai); }
textarea::placeholder { color: var(--color-text-muted); opacity: 0.5; }

.actions { display: flex; gap: 0.6rem; }

/* Output */
.output-section {
    margin-top: 2rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.output-header h3 { font-size: 0.85rem; font-weight: 600; }

.output-content {
    padding: 1.5rem;
    line-height: 1.8;
    font-size: 0.9rem;
}
.output-content h1, .output-content h2, .output-content h3 {
    color: var(--color-openai);
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}
.output-content h1:first-child, .output-content h2:first-child, .output-content h3:first-child { margin-top: 0; }
.output-content ul, .output-content ol { padding-left: 1.5rem; margin: 0.4rem 0; }
.output-content li { margin-bottom: 0.25rem; }
.output-content p { margin-bottom: 0.6rem; }
.output-content strong { color: var(--color-text); }
.output-content code {
    background: rgba(16, 163, 127, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.82em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.output-content pre {
    background: #0d0d0d;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}
.output-content pre code {
    background: none;
    padding: 0;
    font-size: 0.82rem;
    line-height: 1.5;
}

.code-output { font-family: 'SF Mono', 'Fira Code', monospace; }

/* Error */
.error-section {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: var(--color-error);
    font-size: 0.85rem;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--color-border);
}
.footer-models {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.footer-badge {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 640px) {
    header { padding: 0.75rem 1rem; }
    .tabs { padding: 0 0.5rem; }
    .tab { padding: 0.7rem 0.5rem; }
    main { padding: 1.25rem 1rem; }
    .codex-presets { flex-wrap: wrap; }
}


/* ─── Model Cards ─────────────────────────────────────────── */
.model-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.model-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}
.model-card:hover { transform: translateY(-2px); }
.card-sol:hover { border-color: var(--color-sol); }
.card-reasoning:hover { border-color: var(--color-reasoning); }
.card-codex:hover { border-color: var(--color-codex); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.card-status {
    font-size: 0.68rem;
    color: var(--color-success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-weight: 500;
}

.model-card h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.card-tagline { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.9rem; }

.card-specs { margin-bottom: 0.75rem; }
.spec {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(46, 46, 46, 0.5);
    font-size: 0.78rem;
}
.spec:last-child { border-bottom: none; }
.spec-label { color: var(--color-text-muted); }
.spec-value { color: var(--color-text); font-weight: 500; text-align: right; max-width: 60%; }

.card-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.highlight {
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    color: var(--color-text-muted);
}

.card-description { font-size: 0.78rem; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 1rem; }

.card-try-btn { margin-top: auto; }

/* Bedrock Info Section */
.bedrock-info {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.bedrock-info h3 { font-size: 1rem; margin-bottom: 1rem; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.info-item strong { display: block; font-size: 0.82rem; margin-bottom: 0.25rem; color: var(--color-openai); }
.info-item p { font-size: 0.78rem; color: var(--color-text-muted); line-height: 1.4; }

/* ─── Sample Prompts ──────────────────────────────────────── */
.sample-prompts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.sample-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
.sample-btn {
    padding: 0.35rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.sample-btn:hover {
    border-color: var(--color-openai);
    color: var(--color-openai);
    background: rgba(16, 163, 127, 0.05);
}
