/* Additional CSS for the chatbot */
.chatbot-card {
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--black-alpha-10);
    border: none;
    min-height: 70vh;
}

.chat-container {
    height: 80vh;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.chat-input-container {
    background: #f8f9fa;
    border-radius: 0 0 100px 0;
}

.chat-input {
    direction: rtl;
    border: 1px solid #c3c3c3;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    height: 40px;
}

.chat-input:focus {
    box-shadow: none;
    border: 1px solid #a3a3a3;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.user-bubble {
    background: var(--primary-blue-light);
    color: white;
    border-radius: 30px 5px 30px 30px;
    transform: translate(0, 17px);
}

.bot-bubble {
    background: #f1f3f4;
    color: #333;
    border-radius: 5px 30px 30px 30px;
    transform: translate(0, 17px);
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-avatar {
    background: var(--primary-blue);
    color: white;
}

.bot-avatar {
    background: #6c757d;
    color: white;
}

.sidebar-container {
    height: 80vh;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 0 0 0 15px;
}

.sidebar-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.history-item .card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.history-item .card:hover {
    transform: translateX(-2px);
}

.form-check-input:checked {
    background-color: var(--primary-blue-light);
    border-color: var(--primary-blue-light);
}

/* Add this to your chatbot.css */

/* Make the sidebar container use flexbox */
.sidebar-container {
    height: 80vh;
    overflow: hidden; /* Remove overflow-y from here */
    background: #f8f9fa;
    border-radius: 0 0 0 15px;
    display: flex;
    flex-direction: column;
}

/* Make sidebar sections that aren't history take only needed space */
.sidebar-section:not(.history-section) {
    flex-shrink: 0;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

/* Make the history section flexible to fill remaining space */
.sidebar-section.history-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex child with overflow */
}

/* Make the history container fill available space */
.history-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Important for flex child with overflow */
}

/* Remove fixed height from history container */
.history-container {
    /* Remove: height: 250px */
}

@media (max-width: 768px) {
    .sidebar-container {
        height: auto;
        border-start: none !important;
        border-top: 1px solid #dee2e6;
    }
    .chatbot-card {
        min-height: 90vh;
    }

    .chat-container {
        height: auto;
    }

    .chat-messages {
        max-height: 400px;
    }

    .sidebar-container {
        height: auto;
        border-start: none !important;
        border-top: 1px solid #dee2e6;
    }

    .message-bubble {
        max-width: 85%;
    }
}
