:root {
    --bg-color: rgb(242, 244, 248);
    --main-color: rgb(250, 250, 250);
    --hover-color: rgb(233, 233, 233);
    --click-color: rgb(220, 220, 220);

    --border-radius-bg: 24px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
}

body {
    background-color: var(--bg-color);
    box-sizing: border-box;
    font-family: "Noto Sans", serif;
}

.alert {
    position: absolute !important;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    /* Ensure it stays above other elements */
    display: flex;
    /* Use flexbox to align content */
    justify-content: center;
    /* Center content horizontally */
    align-items: center;
    /* Center content vertically */
    box-sizing: border-box;
}

.footer-logo {
    filter: opacity(0.6);
    box-sizing: border-box;
}

/* ------- Tables ------- */
table {
    width: 50%;
    table-layout: fixed;
    margin: auto;
    box-sizing: border-box;
    transition: max-width 0.3s;
    border-collapse: separate;
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.table td,
.table th {
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--hover-color);
}

/* ------- List Group and Item ------- */
.list-group {
    border-radius: var(--border-radius-md);
}

.list-group-item:nth-child(odd) {
    background-color: var(--main-color);
}

.list-group-item:nth-child(even) {
    background-color: var(--bg-color);
}

/* ------- Navbar and Navlink ------- */
.navbar,
.navbar-nav {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
}

nav.navbar {
    position: fixed; /* Fix the navbar so we can slide it in and out */
    z-index: 1100;
    transition: top 0.3s, margin 0.3s;

    width: 100%;
    padding: 5px 18px;

    background-color: var(--bg-color);
}

.nav-link {
    color: rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.nav-link:hover {
    color: rgba(0, 0, 0, 0.9);
}

.nav-link-forcedark {
    color: rgba(0, 0, 0, 0.7) !important;
    box-sizing: border-box;
}

.nav-link-forcedark:hover {
    color: rgba(0, 0, 0, 0.9) !important;
}

.nav-link-gray.active {
    background-color: var(--bg-color) !important;
}

.navbar-brand {
    margin-right: 10px;
    padding: 0px;
}

.navbar-brand img {
    height: 50px;
}

/* Styling for all interactive elements */
input,
.bootstrap-select,
textarea,
.dropdown,
.btn-light {
    outline: none;
    box-shadow: none;
    background-color: transparent !important;
    border-radius: var(--border-radius-sm);
    border: none;
}

.btn-light-inverse {
    background-color: var(--main-color) !important;
    border-radius: var(--border-radius-sm);
}

input,
.bootstrap-select {
    border-radius: var(--border-radius-sm) !important;
}

input,
.bootstrap-select,
.dropdown {
    border: 1px solid var(--click-color) !important;
}

input:hover,
.bootstrap-select:hover,
textarea:hover,
.btn:hover {
    background-color: var(--hover-color) !important;
}

.btn:active {
    background-color: var(--hover-color) !important;
}

.btn:focus {
    background-color: var(--click-color) !important;
}

.active-bg {
    background-color: var(--main-color) !important;
}

.pill-btn {
    position: relative; 
    height: 40.5px; 
    padding: 0px 14px;
    transition: padding-left 0.3s ease-in;
}

.pill-check {
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 20px;
    height: 20px;
    background: url('https://www.svgrepo.com/show/532154/check.svg') no-repeat center center;
    background-size: contain;
    transition: left 0.3s;
}

.tooltip-inner {
    background-color: var(--main-color) !important;
    color: black !important;
    border: 1px solid black !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mark {
    padding: 0.05em;
}

/* ------------------ Dropdowns ------------------ */
.dropdown-menu {
    background-color: var(--main-color);
    border-radius: var(--border-radius-sm);
}

/* Disable gray arrows in dropdowns */
.dropdown-menu.inner.show::before {
    display: none;
}

.dropdown-menu.show::before {
    display: none;
}

.dropdown-item {
    text-overflow: clip;
}

.dropdown-item:hover {
    background-color: var(--hover-color);
}

.dropdown-item:active {
    background-color: var(--click-color);
}

.bs-select-all {
    display: none;
}

.bs-deselect-all {
    width: 100% !important;
}

/* ------------------ Sidebar Sticky Behavior ------------------ */
/* Desktop Sidebar styles */
#sidebar {
    width: 230px;
    background-color: var(--bg-color);
    z-index: 1099;

    min-height: 100%;
    padding-top: 8px;
    padding-right: 20px;

    transition: top 0.3s, left 0.3s, padding-top 0.3s;
    position: fixed;
    top: 67px;
    left: 0px;
    margin-left: 20px;

    /* box-shadow: 1px 0.5px 5px rgba(0, 0, 0, 0.1); */
}

.sidebar-container {
    min-width: 250px;
    height: 100vh;
    transition: min-width 0.3s;
}

#sidebar.collapsed {
    left: -250px;
}

.sidebar-container:has(> #sidebar.collapsed) {
    min-width: 0px;
}

#sidebar.sticky {
    top: 0px;
    padding-top: 20px;
}

@media (max-width: 992px) {
    .sidebar-container:has(> #sidebar) {
        min-width: 0px !important;
    }
}

/* Desktop toggle arrow button styling */
#desktopSidebarToggle {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: 250px;
    /* initial position when sidebar is shown */
    z-index: 1100;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    outline: none;
    margin-left: 24px;

    transition: left 0.3s, margin-left 0.3s !important;
}

.sidebar-collection-btn {
    display: flex;
    margin: 4px 0px;
    width: 100%;
    padding: 2px 0px;
    transition: padding 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-collection-btn:hover {
    padding: 2px 6px;
}

/* Make sure interactive elements use box-sizing */
* {
    box-sizing: border-box;
}

#mainContent {
    margin-top: 64px;
    margin-bottom: 24px;
    margin-left: 24px;
    margin-right: 24px;
    transition: margin-left 0.3s;
    border-radius: 24px;
    background-color: var(--main-color);
    min-height: 91vh;
}

.container-fluid {
    max-width: 93%;
    margin-bottom: 12px;
}

/* ------------------ Modals ------------------ */
.modal {
    z-index: 1200;
    position: auto;
}

.modal-content {
    background-color: var(--main-color);
    border-radius: 24px;
}

.modal-backdrop {
    z-index: 1199;
}

.modal-xl {
    max-width: 75%;
}

#outlineColumn {
    padding-top: 0px;
}

#outlineColumn.sticky {
    top: 0px;
    padding-top: 20px;
    position: fixed;
}

.outline-li {
    margin-bottom: 0.5em;
}

/* ------------------ Spreadsheet Card View ------------------ */
/* Hide table header in card view */
.card-view {
    border: none;
}

.card-view thead {
    display: none;
}

.card-view tbody {
    border: none !important;
}

.card-view tbody tr:first-child {
    display: none !important;
}

/* Make each row a "card" in card view */
.card-view tbody tr {
    display: block !important;
    margin-bottom: 0.3em;
    border: 2px solid var(--bg-color);
    padding: 5px;
    border-radius: 12px;
}

/* Display each cell as a block in card view */
.card-view tbody td {
    display: block;
    border: none;
    /* Remove table cell borders in card view */
    margin: 6px 4px;
    padding: 0px;
}

/* Prepend each cell's data-label in card view */
.card-view tbody td::before {
    content: attr(data-label) ": ";
    font-weight: bold;
    display: inline-block;
    margin-right: 4px;
}

.card-view tbody td[data-label="Select"]::before,
.card-view tbody td[data-label="Authors"]::before,
.card-view tbody td[data-label="Name"]::before {
    content: none;
    display: none;
}

/* ------------------ Underline Tabs ------------------ */
.nav-tabs-underline {
    /* Adjust color as needed */
    margin-bottom: 10px;
    position: relative;
}

.nav-link-underline {
    border: none !important;
    /* Remove borders */
    background-color: transparent !important;
    /* Remove background */
    color: #495057;
    /* Default text color */
    padding: 0px 0px !important;
    padding-bottom: 3px !important;
    /* Add some padding to the links */
}

.underline {
    position: absolute;
    bottom: -2px;
    left: 0px;
    height: 1px;
    width: 104px;
    background-color: #495057;
    transition: left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* ------------------ Collections Page ------------------ */
.card-body {
    padding: 0px;
}

.subcollections {
    overflow: hidden;
    transition: max-height 0.15s ease-in-out;
}

.subcollection-link {
    color: gray;
}

.subcollection-link:hover {
    color: black;
}

.collection-card {
    /* flex: 0 0 calc(20% - 1rem) !important; /* this sets how many cards appear in the collections row (ex. 20% = 5) */
    /* max-width: calc(20% - 1rem); */
    transition: 0.03s ease-in-out;
    box-sizing: border-box;
    cursor: pointer;
    border-radius: var(--border-radius-md);
    margin: 0.2em;
    padding: 12px 18px 6px 18px;
}

.collection-card .list-group-item {
    background-color: transparent;
}

.collection-card:hover {
    background-color: var(--hover-color);
}

.collection-card a {
    display: block;
    text-decoration: none;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.collection-row {
    width: 100%;
    margin: 0 !important;
    box-sizing: border-box;
}

/* ------------------ Chat ------------------ */
.card {
    border-radius: var(--border-radius-md);
    background-color: var(--main-color);
}

.collection-chat-card-body {
    padding: 1em;
}

.user-bubble {
    background-color: var(--hover-color);
    color: #000;
    border-radius: var(--border-radius-md);
    padding: 0.5em 1em;
}

/* ------- Spreadsheet Tab ------- */

.breadcrumb {
    background-color: var(--main-color);
}

.breadcrumb-item::after {
    display: none;
}

.spreadsheet-table {
    display: flex;
    border-radius: var(--border-radius-md);
}

.page-link {
    background-color: var(--main-color);
}

.right-menu-container {
    z-index: 1000;
    margin-left: 4px;
    border-radius: var(--border-radius-md);
    background-color: var(--main-color);
}

#copyToCollectionDropdownParent {
    border: none !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

#copyToCollectionButton::after {
    display: none;
}

/* ------------------ Analysis Tab ------------------ */
.article-map {
    height: 400px; 
    margin-bottom: 20px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--click-color);
}

/* ------------------ Planning Tab ------------------ */
.planning-doc {
    width: 100%;
    border: 1px solid var(--click-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5em;
}