/* QueenAI Enablement — Minimal CSS */
:root {
    --bg: #f8f9fa;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #e0e0e0;
    --card-bg: #ffffff;
    --primary: #4a90d9;
    --primary-hover: #357abd;
    --text: #333;
    --text-light: #666;
    --border: #e0e0e0;
    --user-bg: #e3f2fd;
    --assistant-bg: #f5f5f5;
    --error-bg: #ffebee;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); height: 100vh; overflow: hidden; }

/* Login */
.login-screen { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.login-card { background: var(--card-bg); border-radius: 12px; padding: 2.5rem; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-icon { font-size: 3rem; }
.login-header h1 { font-size: 1.8rem; color: var(--text); margin: 0.5rem 0 0.25rem; }
.login-header p { color: var(--text-light); font-size: 0.9rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--text); }
.form-group input { width: 100%; padding: 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; }
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,144,217,0.15); }
.btn-primary { width: 100%; padding: 0.75rem; background: var(--primary); color: white; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 500; cursor: pointer; margin-top: 0.5rem; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.error-msg { color: #d32f2f; font-size: 0.85rem; margin-top: 0.75rem; padding: 0.5rem; background: var(--error-bg); border-radius: var(--radius); }

/* App layout */
.app-container { display: flex; height: 100vh; }

/* Sidebar */
.sidebar { width: 300px; background: var(--sidebar-bg); color: var(--sidebar-text); padding: 1.25rem; overflow-y: auto; flex-shrink: 0; transition: margin-left 0.3s; }
.sidebar.collapsed { margin-left: -300px; }
.sidebar-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.sidebar-header span { font-size: 1.5rem; }
.sidebar-header h2 { flex: 1; font-size: 1.2rem; }
.sidebar-toggle { background: none; border: none; color: var(--sidebar-text); font-size: 1.2rem; cursor: pointer; padding: 0.25rem; }
.sidebar-toggle-open { background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: 0.25rem 0.5rem; display: none; }
.sidebar.collapsed ~ .main-content .sidebar-toggle-open { display: block; }
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-section h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; color: #aaa; }
.sidebar select, .sidebar textarea { width: 100%; padding: 0.5rem; border: 1px solid #333; border-radius: var(--radius); background: #16213e; color: var(--sidebar-text); font-size: 0.85rem; font-family: inherit; }
.sidebar textarea { resize: vertical; min-height: 60px; }
.sidebar select:focus, .sidebar textarea:focus { outline: none; border-color: var(--primary); }
.prompt-presets { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.75rem; background: #16213e; color: var(--sidebar-text); border: 1px solid #333; border-radius: 4px; cursor: pointer; }
.btn-small:hover { background: #1f2b45; }
.model-info { font-size: 0.8rem; color: #888; margin-top: 0.3rem; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.metric { background: #16213e; padding: 0.5rem; border-radius: var(--radius); }
.metric-label { display: block; font-size: 0.7rem; color: #888; }
.metric-value { display: block; font-size: 0.95rem; font-weight: 600; color: #e0e0e0; }
.session-info { font-size: 0.8rem; color: #888; margin-bottom: 0.5rem; }
.btn-secondary { width: 100%; padding: 0.5rem; background: transparent; color: var(--sidebar-text); border: 1px solid #333; border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; margin-top: 0.4rem; }
.btn-secondary:hover { background: #16213e; }

/* Mode tabs */
.mode-tabs { display: flex; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid #333; }
.mode-tab { flex: 1; padding: 0.5rem; background: #16213e; color: var(--sidebar-text); border: none; cursor: pointer; font-size: 0.85rem; text-align: center; }
.mode-tab.active { background: var(--primary); color: white; }
.mode-tab:hover:not(.active) { background: #1f2b45; }

/* Pattern selector */
.pattern-list { display: flex; flex-direction: column; gap: 0.4rem; }
.pattern-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; }
.pattern-option:hover { background: #16213e; }
.pattern-option input[type="radio"] { accent-color: var(--primary); }
.flow-diagram { background: #16213e; padding: 0.5rem; border-radius: var(--radius); font-size: 0.75rem; line-height: 1.4; color: #aaa; white-space: pre; overflow-x: auto; }
.toggle-row { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.85rem; }
.toggle-row input[type="checkbox"] { accent-color: var(--primary); }

/* Mode badge in top bar */
.mode-badge { font-size: 0.75rem; color: white; background: var(--primary); padding: 0.2rem 0.6rem; border-radius: 12px; }
.hint { color: #999; font-size: 0.9rem; }

/* Architecture cards */
.arch-card { background: #f0f4f8; border: 1px solid #d0d8e0; border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem auto; max-width: 600px; text-align: left; }
.arch-card h3 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--text); }
.arch-diagram { background: #1e1e1e; color: #a8d8a8; padding: 0.75rem; border-radius: var(--radius); font-size: 0.8rem; line-height: 1.5; white-space: pre; overflow-x: auto; margin-bottom: 0.75rem; }
.arch-note { font-size: 0.85rem; color: #555; margin-bottom: 0.5rem; line-height: 1.4; }
.arch-note:last-child { margin-bottom: 0; }

/* Main content */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--card-bg); }
.top-bar h1 { flex: 1; font-size: 1.2rem; }
.user-badge { font-size: 0.8rem; color: var(--text-light); background: #e8f0fe; padding: 0.25rem 0.75rem; border-radius: 12px; }

/* Chat messages */
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; }
.welcome-msg { text-align: center; padding: 3rem 1rem; }
.welcome-msg h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.welcome-msg p { color: var(--text-light); margin-bottom: 1.5rem; }
.example-questions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.example-q { padding: 0.5rem 1rem; background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; cursor: pointer; font-size: 0.85rem; color: var(--text); }
.example-q:hover { border-color: var(--primary); color: var(--primary); }

.message { margin-bottom: 1rem; display: flex; gap: 0.75rem; max-width: 800px; }
.message.user { margin-left: auto; 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; }
.message.user .message-avatar { background: #e3f2fd; }
.message.assistant .message-avatar { background: #e8f5e9; }
.message-body { padding: 0.75rem 1rem; border-radius: var(--radius); max-width: 700px; line-height: 1.5; font-size: 0.95rem; }
.message.user .message-body { background: var(--user-bg); border-bottom-right-radius: 2px; }
.message.assistant .message-body { background: var(--assistant-bg); border-bottom-left-radius: 2px; }
.message-body p { margin-bottom: 0.5rem; }
.message-body p:last-child { margin-bottom: 0; }
.message-body pre { background: #1e1e1e; color: #d4d4d4; padding: 0.75rem; border-radius: var(--radius); overflow-x: auto; margin: 0.5rem 0; font-size: 0.85rem; }
.message-body code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.85em; }
.message-body code:not(pre code) { background: #e8e8e8; padding: 0.1rem 0.3rem; border-radius: 3px; }
.message-body table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; font-size: 0.85rem; }
.message-body th, .message-body td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; }
.message-body th { background: #f0f0f0; font-weight: 600; }
.message-meta { font-size: 0.75rem; color: #999; margin-top: 0.4rem; }
.message.error .message-body { background: var(--error-bg); color: #c62828; }

.typing-indicator { display: flex; gap: 0.3rem; padding: 0.75rem 1rem; }
.typing-dot { width: 8px; height: 8px; background: #999; border-radius: 50%; animation: typing 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* Input area */
.input-area { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); background: var(--card-bg); }
.input-row { display: flex; gap: 0.5rem; align-items: flex-end; }
.input-row textarea { flex: 1; padding: 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; font-family: inherit; resize: none; max-height: 150px; line-height: 1.4; }
.input-row textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,144,217,0.15); }
.btn-send { width: 40px; height: 40px; background: var(--primary); color: white; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-send:hover { background: var(--primary-hover); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }
