/* =========================== */
/* General Body Font           */
/* =========================== */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

/* =========================== */
/* Navigation Styles           */
/* =========================== */

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: rgb(36 143 225); /* Primary orange */
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 98%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-nav-left {
    display: flex;
    align-items: center;
}

.top-nav a {
    color: white;
    font-weight: bold;
    margin: 0 1rem;
    text-decoration: none;
}

.top-nav a:hover {
    text-decoration: underline;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Secondary Navigation */
/* .secondary-nav {
    display: flex;
    justify-content: left;
    align-items: left;
    color: white;
    padding: 0.5rem;
    background-color: #ffa64d; 
    position: fixed;
    top: 55px; 
    left: 0;
    width: 100%;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.secondary-nav a {
    color: white;
    font-weight: bold;
    margin: 0 1rem;
    text-decoration: none;
}

.secondary-nav a:hover {
    text-decoration: underline;
} */

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    color: black;
    list-style: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 2000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu li {
    padding: 0.5rem 0;
}

.dropdown-menu a {
    color: black;
    display: block;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
}

.dropdown-menu a:hover {
    background-color: #f3f4f6;
}

/* =========================== */
/* Content Spacing             */
/* =========================== */

body {
    margin-top: 6.5rem; /* Combined height of top-nav and secondary-nav */
}

/* =========================== */
/* Responsive Navigation Styles */
/* =========================== */

@media (max-width: 768px) {
    .top-nav, .secondary-nav {
        flex-direction: column;
        text-align: center;
    }

    .top-nav a, .secondary-nav a {
        margin: 0.5rem 0;
    }

    .dropdown-menu {
        right: auto;
        left: 0;
        width: 100%;
    }
}

/* =========================== */
/* General Chat Container Styles */
/* =========================== */

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px); /* Adjust to fit under the top and secondary navbars */
    overflow: hidden; /* Prevents the entire container from scrolling */
    /* margin-top: 115px;  */
}

/* =========================== */
/* Header Section              */
/* =========================== */

.chat-header {
    background-color: #f0eeee;
    color: #333;
    text-align: left;
    padding-left: 14px;
    border: 1px solid #d3d3d3; /* Light gray border */
    width: 100%;
    flex-shrink: 0; /* Prevent shrinking when the container resizes */
}

/* =========================== */
/* Question Prompt Section     */
/* =========================== */

.question-box {
    padding: 1rem;
    background-color: #fff;
    border-bottom: 2px solid #ddd;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}

/* =========================== */
/* Chat Messages Section       */
/* =========================== */

.chat-messages {
    flex-grow: 1; /* Allows this section to take the remaining space */
    overflow-y: auto; /* Makes this section scrollable */
    padding: 1rem;
    background-color: #f9f9f9;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-documents-inline {
    text-align: right; /* Right-align the content */
    margin-top: 0.5rem; /* Add spacing below the gray message box */
    font-size: 0.9rem; /* Optional: Make the font size slightly smaller */
}

/* User and Bot Message Styles */
.user-message {
    align-self: flex-end; /* Right-align the chat bubble */
    background-color: #34b5ef; /* Orange */
    color: white;
    padding: 0.75rem;
    border-radius: 10px;
    max-width: 80%; /* Prevent the bubble from being too wide */
    word-wrap: break-word; /* Ensure long text breaks properly */
    text-align: left; /* Right-align the text inside the bubble */
    margin-left: auto; /* Push the bubble to the right */
}

.bot-message {
    align-self: flex-start; /* Left-justified */
    background-color: #e0e0e0;
    color: #333;
    padding: 0.75rem;
    border-radius: 10px;
    max-width: 100%;
    word-wrap: break-word;
    text-align: left; /* Left-align text */
}

/* =========================== */
/* Related Documents Section   */
/* =========================== */

.related-documents {
    margin-top: 2rem; /* Added spacing for better page balance */
    padding: 1rem;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

.document-list {
    display: flex;
    flex-wrap: wrap; /* Wrap links to the next line if they overflow */
    gap: 1rem;
}

.document-list a {
    color: #ff6600;
    text-decoration: none;
    font-weight: bold;
    background-color: #f9f9f9;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.document-list a:hover {
    background-color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* =========================== */
/* Sticky Chat Input Section   */
/* =========================== */

.sticky-input {
    display: flex;
    position: sticky;
    bottom: 0;
    background-color: #fff;
    padding: 1rem;
    border-top: 2px solid #ddd;
    gap: 1rem;
    flex-shrink: 0; /* Prevent shrinking */
}

.chat-textarea {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    resize: none;
}

.send-btn {
    padding: 0.75rem 1.5rem;
    background-color: #707072; /* Orange */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.send-btn:hover {
    background-color: #cc5200; /* Darker orange */
}

/* =========================== */
/* Scrollbar Customization     */
/* =========================== */

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}
