:root {
--main-color: #4CAF50;
--hover-color: #286090;
--main-btn-icons: #fff;
--hover-btn-icons: #fff;
--focus-btn-icons: #fff;
--navbar-background: #f0f0f0;
--body-background: #fff;
--text-color: #000;
--sagecell-number-color: #0000ff;
}

body {
    background-color: var(--body-background, #fff);
}

.markdown-preview {
    color:var(--text-color,#000000);
}

.sagecell_sessionOutput {
    color:var(--text-color,#000000);
}

/* Style from old CC HTML format */
.btn-primary {
  background-color: var(--main-color, #4CAF50);
  color: var(--main-btn-icons, #fff);
  border: none;
  padding: 5px 5px;
  margin: 0 2px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--main-color, #4CAF50);
  color: var( --hover-btn-icons, #fff);
}

/* Removing right margin for the last button in a row */
.btn-primary:last-child,
.btn-primary:last-of-type {
  margin-right: 0;
}

.btn-primary:focus,
.btn-primary.focus {
  background-color: var(--hover-color, #286090);
  color: var(--focus-btn-icons, #fff);

}

.btn-primary:hover {
  background-color: var(--hover-color, #286090);
  color: var( --hover-btn-icons, #fff);
}

.btn-primary:active,
.btn-primary.active,
.open>.dropdown-toggle.btn-primary {
  background-color: var(--hover-color, #286090);
}

.btn-primary:active:hover,
.btn-primary.active:hover,
.open>.dropdown-toggle.btn-primary:hover,
.btn-primary:active:focus,
.btn-primary.active:focus,
.open>.dropdown-toggle.btn-primary:focus,
.btn-primary:active.focus,
.btn-primary.active.focus,
.open>.dropdown-toggle.btn-primary.focus {
  background-color: var(--hover-color, #286090);
}

.btn-primary:active,
.btn-primary.active,
.open>.dropdown-toggle.btn-primary {
  background-image: none;
}

.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary[disabled].focus,
fieldset[disabled] .btn-primary.focus {
  background-color: #337ab7;
  border-color: #2e6da4;
}

.btn-primary .badge {
  color: #338ab7;
  background-color: #fff;
}

.content {
  padding: 15px;
  background-color: #fff;
  min-height: 0;
  -webkit-box-shadow: 0px 0px 12px 1px rgba(87, 87, 87, 0.2);
  box-shadow: 0px 0px 12px 1px rgba(87, 87, 87, 0.2);
}

/* Style the navbar */
#navbar {
  overflow: hidden;
  background-color:transparent;
  z-index: 10;
}

/* Navbar links */
#navbar a {
  float: left;
  display: block;

  text-align: center;
  text-decoration: none;
}

#evalWarning {
  color: hsl(198, 65%, 40%);
}

/* Page content */
#main {
    padding-top: 16px;
    width: 90%;
    max-width: 750px;
    margin: 0 auto;
}


#main.belowMenu {
  margin-top: 50px;
}
/* The sticky class is added to the navbar with JS when it reaches its scroll position */
.sticky {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: green;
}
.save-warning {
  border-style: outset;
  border-color: red;
  border-radius: 10px;
  padding: 1em;
  margin: 1em;
  color: #000000;
  font-weight: bold;
  text-align: center;
}

@media print {
  #navbar {
    display: none;
  }
}

/* Add some top padding to the page content to prevent sudden quick movement (as the navigation bar gets a new position at the top of the page (position:fixed and top:0) */
.sticky + .content {
  padding-top: 60px;
}

#controls {
  background-color: transparent;
}

.transferData {
	border-style: outset;
	border-color: green;
	border-radius: 5px;
	padding: 1em;
	margin: 1em;
}




.nb-cell.nb-code-cell {
    position: relative;
}



.control-bar {
    position: absolute;
    top: -24px;
    right: 0px;
    display: flex;
    flex-direction: row;
    gap: 0px;
    background-color: rgba(240, 240, 240, 0.9);
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 0px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nb-cell:hover .control-bar {
    opacity: 1;
}

.control-bar button {
    padding: 2px 5px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.control-bar button:hover {
    background-color: #e0e0e0;
}


.control-ai-bar {
    position: absolute;
    top: -1px;
    right: -27px;
    display: flex;
    flex-direction: column-reverse;
    gap: 0px;
    background-color: rgba(240, 240, 240, 0.9);
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 0px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nb-cell:hover .control-ai-bar {
    opacity: 1;
}

.control-ai-bar button {
    padding: 2px 5px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.control-ai-bar button:hover {
    background-color: #e0e0e0;
}

.nb-cell {
    position: relative;
}


.textarea-wrapper {
position: relative;
}
.textarea-clone {
visibility: hidden;
white-space: pre-wrap;
word-wrap: break-word;
position: absolute;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box;
}
textarea {
width: 100%;
box-sizing: border-box;
}

/* Control panel styles */
#controls {
    position: fixed;
    top: 0px;
    right: 0px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
	border: transparent;
}

/* Navbar styles */
#navbar {
    display: flex;
    align-items: center;
    background-color: var(--navbar-background, #f0f0f0);
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Button styles */
#navbar button, #controls button {
    background-color: var(--main-color, #4CAF50);
    color: var(--main-btn-icons, #fff);
    border: none;
    padding: 5px 7px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

#navbar button:hover, #controls button:hover {
    background-color: var(--hover-color, #286090);
    color: var( --hover-btn-icons, #fff);
}
#navbar button:focus, #controls button:focus {
    color: var(--focus-btn-icons, #fff);
	background-color: var(--hover-color, #286090);
	border-color: var(--hover-color, #286090);
}

/* Input styles */
#delay {
    padding: 7px;
    border: 1px transparent;
    background-color: var(--main-color, #4CAF50);
    color: var(--main-btn-icons, #fff);
    border-radius: 4px;
    margin: 0 2px;
    font-size: 12px;
    font-weight: 700;
    width: 60px;
}


/* Specific button styles */
#runAllCellsButton {
    background-color: #008CBA;
}

#runAllCellsButton:hover {
    background-color: var(--hover-color, #286090);
}

#editCells {
    background-color: #f44336;
}

#editCells:hover {
    background-color: var(--hover-color, #286090);
}

#toggleNavbar {
    background-color: #555;
}

#toggleNavbar:hover {
    background-color: var(--hover-color, #286090);
}

/* Responsive design */
@media (max-width: 600px) {
    #navbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
	}

    #navbar button, #controls button, #delay, .btn-primary {
        width: 100%;
        margin: 5px 0;
    }

    #controls {
        position: fixed;
		top: 15px;
        margin-top: 10px;
    }
}

.CodeMirror {
    border: 1px solid #eee;
    height: auto;
}

/* Modal overlay for both Import/Export and Excel editor dialogs */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* General modal content styling (used by both dialogs) */
.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 700px;         /* Fixed width for a smaller modal */
    max-width: 90%;       /* Responsive: will shrink on very small screens */
    text-align: center;
}

/* Modal button styling */
.modal-content button {
    background-color: var(--main-color, #4CAF50);
    color: var(--main-btn-icons, #fff);
    border: none;
    padding: 8px 15px;
    margin: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    font-family: Arial, sans-serif;
}

.modal-content button:hover {
    background-color: var(--hover-color, #286090);
}

/* Styles for the table in the Excel editor dialog */
.excel-editor-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
}

.excel-editor-table th,
.excel-editor-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

.excel-editor-table th {
    background-color: var(--main-color, #4CAF50);
    color: #fff;
    text-align: center;
    font-weight: bold;
}

.excel-editor-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.excel-editor-table tr:nth-child(odd) {
    background-color: #fff;
}

/* The table container within the Excel editor modal is made smaller */
.table-container {
    max-height: 500px;  /* Decreased maximum height */
    overflow-y: auto;
    margin-bottom: 10px;
}

.CodeMirror-fullscreen {
    position: fixed;
    top: 0%;
    left: 0%;
    right: 0%;
    bottom: 0%;
    resize: vertical;
    overflow: auto; /* required for resize to work */
}

/* CodeMirror Custom Styling */
.CodeMirror {
    height: auto;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

/* Editor container and Markdown cells */
.editor-container {
    position: relative;
    margin-bottom: 10px;
}

.markdown-textarea {
    width: 100%;
    height: 150px;
    font-family: Consolas, 'Courier New', monospace;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
}

.nb-markdown-cell .CodeMirror {
    height: auto;
    min-height: 50px;
}


.empty-markdown-preview {
    min-height: 30px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    position: relative;
    cursor: pointer;
    text-align: center;
    color: #999;
}

.empty-markdown-preview::before {
    content: "Click to edit this markdown cell";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-style: italic;
    font-size: 14px;
}

.empty-markdown-preview:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
}

/* Override the comment style so our placeholder doesn't show in the HTML */
.markdown-preview .comment {
    display: none;
}

/* Markdown tips panel */
.inline-markdown-tips {
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    padding: 8px;
    margin-top: 5px;
    font-size: 12px;
    border-radius: 4px;
}

.markdown-tips-list {
    padding-left: 16px;
    margin: 5px 0;
}

.markdown-tips-list li {
    margin-bottom: 5px;
}

.markdown-tips-list ul {
    padding-left: 16px;
    margin: 5px 0;
}

/* Modal styling for dialogs */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    min-width: 300px;
    text-align: center;
    max-height: 80vh;
    overflow-y: auto;
}

/* Excel editor modal */
.excel-editor-modal {
    z-index: 11000;
}

.excel-table-container {
    max-height: 400px;
    overflow: auto;
    margin-bottom: 10px;
    border: 1px solid #eee;
}

.excel-editor-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
}

.excel-editor-table tr:nth-child(1) {
    background-color: var(--main-color, #4CAF50);
    color: var(--main-btn-icons, #fff);
    text-align: center;
    font-weight: bold;
}

.excel-editor-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.excel-editor-table tr:nth-child(odd):not(:first-child) {
    background-color: #ffffff;
}

.excel-editor-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

.excel-editor-table input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    outline: none;
    padding: 4px;
    font-family: inherit;
    background: transparent;
}

/* Button styling */
.modal-button {
    padding: 8px 16px;
    margin: 0 5px;
    cursor: pointer;
    background-color: var(--main-color, #4CAF50);
    color: var(--main-btn-icons, #fff);
    border: none;
    border-radius: 4px;
}

.modal-button:hover {
    background-color: var(--main-color, #4CAF50);
}

/* AI Settings modal */
.ai-settings-modal .close {
    float: right;
    cursor: pointer;
    font-size: 28px;
    font-weight: bold;
}

.ai-settings-modal .close:hover {
    color: #555;
}

.ai-settings-modal .input-group {
    margin: 10px 0;
    text-align: left;
}

.ai-settings-modal input,
.ai-settings-modal select {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.ai-settings-modal .warning-message {
    color: #e74c3c;
    margin: 15px 0;
    padding: 10px;
    background: #fdecea;
    border-left: 4px solid #e74c3c;
}

/* Enhanced DataFrame Styling with borders and tighter spacing */
table.dataframe {
    border-collapse: collapse;
    width: 100%;
    max-width: 800px;
    margin: 15px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    font-size: 12px; /* Smaller font size */
    border: 1px solid #ddd; /* Border around the entire table */
}

/* Header styling */
table.dataframe thead {
    background-color: var(--main-color, #4CAF50);
    color: var(--main-btn-icons, #fff);
}

table.dataframe thead th {
    padding: 6px 8px; /* Reduced padding */
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 11px; /* Even smaller font for headers */
    border: 1px solid var(--main-color, #4CAF50); /* Border for header cells */
    text-align: center;
}

/* Row index column */
table.dataframe tbody tr th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-align: center;
    padding: 4px 6px; /* Reduced padding */
    border: 1px solid #ddd; /* Border for index cells */
}

/* Data cells */
table.dataframe td {
    padding: 4px 6px; /* Reduced padding */
    border: 1px solid #ddd; /* Border for all data cells */
    line-height: 1.3; /* Tighter line height */
    text-align: center;
}

/* Alternating row colors for better readability */
table.dataframe tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

table.dataframe tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Hover effect */
table.dataframe tbody tr:hover {
    background-color: var(--main-color, #4CAF50);
}

/* Responsive table */
@media screen and (max-width: 600px) {
    table.dataframe {
        display: block;
        overflow-x: auto;
        font-size: 11px; /* Even smaller on mobile */
    }

    table.dataframe td,
    table.dataframe th {
        padding: 3px 5px; /* Further reduced padding on mobile */
    }
}

/* Excel modal styling that matches the existing styles */
#excelImportExportModal,
#excelEditorModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Modal content styling to match your existing modal-content */
#excelImportExportModal > div,
#excelEditorModal > div {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    min-width: 300px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0px 0px 12px 1px rgba(87, 87, 87, 0.2);
}

/* Button styling to match your .btn-primary class */
#excelImportExportModal button,
#excelEditorModal button {
    background-color: var(--main-color, #4CAF50);
    color: var(--main-btn-icons, #fff);
    border: none;
    padding: 5px 5px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

#excelImportExportModal button:hover,
#excelEditorModal button:hover {
    background-color: var(--hover-color, #286090);
}

#excelImportExportModal button:focus,
#excelEditorModal button:focus {
    background-color: var(--hover-color, #286090);
}

/* Styling for the table in Excel editor modal */
#excelEditorModal table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
}

#excelEditorModal table tr:first-child {
    background-color: var(--main-color, #4CAF50);
    color: var(--main-btn-icons, #fff);
}

#excelEditorModal table tr:nth-child(even) {
    background-color: #f9f9f9;
}

#excelEditorModal table tr:nth-child(odd):not(:first-child) {
    background-color: #ffffff;
}

#excelEditorModal table td {
    border: 1px solid #ddd;
    padding: 0; /* Remove padding to make room for inputs */
}

#excelEditorModal table input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    outline: none;
    padding: 8px;
    font-family: inherit;
    background: transparent;
}

#excelEditorModal table tr:first-child input {
    color: var(--main-btn-icons, #fff);
    font-weight: bold;
}

/* Table container with max height and scrolling */
#excelEditorModal div[style*="max-height"] {
    max-height: 400px;
    overflow: auto;
    margin-bottom: 10px;
}

/* Add some margin between button groups */
#excelEditorModal > div > div {
    margin: 10px 0;
}

/* Modal titles and instructions */
#excelImportExportModal h3,
#excelEditorModal h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 16px;
}

#excelImportExportModal p,
#excelEditorModal p {
    color: #666;
    margin-bottom: 15px;
}

.sagecell_poweredBy {
    display: none !important;
}

.sagecell .CodeMirror-scroll {
    min-height: 3em;
    max-height: 100%;
}

.completion-current-cell {
    background-color: #e8f4f8;
    font-weight: 500;
}

.completion-other-cell {
    background-color: #f5f5f5;
    font-style: italic;
}

/* AI status animation */

.AIstatus {
  font-weight: bold;
  font-style: italic;
  color:var(--sagecell-number-color);
}

.AIstatus::after {
  content: '...';
  display: inline-block;
  animation: dots 1.5s steps(4, end) infinite;
  width: 1em;
  text-align: left;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.AIstatus {
  font-weight: bold;
  font-style: italic;
  color: var(--sagecell-number-color);
  border: 2px solid var(--sagecell-number-color);
  padding: 8px 12px;
  display: inline-block;
  border-radius: 4px;
}


/* Bulk actions styles */
.bulk-select-wrapper {
    position: absolute;
    top: 30px;
    left: -25px;
    z-index: 5;
    line-height: 0;
}
.bulk-select-checkbox {
    width: 18px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--main-color, #4CAF50);
}
.cell-bulk-selected {
    box-shadow: -4px 0 0 0 var(--main-color, #4CAF50);
    background-color: color-mix(in srgb, var(--main-color) 30%, white);
    border-radius: 4px;
}

/* On narrow screens the left gutter disappears: pull the checkbox inside.
@media (max-width: 900px) {
    .bulk-select-wrapper {
        left: 2px;
        top: 2px;
        background: var(--body-background);
        border-radius: 3px;
        padding: 1px;
    }
} */

#bulk-action-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9985;
    display: none;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 95%;
    padding: 8px 12px;
    background: var(--navbar-background);
    border: 1px solid var(--main-color);
    border-radius: 8px;
    /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; */
    font-size: 13px;
}
#bulk-action-toolbar .bulk-count {
    font-weight: 700;
    color: var(--text-color);
    margin-right: 6px;
    white-space: nowrap;
}
#bulk-action-toolbar .bulk-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: var(--main-color, #4CAF50);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: opacity 0.15s, background-color 0.15s;
}
#bulk-action-toolbar .bulk-btn:hover:not(:disabled) { opacity: 0.85; }
#bulk-action-toolbar .bulk-btn:disabled {
    background: #b9c0c6;
    cursor: not-allowed;
}
#bulk-action-toolbar .bulk-delete-btn { background: #e74c3c; }
#bulk-action-toolbar .bulk-close-btn  { background: #607d8b; }