
/* AI Chat Layout */
.ai-chat-layout {
    display: flex;
    position: relative;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    background-color: var(--header-bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.3s ease-in-out, opacity 0.3s;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 50;
    transform: translateX(-110%);
    opacity: 0;
}

.sidebar.open {
    transform: translateX(0);
    opacity: 1;
    position: relative;
}

body.light-theme .sidebar {
    background-color: var(--header-bg-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    font-size: 1.2em;
    color: var(--brand-color);
    border-bottom: 1px solid var(--brand-color);
    padding-bottom: 10px;
    margin-top: 0;
}

.sidebar div {
    margin-bottom: 15px;
}

.sidebar label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.sidebar input, .sidebar select, .sidebar textarea, .sidebar button {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #2c2c2c;
    color: #f1f1f1;
    box-sizing: border-box;
}

.sidebar button {
    background-color: var(--brand-color);
    color: #101419;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.sidebar button:hover {
    background-color: #fff;
}

.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-left: 20px;
    height: calc(100vh - 240px); /* Adjust based on header/footer */
    transition: margin-left 0.3s ease-in-out;
}

.chat-container.sidebar-open {
    /* No change needed with this layout */
}

#chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--chat-history-bg-dark);
    border-radius: 8px;
    margin-bottom: 15px;
}

.prompt-container {
    display: flex;
    align-items: stretch;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: #2c2c2c;
}

#prompt {
    flex-grow: 1;
    border: none;
    background: none;
    color: #f1f1f1;
    padding: 15px;
    font-family: 'Fira Code', monospace;
    resize: none;
    height: 50px; /* initial height */
}

#send-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-button svg {
    stroke: var(--brand-color);
    transition: stroke 0.3s;
}

#send-button:hover svg {
    stroke: #fff;
}

.message {
    padding: 12px 18px;
    margin-bottom: 12px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.user-message {
    align-self: flex-end;
    background-color: var(--brand-color);
    color: var(--bg-color-dark);
    border-radius: 15px 15px 0 15px;
    margin-left: auto;
}

.ai-message {
    align-self: flex-start;
    background-color: #2e2e2e;
    border-radius: 15px 15px 15px 0;
}

/* Light theme chat */

body.light-theme #chat-history {
     background-color: var(--chat-history-bg-light);
}

body.light-theme .prompt-container {
    background-color: #fff;
    border: 1px solid #ccc;
}

body.light-theme #prompt {
    color: #333;
}

body.light-theme .sidebar input, 
body.light-theme .sidebar select, 
body.light-theme .sidebar textarea {
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
}

body.light-theme .ai-message {
    background-color: #e9e9eb;
}
