:root {
    --bg-main: #020617;
    --panel-bg: #0f172a;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --ai-primary: #8b5cf6;
    --ai-primary-hover: #7c3aed;
    --user-bg: #1e293b;
}

body.tutor-body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

.tutor-nav {
    height: 60px;
    background: #020617;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.nav-logo { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--ai-primary); }
.ai-status { font-size: 0.85rem; color: #f59e0b; display: flex; align-items: center; gap: 0.5rem; background: rgba(245, 158, 11, 0.1); padding: 0.4rem 0.8rem; border-radius: 99px; }
.ai-status.ready { color: #10b981; background: rgba(16, 185, 129, 0.1); }

.tutor-workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-panel, .chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-panel { width: 60%; border-right: 1px solid var(--border-color); }
.chat-panel { width: 40%; background: var(--panel-bg); }

.panel-header {
    height: 40px;
    background: #020617;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.badge { background: var(--ai-primary); color: #fff; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: 600; }

.editor-container { flex: 1; overflow: hidden; }
.CodeMirror { height: 100% !important; font-family: 'Fira Code', monospace !important; font-size: 14px; }

/* AI Chat UI */
.model-loader { padding: 1rem; background: rgba(139, 92, 246, 0.1); border-bottom: 1px solid var(--ai-primary); text-align: center; font-size: 0.85rem; }
.progress-bar-container { width: 100%; height: 6px; background: #334155; border-radius: 3px; margin: 0.5rem 0; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--ai-primary); transition: width 0.2s; }
.hidden { display: none !important; }

.chat-history { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.message { display: flex; gap: 0.8rem; max-width: 90%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.ai { align-self: flex-start; }

.msg-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 0.9rem; flex-shrink: 0; }
.message.user .msg-avatar { background: var(--border-color); color: #fff; }
.message.ai .msg-avatar { background: var(--ai-primary); color: #fff; }

.msg-bubble { padding: 0.8rem 1rem; border-radius: 8px; font-size: 0.9rem; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; font-family: 'Poppins', sans-serif; }
.message.user .msg-bubble { background: var(--user-bg); color: var(--text-main); border-top-right-radius: 0; }
.message.ai .msg-bubble { background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.3); color: var(--text-main); border-top-left-radius: 0; }
.msg-bubble code { background: #020617; padding: 0.2rem 0.4rem; border-radius: 4px; font-family: 'Fira Code', monospace; font-size: 0.85rem; color: #2dd4bf; }

.chat-input-container { padding: 1rem; border-top: 1px solid var(--border-color); display: flex; gap: 0.5rem; background: #020617; }
.chat-input-container textarea { flex: 1; background: var(--user-bg); border: 1px solid var(--border-color); border-radius: 6px; padding: 0.8rem; color: #fff; font-family: 'Poppins', sans-serif; resize: none; outline: none; }
.chat-input-container textarea:focus { border-color: var(--ai-primary); }
.chat-input-container button { background: var(--ai-primary); color: #fff; border: none; border-radius: 6px; width: 50px; cursor: pointer; transition: background 0.2s; }
.chat-input-container button:hover:not(:disabled) { background: var(--ai-primary-hover); }
.chat-input-container button:disabled { background: var(--border-color); cursor: not-allowed; opacity: 0.5; }
