/* B"H - VIBE CHAT (The Conversation) */

.vibe-chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 60px;
    scroll-behavior: smooth;
    /* B"H - Scrollbar padding adjustment */
    padding-right: 10px; 
}

.vibe-message {
    max-width: 95%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95em;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    animation: fadeIn 0.15s ease-out; /* Faster anim for instant feel */
}

.vibe-message.user {
    align-self: flex-end;
    background-color: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    border-bottom-right-radius: 2px;
}

.vibe-message.model {
    align-self: flex-start;
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--color-border-accent);
    color: var(--color-text-secondary);
    border-bottom-left-radius: 2px;
    width: 100%;
}

/* Markdown Elements */
.vibe-md-h1, .vibe-md-h2, .vibe-md-h3 { color: var(--neon-cyan); margin: 15px 0 8px 0; font-weight: 700; line-height: 1.2; }
.vibe-md-h1 { font-size: 1.4em; border-bottom: 1px solid var(--color-border); padding-bottom: 5px; }
.vibe-md-h2 { font-size: 1.2em; }
.vibe-md-h3 { font-size: 1.1em; }

.vibe-md-paragraph { margin-bottom: 8px; }
.vibe-md-list { padding-left: 20px; margin: 8px 0; }
.vibe-md-list li { margin-bottom: 4px; }
.vibe-md-strong { color: var(--neon-cyan); font-weight: bold; }
.vibe-md-em { color: var(--neon-lime); font-style: italic; }

/* CODE BLOCKS with Copy Button */
.vibe-code-container {
    background: #0d0f12;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin: 12px 0;
    overflow: hidden;
    position: relative;
}

.vibe-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.75em;
    color: var(--color-text-tertiary);
    font-family: var(--font-ui);
    text-transform: uppercase;
}

.vibe-copy-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.vibe-copy-btn:hover {
    color: var(--neon-cyan);
    background: rgba(0,246,255,0.1);
    border-color: var(--neon-cyan);
}

.vibe-md-code-block {
    padding: 12px;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 0.9em;
    color: #e6e6e6;
    margin: 0;
    white-space: pre; /* Essential for code layout */
}

.vibe-md-inline-code {
    background: rgba(255,255,255,0.1);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: var(--font-code);
    color: var(--neon-lime);
    font-size: 0.9em;
}

/* INPUT AREA LAYOUT FIX */
.vibe-input-area {
    padding: 15px;
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.vibe-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Actions Bar - B"H: Ensure buttons align correctly and wrap if needed */
.vibe-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    flex-wrap: wrap; /* Prevent button cutoff on small widths */
    gap: 10px;
}

.vibe-actions-left {
    display: flex;
    gap: 10px;
}

/* Styling for the new Toggle Button to ensure visibility */
#vibe-sidebar-toggle-btn {
    margin-left: auto; /* Push to right */
    border: 1px solid var(--color-border);
}
#vibe-sidebar-toggle-btn.active {
    background-color: var(--color-bg-tertiary);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.vibe-textarea {
    flex-grow: 1;
    background-color: var(--color-bg-deep);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: white;
    padding: 10px;
    resize: none;
    height: 70px;
    min-height: 40px;
    font-family: var(--font-ui);
    font-size: 0.95em;
    transition: border-color 0.2s;
}
.vibe-textarea:focus {
    border-color: var(--neon-cyan);
    outline: none;
    box-shadow: 0 0 10px var(--glow-cyan);
}

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