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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #1a1a2e;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 18px;
    color: #00d4ff;
}

.status {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 12px;
}

.status.connected {
    background: #0d4b2e;
    color: #4ade80;
}

.status.disconnected {
    background: #4b1d1d;
    color: #f87171;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state .hint {
    font-size: 13px;
    margin-top: 8px;
}

.msg {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

.msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.msg-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.msg-time {
    font-size: 11px;
    color: #666;
}

.msg-body {
    padding: 12px 16px;
    border-radius: 8px;
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Transcription - interviewer/user speech */
.msg.transcription .msg-tag {
    background: #1e3a5f;
    color: #60a5fa;
}

.msg.transcription .msg-body {
    background: #1a1a2e;
    border-left: 3px solid #60a5fa;
}

/* AI Answer */
.msg.answer .msg-tag {
    background: #1a3d2e;
    color: #4ade80;
}

.msg.answer .msg-body {
    background: #1a2e1a;
    border-left: 3px solid #4ade80;
}

.msg.answer .msg-question {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    font-style: italic;
}

/* Algorithm solution */
.msg.algorithm .msg-tag {
    background: #3d2e1a;
    color: #fbbf24;
}

.msg.algorithm .msg-body {
    background: #2e2a1a;
    border-left: 3px solid #fbbf24;
}

.msg.algorithm .msg-problem {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444;
}

/* Error */
.msg.error .msg-tag {
    background: #4b1d1d;
    color: #f87171;
}

.msg.error .msg-body {
    background: #2e1a1a;
    border-left: 3px solid #f87171;
}

/* Screenshot info */
.msg.screenshot .msg-tag {
    background: #3d1a3d;
    color: #c084fc;
}

.msg.screenshot .msg-body {
    background: #2e1a2e;
    border-left: 3px solid #c084fc;
}

footer {
    padding: 12px 20px;
    border-top: 1px solid #333;
    background: #1a1a2e;
}

.toolbar {
    display: flex;
    gap: 8px;
}

footer button {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

footer button:hover {
    background: #444;
}

.mic-btn {
    flex: 1;
    font-size: 14px !important;
}

.mic-btn.recording {
    background: #4b1d1d !important;
    border-color: #f87171 !important;
    color: #f87171 !important;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Code blocks in algorithm solutions */
.msg-body code {
    background: #2a2a3e;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 13px;
}

.msg-body pre {
    background: #1a1a2e;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.msg-body pre code {
    background: none;
    padding: 0;
}
