/* Custom sharepoint css start */
#s4-ribbonrow {
    display: none !important;
}

#suiteBarDelta {
    display: none !important;
}

#s4-titlerow {
    display: none !important;
}

#sideNavBox,
#pageStatusBar {
    display: none !important;
}

#contentBox {
    margin: 0 !important;
}

.ms-core-overlay {
    background-color: rgba(255, 255, 255, 0) !important;
}

#s4-workspace {
    width: 100vw !important;
    height: 100% !important;
    overflow: none !important;
    position: none !important;
}

#s4-bodyContainer {
    padding-bottom: 0;
}

#contentRow {
    padding-top: 0 !important;
}

/* Custom sharepoint css end */

:root {
    --bg-primary: #fff;
    --bg-secondary: #fafafa;
    --logo-text: #000;
    --separator: #d9d9d9;
    --btn-hover: #f0efef;
    --btn-active: #e5e5e5;
    --item-text: #5c5e64;
    --item-hover: #f5f4f4;
    --item-active-bg: #e1f7b0;
    --item-active-text: #82AD1C;
    --tooltip-bg: #000;
    --tooltip-text: #fff;
    --switch-bg: #f0f0f0;
    --switch-active: #fff;
    --primary-color: #94c129;
    --primary-light: #e1f7b0;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --chat-bg: #f7f7f8;
    --user-bubble: #ffffff;
    --ai-bubble: #f7f7f8;
    --input-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    font-family: "Inter", sans-serif;

}

body {
    margin: 0;
    /* background: linear-gradient(45deg, rgb(245 245 245 / 95%) 50%, rgba(148, 193, 41, 0.95) 100%); */
    min-height: 100vh;
    font-family: "Inter", sans-serif;
    /* color: var(--text-primary); */
}

/* Flex container for sidebar and main content */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.background-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: -1;
    overflow: hidden;
}


/* Sidebar Base */
.sidebar {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    min-height: 100vh;
    width: 18rem;
    transition: width 0.4s, background-color 0.3s;
    border-right: 1px solid #fefe;
    position: relative;
}



/* Header */
.sidebar .header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-primary);
    position: relative;
    transition: background-color 0.3s;
}

.sidebar .header a {
    text-decoration: none;
    color: var(--logo-text);
    font-size: 1.3rem;
    font-weight: 550;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* Logo Image */
.header-logo {
    max-height: 2rem;
    width: auto;
    transition: transform 0.3s;
}

.sidebar .header button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    color: var(--logo-text);
    transition: background-color 0.3s;
}

.sidebar .header button:hover {
    background-color: var(--btn-hover);
}

.sidebar .header button:active {
    background-color: var(--btn-active);
}

/* Separator Wrapper */
.separator-wrapper {
    position: relative;
}

.separator-wrapper .separator {
    margin: 0;
    border: 0.5px solid var(--separator);
    transition: border-color 0.3s;
}

.separator-wrapper .minimize-btn,
.header .minimize-btn {
    /* border: 1px solid var(--separator); */
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.5rem;
    position: absolute;
    top: 70%;
    right: 26px;
    transform: translateY(-50%) translateX(50%);
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    z-index: 1;
}

.separator-wrapper .minimize-btn input,
.header .minimize-btn input {
    display: none;
}

.separator-wrapper .minimize-btn svg,
.header .minimize-btn svg {
    width: 24px;
    height: auto;
    transition: transform 0.3s;
    transform: scaleX(-1);
    color: #6D7482;
}

/* When sidebar is minimized, mirror the minimize icon as well */
.sidebar:has(#minimize:checked) .separator-wrapper .minimize-btn svg,
.sidebar:has(#minimize:checked) .header .minimize-btn svg {
    transform: scaleX(1);
}

.separator-wrapper .minimize-btn:hover {
    background-color: var(--btn-hover);
}

.separator-wrapper .minimize-btn:active {
    background-color: var(--btn-active);
}

/* Navigation */
.navigation {
    padding-left: 0;
    padding-top: 1rem;
    flex-grow: 1;
    overflow-y: auto;
}

.navigation .section {
    margin-bottom: 1.5rem;
}

/* List group items */
.list-group-item {
    border: none;
    background-color: transparent;
    transition: background-color 0.3s, color 0.3s;
}

.list-group-item a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0.5rem;
    color: var(--item-text);
    border-radius: 0.4rem;
    position: relative;
}

.list-group-item a:hover {
    background-color: var(--item-hover);
}

.active-link {
    background: linear-gradient(72.47deg, #94c129 10.16%, rgb(154 195 55 / 78%) 76.47%);
    box-shadow: 0 2px 6px 0 rgba(115, 103, 240, .47843137254901963);
    color: #ffffff !important;
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--separator);
    padding: 1.5rem;
    transition: background-color 0.3s, border-color 0.3s;
}

/* When minimized, adjust sidebar width */
.sidebar:has(#minimize:checked) {
    width: 3rem;
}

.sidebar:has(#minimize:checked) .header a {
    justify-content: center;
}

.sidebar:has(#minimize:checked) .header a .header-logo {
    max-height: 20px;
    display: none;
}

.sidebar:has(#minimize:checked) .navigation .section .title-wrapper .title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.sidebar:has(#minimize:checked) .navigation .section .list-group,
.sidebar:has(#minimize:checked) .collapse,
.sidebar:has(#minimize:checked) #sessionList {
    display: none;
}

/* SVG icon to show when sidebar is minimized */
.minimized-svg {
    display: none;
    position: relative;
    top: 4rem;
    left: 80%;
    transform: translateX(-50%);
}

.sidebar:has(#minimize:checked) .minimized-svg {
    display: none;
}

.sidebar:has(#minimize:checked) .profile {
    display: none;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;

}

.main-navbar {
    padding: 10px 30px;
    position: sticky;
    top: 0;
    background-color: #FAFBFC;
    backdrop-filter: blur(10px);
    height: 10vh;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
    border: #E5E7EB 1px solid;
    transition: height 0.4s, background-color 0.3s;
}

.log-div {
    display: flex;
    align-items: center;
}

.log-div h1 {
    margin-left: 10px;
    font-size: 20px;
    color: #333;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.share-box {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    background: #90c13e;
    color: #fefefe;
}

.share-box svg {
    margin-right: 6px;
    height: 20px;
    width: 20px;
}

.dots-icon svg {
    cursor: pointer;
    color: #6B727F;
}

.log-div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-navbar h1 {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    color: black;
}

.button-container {
    margin: 0 20px 0rem;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

div#profileImgContainer {
    background: #E5E7EB;
    border-radius: 50%;
    padding: 10px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.profile-name {
    font-size: 16px;
    margin-bottom: 2px;
    font-weight: 400;
    color: #001E40 !important;
}

.profile-email {
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    width: 200px;
}

/* Adjust dept header layout */
li.list-group-item.dept-header {
    display: grid;
    grid-template-columns: 200px 11px;
    align-items: center;
}

/* Adjust dropdown arrow image styling */
.dropdown-arrow {
    width: 16px;
    height: 16px;
}

/* Rotate arrow when the parent has aria-expanded="true" */
.list-group-item[aria-expanded="false"] .dropdown-arrow {
    transform: rotate(0deg);
}

button#openReport {
    font-size: 12px;
    border-radius: 5px;
}

/* Chat Interface Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
    /* background: url('https://jssca.sharepoint.com/sites/gmmco/SiteAssets/ADVANZ/ADVANZ-CHAT-BG.png') no-repeat center center; */
    background-size: cover;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    padding-bottom: 0;
    scroll-behavior: smooth;
    z-index: 100;
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.message-ai,
.message-user {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

/* AI message aligned left */
.message-ai {
    justify-content: flex-start;
}

/* User message aligned right, but keep avatar on left of bubble */
.message-user {
    justify-content: flex-end;
    /* push content to the right */
}

.message-user .avatar {
    order: 0;
    /* avatar stays on left */
    margin-right: 10px;
}

.message-user .message-content {
    order: 1;
}

.avatar {
    width: 40px;
    height: 40px;
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    padding: 10px 15px;
    border-radius: 15px;
}

.ai-bubble {
    background-color: #f0f0f0;
}

.user-bubble {
    background-color: #d0ebff;
}


.avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    background: #195C68;
    border-radius: 50%;
}



.avatar-user {
    background-color: #94C11F;
    border-radius: 30px;
    /* position: relative;
    right: 6rem; */
    height: 30px;
    width: 30px;
}

.avatar img {
    filter: brightness(0) invert(1) grayscale(1);

}

.avatar-user svg {
    width: 20px !important;
    height: 15px !important;
    filter: brightness(0) invert(1) grayscale(1);
}


.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-bubble {
    padding: 0rem 1rem 0 1rem;
    border-radius: 8px;
    line-height: 1.5;
    font-size: 14px;
    /* max-width: 800px; */
    font-family: "Inter";
    font-weight: 400;
    color: black;
    background-color: white;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.1));
    margin-bottom: 20px;
}

.ai-bubble {
    box-shadow: #000;
    background-color: white;
    width: 100%;
    overflow: auto;
    border-left: 4px solid #195C68;
}

.user-bubble {
    background-color: var(--user-bubble);
    border: 1px solid #e5e5e5;
    box-shadow: black;
    border-radius: 10px;
    background-color: #FFFFFF;
    color: #000;
    width: auto;
    border-right: 4px solid #94C11F;
    padding: 0.75rem 1rem 0 1rem;
}

.message-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-container {
    padding: 1rem;
    bottom: 0;
}

.input-wrapper {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 15px;

}

span#sendButton {
    background: #94C11F;
    border-radius: 5px;
    padding: 0 5px;
}


.mdi-light--arrow-up::after {
    display: inline-block;
    width: 22px;
    height: 22px;
    vertical-align: -0.125em;
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M11 20V7.75L5.75 13L5 12.34l6.5-6.5l6.5 6.5l-.75.66L12 7.75V20z'/%3E%3C/svg%3E");
    filter: brightness(0) invert(1) grayscale(1);
}

.bottom-bar {
    display: flex;
    align-items: center;
    position: absolute;
    bottom: -12px;
    /* border-radius: 0 0 0 8px; */
    left: 0px;
    height: 27px;
    width: 100%;
    z-index: 2;
    padding-left: 2.5%;
    padding-bottom: 5.5%;
    cursor: pointer;
}

.bottom-bar-right {
    position: absolute;
    bottom: 0;
    border-radius: 0 0 8px 0;
    right: 0;
    height: 30px;
    width: 50%;
    z-index: 2;
    padding-right: 2.5%;
    padding-bottom: 4%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
}

.chat-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    resize: none;
    min-height: 120px;
    outline: none;
    background: white;
    /* or rgba(255, 255, 255, 0.772); */
    display: block;
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(148, 193, 41, 0.2);
}

.send-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.send-button:hover {
    background-color: #82ad1c;
}

.send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}

.suggestions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: left;
    max-height: 100px;
}

.suggestion-chip {
    background-color: var(--ai-bubble);
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
}

.suggestion-chip:hover {
    background-color: #e5e5e5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Markdown-like styling for AI responses */
.ai-bubble h3 {
    font-size: 21px;
    padding: 1rem 0;
}

.ai-bubble p {
    margin: 1em 0;
}

.ai-bubble ul,
.ai-bubble ol {
    padding-left: 1.5em;
    margin: 1em 0 1.2em 0;
}

.ai-bubble li {
    margin: 0.25em 0;
}

.ai-bubble code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.ai-bubble pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.75em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.75em 0;
}

.ai-bubble pre code {
    background-color: transparent;
    padding: 0;
}

.ai-bubble table {
    margin: 1em 0;
}

.ai-bubble tbody,
.ai-bubble td,
.ai-bubble tfoot,
.ai-bubble th,
.ai-bubble thead,
.ai-bubble tr {
    border-color: inherit;
    border-style: solid;
    border-width: 1px !important;
    padding: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar:not(:has(#minimize:checked)) {
        position: absolute;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .message {
        max-width: 95%;
    }

    .input-wrapper {
        max-width: 95%;
    }
}

/* Add to your existing CSS */
#clearChat {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0.375rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#clearChat:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

#clearChat:active {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Adjust navbar layout to accommodate the new button */
.main-navbar .button-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.iconify {
    width: 25px;
    height: 25px;
}


/* File Upload Styles */
.file-upload-preview {
    background-color: white;
    border-radius: 8px;
    padding: 15px 7px;
    width: 300px;
    position: relative;
    transition: all 0.3s ease;
    margin-left: 0;
    justify-content: center;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.1));

}

.file-div {
    display: flex;
    flex-direction: column;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    height: auto;
    background-color: #ffffff;
    border-radius: 5px;
    padding: 10px;
}

.info-tooltip {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.info-tooltip .iconify {
    color: #088322;
    font-size: 18px;
}

.tooltip-text {
    visibility: hidden;
    width: 260px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px 10px;
    position: absolute;
    z-index: 1;
    bottom: -36px;
    left: -370px;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 12px;
    white-space: normal;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.file-upload-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    height: 35px;
    background-color: #ffffff;
    border-radius: 5px;
    padding: 10px;
}

.file-upload-icon {
    font-size: 12px;
    color: #e74c3c;
    background: #FDE9E9;
    border-radius: 10px;
    padding: 10px;
}

.file-name {
    font-weight: 500;
    flex-grow: 1;
    font-size: 12px;
    width: 13rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.file-icon {
    background: #E5E7EB;
    padding: 10px;
    border-radius: 10px;
}

.file-size {
    font-size: 10px;
    color: #777;
    font-weight: 600;

}

button#cancelUpload {
    font-size: 2px;
}

button#cancelUpload svg {
    width: 15px;
    height: 10px;
}

.upload-progress {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.cancel-upload {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #777;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cancel-upload:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Drag and Drop Styles */
.drag-over .chat-input-container {
    border: 2px dashed #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

/* .chat-input-container {
    position: relative;
    flex-grow: 1;
    transition: all 0.2s ease;
    display: flex;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.1));
} */


.chat-input-container {
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(to top, #195C68, #94C11F);
}



#newChatBtn {
    border-radius: 15px;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.1));
    /* width: 1px; */
    background: #195C68;
    display: flex;
    justify-content: center;
    gap: 5px;
    color: #E5E7EB;
    font-weight: 700;
}



.tools-menu {
    position: absolute;
    bottom: 60px;
    left: 10px;
    width: 350px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tools-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.tools-menu-header {
    padding: 8px 16px;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

.tools-menu-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tools-menu-item:hover {
    background: #f5f5f5;
}

.tools-menu-item .iconify {
    margin-right: 12px;
    font-size: 20px;
}

.tools-menu-item .checkmark {
    margin-left: auto;
    display: none;
    color: #4CAF50;
}

.tools-menu-item.active .checkmark {
    display: block;
}

.tools-label {
    margin-left: 4px;
    font-size: 14px;
}


.mode-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transform: translateX(150%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-left: 4px solid #4CAF50;
    /* max-width: 300px; */
}

.mode-toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon .iconify {
    font-size: 24px;
}

.toast-message {
    font-size: 14px;
    color: #333;
}

.toast-close {
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: 12px;
    color: #888;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
}

.toast-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

/* Different colors for different modes */
.mode-toast.gpt-mode {
    border-left-color: #4CAF50;
}

.mode-toast.gpt-mode .toast-icon .iconify {
    color: #4CAF50;
}

.mode-toast.legal-mode {
    border-left-color: #2196F3;
}

.mode-toast.legal-mode .toast-icon .iconify {
    color: #2196F3;
}


.message-text {
    line-height: 1.6;
    margin-bottom: 8px;
}

.citation-marker {
    color: #10a37f;
    cursor: pointer;
    font-size: 0.8em;
    vertical-align: super;
    line-height: 1;
}

.citation-marker:hover {
    text-decoration: underline;
}

.citations-section {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e5e5e5;
    font-size: 0.85em;
}

.citations-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.citation-list {
    margin: 0;
    padding-left: 20px;
}

.citation-list li {
    margin-bottom: 4px;
}

.citation-list a {
    color: #10a37f;
    text-decoration: none;
}

.citation-list a:hover {
    text-decoration: underline;
}


.suggestions-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.suggestions-box button {
    background: #ffffff;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.suggestions-box button:hover {
    background: #e6e6e6;
}

.hidden {
    display: none;
}

.context-menu {
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 4px 0;
    list-style: none;
    width: 120px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: fadeInScale 0.15s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
}

.context-menu li:hover {
    background-color: #f0f0f0;
}


/* Modern Dialog Styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.dialog-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.dialog-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.dialog-overlay.active .dialog-content {
    transform: translateY(0);
}

.dialog-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    font-weight: 600;
    font-size: 1.1rem;
}

.dialog-body {
    padding: 20px;
}

.dialog-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

/* button.list-group-item.session-btn {
    margin: 10px;
    padding: 5px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 16px;
    padding-left: 10px;
    width: 90%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-align: left;
} */

button.list-group-item.session-btn:hover {
    background: #e5e5e500;
    font-weight: 600;
}

.readableName {
    padding-left: 10px;
    width: 90%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-align: left;
    font-size: 14px;
}

.session-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 15px;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
}

.session-btn:hover {
    background-color: #f5f5f5;
}

.session-btn .menu-icon {
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    color: #888;
    padding: 4px;
    border-radius: 4px;
}

.session-btn:hover .menu-icon {
    opacity: 1;
    visibility: visible;
}

.session-btn .menu-icon:hover {
    background-color: #e0e0e0;
    color: #333;
}

.session-btn.editing input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

.session-group-header {
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #000000;
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
    background-color: #f9f9f9;
    /* border-top: 1px solid #eee; */
    border-bottom: 1px solid #eee;
    margin-top: 8px;
}

.session-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.session-btn input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 8px 16px;
    font-size: inherit;
    background: transparent;
    outline: none;
}

.disclaimer {
    font-family: "Nunito Sans", sans-serif !important;
    font-size: 14px;
    font-weight: 500;
    color: #a2a2a2;
    text-align: center;
    margin-top: 10px;
    margin-left: 70px;
    /* max-width: 90%; */
    margin: 0 !important;
}

table.table.table-bordered.table-dark.table-hover.m-0 {
    font-size: 12px;
}

.email-subject {
    font-weight: 600;
    font-size: 1rem;
}

.email-preview {
    font-size: 0.875rem;
    color: #555;
    margin-top: 0.25rem;
}

h5#emailModalLabel {
    margin: 0 10px;
}

.modal-header.bg-primary.text-white {
    background: #f4f4f4 !important;
    color: #000 !important;
}


.email-preview-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 10px;
    width: 50%;
}

.email-upload-icon {
    background-color: #EAF4FF;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-preview-details {
    flex-grow: 1;
    min-width: 0;
}

.ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-subject {
    font-weight: 600;
    font-size: 14px;
}

.email-meta,
.email-date {
    font-size: 12px;
    color: #666;
}

.btn-close-email {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #666;
    font-size: 0px;
    width: 20px;
}

.btn-close-email svg {
    width: 10px;
}

.btn-close-email:hover {
    color: #333;
}

.email-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.email-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #94c129;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    /* border: 1px solid #e0e0e0; */
}

.email-icon {
    font-size: 24px;
    color: #666;
    background: #e1e1e1;
    border-radius: 10px;
    display: flex;
    padding: 10px;
}

.email-div {
    flex-grow: 1;
    min-width: 0;
}

.email-subject {
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 30rem;
}

.email-meta,
.email-date {
    font-size: 12px;
    color: #666;
    display: block;
}

.viewresult:hover {
    color: #030d99 !important;
    background-color: #f5f5f5 !important;
}

input.form-check-input.mt-1.email-checkbox {
    border-radius: 50%;
    border-color: #616161;
}

input#emailSearchInput {
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #e3e3e3;
}

#emailModal .modal-dialog {
    max-width: 850px;
}

#emailModal .form-control-sm {
    font-size: 0.85rem;
    padding: 0.375rem 0.5rem;
}


.filter-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.filter-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.modern-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.modern-input {
    width: 9rem;
    padding: 12px 16px;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    outline: none;
    height: 45px;
}

.modern-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.modern-input:not(:placeholder-shown)+.floating-label,
.modern-input:focus+.floating-label {
    transform: translateY(-28px) translateX(4px) scale(0.85);
    color: var(--primary-color);
    font-weight: 600;
    background: white;
    padding: 0 8px;
}

.floating-label {
    position: absolute;
    left: 16px;
    top: 12px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1;
}

.date-input {
    color: var(--text-muted);
}

.date-input:focus,
.date-input:not([value=""]) {
    color: #1f2937;
}

.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}


.email-list {
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--secondary-color);
}

.email-list::-webkit-scrollbar {
    width: 6px;
}

.email-list::-webkit-scrollbar-track {
    background: var(--secondary-color);
    border-radius: 3px;
}

.email-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.row.g-3.align-items-end.filter-row {
    justify-content: space-between !important;
    align-items: baseline !important;

}

.email-item {
    background-color: transparent;
    transition: background-color 0.3s, color 0.3s;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e6e6e6;
    border-radius: 20px;
}

.card-body.p-4 {
    padding: 5px 10px 5px 10px !important;
}


.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 255, 240, 0.7);
    /* light greenish tint */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
    /* Hidden by default */
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #b2f2bb;
    /* soft green */
    border-top: 5px solid #2f9e44;
    /* dark green */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Spinner Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


#fileUploadPreview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.file-nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.file-nav-button {
    background: #f0f0f0;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-nav-button:hover {
    background: #e0e0e0;
}

.file-counter {
    font-size: 14px;
    color: #666;
}

.multi-file-info {
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.files-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #555;
}

.files-header strong {
    color: #333;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.files-list .file-info {
    margin-left: 20px;
}