/* All theme variables are now defined in _theme_variables.html */

html, body {
    height: 100vh !important;  /* Override with correct value */
    overflow: hidden !important;  /* Prevent page scroll */
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    display: grid;
    grid-template-rows: var(--topbar-height) 1fr var(--footer-height);
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "topbar topbar"
        "sidebar content"
        "footer footer";
    max-height: 100vh;
    font-family: var(--font-sans);
    font-weight: var(--font-weight-normal);
    background-color: var(--color-background);
    color: var(--color-text);
}

.content {
    display: grid;
    grid-area: content;
    padding: var(--space-3);
    background: var(--color-surface);
    color: var(--color-text);
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}
.content__section{
    display: grid;
    grid-template-rows: auto;
    grid-template-columns: 49.95% 0.1% 49.95%;
    grid-template-areas: "workflow-management divider llmchat";
    max-height: 98%;
    height: calc(100vh - 120px);
}

/* Background overlay */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 999;
    inset: 0; /* shorthand for top:0; right:0; bottom:0; left:0; */
    background: rgba(0, 0, 0, 0.4);

    /* Flexbox to center the content */
    display: flex;
    align-items: center; /* vertical center */
    justify-content: center; /* horizontal center */
    padding: 140px; /* equal space from edges */
    box-sizing: border-box;
}


.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: clamp(360px, 90vw, 560px);
    max-height: 80vh;
    padding: 20px 22px 18px;
    border-radius: 12px;

    background: linear-gradient(to right, var(--color-background), var(--color-surface));
    color: var(--color-text-muted);
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    overflow: auto;

    animation: modal-pop .22s ease-out;
}

/* Close button */
.close {
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

/* Inputs */
.modal-content input {
    width: 50%; /* Wider but centered */
    margin: 8px 0;
    padding: 8px;
    box-sizing: border-box;
}

/* Buttons */
.modal-content button {
    width: 50%;
    padding: 10px;
    background: #007bff;
    color: var(--color-text); /* Contrast */
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-content button:hover {
    background: #0056b3;
}

.footer {
    grid-area: footer;
    background: var(--color-background);
    color: var(--color-text);
    padding: 0;
    text-align: center;
    font-size: var(--text-base);
}

.footer a {
    vertical-align: middle;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    font-size: var(--text-xl);
    padding: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(var(--space-2));
}

.theme-toggle-btn:hover {
    color: var(--color-text);
    transform: translateY(var(--space-2)) scale(1.1);
}

.theme-toggle-btn:active {
    transform: translateY(var(--space-2)) scale(0.95);
}

a {
    color: var(--color-accent);
}

/* Dashboard Landing Page Styles*/

.dashboard-user-select-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.dashboard-user-select-dropdown-header {
    padding: 8px 12px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-surface-hover);
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
}

.dashboard-user-select-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
}

.dashboard-user-select-dropdown-item {
    padding: 10px 12px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--color-surface);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* workflow Management Styles */
.workflow-management {
    grid-area: workflow-management;
    display: flex;
    flex-direction: column;
    padding: 10px 10% 10px 10%;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
}

.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.workflow-status {
    padding: 0.5rem;
    border-radius: 5px;
    var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-text-secondary);
    min-width: 150px;
    cursor: pointer;
    transition: border-color 0.2s ease-in-out;
}

.workflow-status:hover {
    border-color: var(--color-text);
}

.workflow-description {
    margin-bottom: 2rem;
}

.description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.toggle-description {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease-in-out;
}

.toggle-description:hover {
    color: var(--color-text);
}

.description-content {
    transition: max-height 0.3s ease-out;
    max-height: 200px;
    overflow: hidden;
}

.description-content.collapsed {
    max-height: 0;
}

#workflow-description {
    width: 100%;
    min-height: 100px;
    padding: 0.5rem;
    var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-text-secondary);
    border-radius: 5px;
    resize: vertical;
}

.workflow-files {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}


.rag-toggle {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.rag-toggle.active {
    background: var(--color-accent);
    color: var(--color-text);
}

.delete-file {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease-in-out;
}

.delete-file:hover {
    color: #ff4444;
}

.new-file-container {
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    margin-top: 0;
}

#new-file-button {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

#new-file-button:hover {
    color: var(--color-accent);
}

.file-upload-form {
    display: none;
    padding: 0.5rem;
    background: var(--color-background);
    border-radius: 5px;
}

.file-upload-form input[type="file"] {
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.file-upload-form button {
    margin-right: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.file-upload-form button:first-of-type {
    background: var(--color-accent);
    color: var(--color-text);
}

.file-upload-form button:last-of-type {
    background: var(--color-surface);
    color: var(--color-text);
}

.file-upload-form button:hover {
    opacity: 0.9;
}



.llmchat {
    grid-area: llmchat;
    display: flex;
    flex-direction: column;
    padding: 10px 6% 10px 6%;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    position: relative;
}

.chat-window {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.input-container {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

/* Prompt Management Styles */


.prompt-textarea {
    width: 100%;
    min-height: 200px;
    var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-text-secondary);
    border-radius: 5px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    resize: vertical;
}

.prompt-save-btn {
    background: var(--color-accent);
    color: var(--color-text);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

.prompt-save-btn:hover {
background: var(--color-surface);
color: var(--color-text);
}

.file-upload-form button:hover {
opacity: 0.9;
}

.tiktok-messages{
display: flex;
width: 100%;
padding: 0;
box-sizing: border-box;
display: flex;
flex-flow: column nowrap;
overflow-y: scroll; /* Ermöglicht Scrollen bei langen Chatverläufen */
}
.tiktok-chat {
display: flex;
flex-grow: 1;
width: 100%;
padding: 10px 4% 10px 4%;
box-sizing: border-box;
display: flex;
flex-flow: column nowrap;
height: 100%;
max-height: 100%;
overflow-y: scroll; /* Ermöglicht Scrollen bei langen Chatverläufen */
grid-area: tiktok-chat;
}
.llmchat_header{
color: var(--color-text-secondary);
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.llmchat_header h2{
align-self: center;
justify-self: flex-start;
}
.divider {
grid-area: divider;
cursor: ew-resize; /* Horizontal resize cursor */
background-color: var(--color-border); /* Visible width of the divider */
width: 100%; /* Ensures it stretches across the grid area */
position: relative; /* Position for the pseudo-element */
}

.divider::before {
content: "";
position: absolute;
top: 0;
left: -10px; /* Extend the grab area to the left */
right: -10px; /* Extend the grab area to the right */
bottom: 0;
cursor: ew-resize; /* Maintain the resize cursor over the grab area */
}
.chat-window{
width: 100%;
padding: 0;
padding-bottom: 2rem;
box-sizing: border-box;
display: flex;
flex-flow: column nowrap;
height: 100%; /* Höhe des Bildschirms */
overflow-y: scroll; /* Ermöglicht Scrollen bei langen Chatverläufen */
}
.chat-bubble {
margin: 5px 0;
padding: 10px;
border-radius: 10px;
max-width: 80%;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
color: var(--color-text);
align-self: flex-start;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 15px;     /* comfortable reading size */
letter-spacing: 0.8px; /* slight spacing for clarity */
line-height: 1.6;     /* airy lines for readability */
font-weight: 450;
}
.llm_answer_area{
margin: 15px 1px;
padding: 15px 1px;
border-radius: 15px;
width: 95%;
}

.loading_container{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color:#ebebeb;   
width: 8rem;
}
#loading_text{
color:var(--color-text);
margin: 0;
padding: 0;

background: linear-gradient(90deg, var(--color-text-muted), var(--color-text-secondary), var(--color-text-muted), var(--color-text-secondary), var(--color-text-muted), var(--color-text-secondary), var(--color-text-muted));
background-size: 300% 100%;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: gradientShift 1s infinite linear;
}

.runResponseIndicator{
    margin: 0 auto;
    border: white;
    border-radius: 50%;
    padding: 20%;
    margin-left: 10px;
}

#runResponseIndicator{
    animation: rotation 3s linear 0s infinite;
    animation-play-state: paused;
    border: 1px solid #40acac;
    justify-content: center;
    border-radius: 50%;
    margin-left: 10px;
}

/* Response indicator wrapper - positioned left above input */
.cancel-run-button-wrapper {
    position: absolute;
    bottom: 80px;  /* Above input field */
    left: 0;       /* Left aligned */
    z-index: 100;
}

/* Container for button + text - controls visibility */
.indicator-container {
    display: none !important;  /* Hidden by default */
    align-items: center;
    gap: 15px;
    background: transparent;  /* Transparent background */
    padding: 10px 18px;
    border-radius: 25px;
}

/* Show container when wrapper is active */
.cancel-run-button-wrapper.active .indicator-container {
    display: flex !important;  /* Show when active */
}

/* Spinning border */
.crb-border {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--color-accent) 0%,
        transparent 50%,
        var(--color-accent) 100%
    );
    animation: rotation 1.5s linear infinite;
    flex-shrink: 0;
}

/* Cancel button inside spinning border */
.cancel-run-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-background);
    border: 2px solid var(--color-accent);
    color: var(--text-base-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.cancel-run-button::before {
    content: "✕";
    font-weight: bold;
    color: var(--color-text);
}

.cancel-run-button:hover {
    background: #dd3333;
    border-color: #dd3333;
    color: var(--color-text);
    transform: translate(-50%, -50%) scale(1.15);
}

/* Status text */
.status-text {
    color: var(--color-accent);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.5px;
    animation: pulse-text 2s ease-in-out infinite;
}

/* Text pulse animation */
@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Rotation animation */
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status color variants */
.status-text.status-thinking {
    color: var(--color-accent);
}

.status-text.status-tool {
    color: #FFA500;
}

.status-text.status-generating {
    color: #00BFFF;
}

.status-text.status-error {
    color: #ff4444;
}

@keyframes gradientShift {
0% {
    background-position: 100% 0%;
}
100% {
    background-position: 0% 0%;
}
}
.loader {
/*border: 3px solid #f3f3f3;*/

border-radius: 3px;

margin-top: 0.3rem;
  
;
background-color: #ebebeb;
width: 50px;
height: 5px;
-webkit-animation: loading 2s ease-in-out infinite; /* Safari */
animation: loading 0.8s ease-in-out infinite;
}
@keyframes loading {
0% {
    margin-left: -50%;
    width: 20px;
}
25%{
    width: 50px;
}
50% {
    margin-left: 50%;
    width: 20px; /* Squished width */
}
75%{
    width: 50px;
}
100% {
    margin-left: -50%;
    width: 20px;
}
}
@-webkit-keyframes loading {
0% {
    left: 0;
    width: 50px;
}
50% {
    left: 80%;
    width: 25px; /* Squished width */
}
100% {
    left: 0;
    width: 50px;
}
}
/* Hide scrollbars for all browsers */
::-webkit-scrollbar {
    display: none;
    width: 0;
    background: transparent;
}
::-webkit-scrollbar-thumb {
    display: none;
    background: transparent;
}

/* Firefox scrollbar hiding */
* {
    scrollbar-width: none;
}

/* IE/Edge scrollbar hiding */
* {
    -ms-overflow-style: none;
}
.human, .own{
background-color: var(--color-surface-active);
align-self: flex-end;
}

.foreign{
background-color: var(--color-accent);
color: var(--color-text);
align-self: flex-start;
}
.llm {
    color: var(--color-text);
    align-self: flex-start;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;     /* comfortable reading size */
    letter-spacing: 0.8px; /* slight spacing for clarity */
    line-height: 1.6;     /* airy lines for readability */
    padding: 10px;
    font-weight: 430;
}
.thinking {
    color:gray;
    font-style: italic;
}

/* Improved list styling in LLM messages */
.llm ul, .llm ol {
  margin-left: 2em;
  margin-bottom: 0.8em;
  display: block;
  padding-left: 0.5em;
  list-style-position: outside;
}

.llm li {
  margin-bottom: 0.5em;
  display: list-item;
  padding-left: 0.3em;
}

.llm ul ul, .llm ol ol,
.llm ul ol, .llm ol ul {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.llm ul {
  list-style-type: disc;
}

.llm ul ul {
  list-style-type: circle;
}

.llm ol {
  list-style-type: decimal;
}

.input-container {
  display: flex;
  align-items: center;
  margin-top: auto;
  justify-self: flex-end;
  gap: 10px;
}

.input-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
  background-color: #f0f0f0;
  border-radius: 10px;
  border: 1px solid #ccc;
}

.input-message-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  justify-self: flex-end;
}

.chat-input {
  flex-grow: 1;
  border: none;
  background-color: #f0f0f0;
  border-radius: 10px;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;     /* comfortable reading size */
  letter-spacing: 0.8px; /* slight spacing for clarity */
  line-height: 1.6;     /* airy lines for readability */
  padding: 6px 12px;
  font-weight: 500;
  max-width: calc(100% - 40px);
  /* Specific styles for textarea */
  resize: none;         /* Disable manual resizing */
  max-height: 150px;    /* Limit height growth */
  overflow-y: auto;     /* Add scrollbar when needed */
  min-height: 36px;     /* Match current input height */
}

/* File upload styling */
.upload_form {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  margin-right: 2px;
}

.upload_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: #f0f0f0;
  color: var(--color-surface-active); 
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 22px;
}

.upload_button:hover {
  background-color: #eaeaea;
}

.file-preview {
  padding: 5px 10px;
  margin: 5px 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.file-preview p {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 6px 6px 6px 6px;
  border-radius: 8px;
  width: fit-content;
  margin: 0;
  position: relative;
}

.file-preview i {
  margin-right: 4px;
  margin-left: 4px;
  color: var(--color-accent);
}

.delete-attachment {
  margin-left: 10px;
  background-color: transparent;
  border: none;
  color: rgba(255, 0, 0, 0.5);
  cursor: pointer;
  font-size: 14px;
  padding: 0 0px;
}

.delete-attachment:hover {
  color: red;
}

/* Message Attachment Styles */
.message-attachment {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 5px 0;
    padding: 6px 6px 6px 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: fit-content;
    font-size: 14px;
    color: var(--color-text-muted);
    position: relative;
}

.message-attachment i {
    margin-right: 4px;
    margin-left: 4px;
    color: var(--color-accent);
    font-size: 14px;
}

.attachment-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.hidden {
  display: none;
}

.send-button {
margin-left: 10px;
padding: 8px 16px;
background-color: var(--color-surface-active);
color: var(--color-text);
border: none;
border-radius: 10px;
cursor: pointer;
outline: none;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 15px;     /* comfortable reading size */
letter-spacing: 0.8px; /* slight spacing for clarity */
line-height: 1.6;     /* airy lines for readability */
font-weight: 450;
transition: background-color 0.3s ease;
}
.send-button:hover {
background-color: var(--color-text-secondary);
}
.cancel-button{
background-color: #d25050;
}
.cancel-button:hover{
background-color: #ff6a6a;
}
#delete-memory{
align-self: center;
justify-self: flex-end;
margin-left: auto;
background-color: transparent;
color: rgba(255, 0, 0, 0.455);
/*treat div as button (hover, cursor, etc.)*/
cursor: pointer;
size: fit-content;
font-size: 1.2rem;
transition: color 0.3s ease;
&:hover{
    color: red;
}

}
#delete-workflow{
    margin-left: auto;
    background-color: transparent;
    color: rgba(255, 0, 0, 0.455);
    /*treat div as button (hover, cursor, etc.)*/
    cursor: pointer;
    size: fit-content;
    font-size: 1.2rem;
    transition: color 0.3s ease;
    &:hover{
        color: red;
    }
}


.topbar {
grid-area: topbar;
display: grid;
grid-template-areas: 
    "logo nav";
var(--color-background);
color: var(--color-text);
padding: 1rem;
}
a{
text-decoration: none;
}

#topbar-logo{
grid-area: logo;
width: auto;
font-size: 35px;
}

.topbar__nav{
display: flex;
flex-direction: row;
justify-content: space-evenly;
grid-area: nav;
justify-self: flex-end;
align-self: center;
}
.topbar__profile-pic {
width: 32px; /* Set appropriate size */
height: 32px;
border-radius: 50%; /* Makes the image circular */
object-fit: cover; /* Ensures the image fits within the circle */
margin-right: 10px; /* Adds spacing if needed */
vertical-align: middle; /* Aligns image with text */
cursor: pointer;

}
.topbar__menu {
display: flex;
width: fit-content;
text-decoration: none;
flex-direction: row;
list-style-type: none;
}
.topbar__item{
padding: 0 1rem 0 1rem;
text-align: center;
}
.username{
display: flex;
align-items: center;
justify-content: flex-end;
color: var(--color-text-secondary)
}
.topbar__link{
color: var(--color-text-secondary);
text-decoration: none;
font-size: large;
transition: 0.1s ease-in-out;
&:hover{
    color: var(--color-text);
}
}
/* Dropdown Menu */
/* Dropdown menu styles (unchanged from earlier example) */
.dropdown-menu {
z-index: 99999;
position: absolute;
right: 0;
background-color: var(--color-surface-elevated);
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
overflow: hidden;
list-style: none;
margin: 0;
padding: 20px 0 10px 0;
width: 200px;
opacity: 0;
transform: scale(0.3) translateY(-20px);
transform-origin: top right;
transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s;
visibility: hidden;
}

.dropdown-menu.open {
opacity: 1;
transform: scale(1) translateY(0);
visibility: visible;
}

/* Individual dropdown items */
.dropdown-item {
display: flex; /* Ensures icon and text align properly */
align-items: center;
padding: 10px 15px;
transition: background-color 0.2s;
}

.dropdown-item:hover {
background-color: var(--color-surface-active);
}
.dropdown-item:hover i{
color: var(--color-text-secondary);
}


/* Icons in the dropdown menu */
.dropdown-item i {
width: 20px; /* Ensures consistent width for all icons */
text-align: center; /* Aligns the icons horizontally */
margin-right: 10px; /* Adds spacing between icon and text */
color: var(--color-text-secondary);
}

/* Text in the dropdown menu */
.dropdown-item span {
font-size: 14px;
color: var(--color-text-secondary);
}
.dropdown-item:hover span{
color: var(--color-text-secondary);
}
/* Links inside the dropdown */
.dropdown-link {
display: flex;
align-items: center; /* Ensures text and icon align vertically */
text-decoration: none;
width: 100%;
height: 100%;
color: inherit;
}
.logo{
font-size: 8rem;
color: var(--color-accent)

}

/* Sidebar */
.sidebar {
grid-area: sidebar;
var(--color-background);
display: flex;
justify-content: center;
width: 3.5rem; /* Default collapsed width */
overflow: hidden;
transition: width 0.3s ease; /* Smooth expand transition */
overflow-y: scroll;
}

.sidebar:hover {
width: 240px; /* Expanded width */
}

.sidebar__nav{
    width: 100%;
}

/* Sidebar Menu */
.sidebar__menu {
display: flex;
width: 100%;
flex-direction: column;
list-style-type: none;

}

/* Sidebar Items */
.sidebar__item {
width: 100%;
display: flex;
height: 3rem;
padding-left: 1rem;
margin-right: 0.5rem;


}


/* Sidebar Dropdown */
.sidebar__dropdown {
flex-direction: column;
overflow: hidden;
justify-content: center;
height: fit-content;
min-height: 3rem;

}

.sidebar__dropdown-header {
display: flex;
align-items: center;
color: var(--color-text-secondary);
cursor: pointer;
padding: 0.1rem 0;
margin-left: 0;
font-size:  large;
transition: color 0.1s ease-in-out;
}

.sidebar__dropdown-header:hover {
color: var(--color-text);
}

.sidebar__dropdown-header i {
width: 1rem;
}

.sidebar__dropdown-header .dropdown-icon {
margin-left: auto;
margin-right: 1rem;
font-size: 0.8rem;
opacity: 0;
transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar__dropdown-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
list-style-type: none;
margin-left: 1.5rem;
padding-left: 0;
}

.sidebar__dropdown.active .sidebar__dropdown-content {
max-height: 200px; /* Height limit before scrolling */
overflow-y: auto; /* Enable scrolling when content exceeds max-height */
padding-right: 5px; /* Prevent content from touching scrollbar */
}

/* Make scrollbar visible for dropdown content */
.sidebar__dropdown-content::-webkit-scrollbar {
display: block;
width: 3px;
background-color: var(--color-surface);
}

.sidebar__dropdown-content::-webkit-scrollbar-thumb {
display: block;
width: 3px;
background-color: var(--color-accent);
}

.sidebar__dropdown.active .dropdown-icon {
transform: rotate(180deg);
}

.sidebar__dropdown-item {
padding: 0.2rem 0;
margin: 0.2rem 0;
border-radius: 0.5rem;
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
}

.sidebar__dropdown-item .sidebar__link {
padding-left: 0.5rem;
flex-grow: 1;
display: block;
font-size: 0.9rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 180px;
}

/* Delete chat button styling */
#delete-chat-btn {
margin-left: 8px !important;
padding: 0.2rem 0.4rem;
border-radius: 4px;
transition: all 0.2s ease;
opacity: 0.6;
font-size: 0.8rem;
color: var(--color-text-secondary);
}

#delete-chat-btn:hover {
opacity: 1;
background-color: rgba(255, 68, 68, 0.2);
color: #ff4444;
}
#new-tiktok-user{
font-size: 1.5rem;
}
.active__chat{
background-color: var(--color-accent);
}
.active__chat .sidebar__link {
color: var(--color-text);
padding: 0.3rem;
transition: color 0.1s ease-in-out;
&:hover {
    color: black;
}
}

/* Sidebar Links */
.sidebar__link {
display: flex;
align-items: center;
justify-content: center;
color: var(--color-text-secondary);
text-decoration: none;
font-size: large;
transition: color 0.1s ease-in-out;
& i {
    width: 1rem;
    text-align: center;

}

&:hover {
    color: var(--color-accent);
}

}

/* Hide text by default */
.sidebar__text {
margin-left: 1rem;
opacity: 0; /* Invisible */
white-space: nowrap; /* Prevent text wrapping */
overflow: hidden;
transition: opacity 0.3s ease; /* Smooth text fade-in */
}

/* Show text on hover */
.sidebar:hover .sidebar__text {
opacity: 1; /* Fully visible */
}

/* Show dropdown arrow on hover */
.sidebar:hover .sidebar__dropdown-header .dropdown-icon {
opacity: 1;
}

.new-message-container{
display: flex;
margin-top: 2rem;
justify-self: flex-end;
width: 100%;
flex-direction: column;
justify-content: center;
align-items: center;
color: var(--color-text-secondary);
}
.input-message-container{
display: flex;
flex-direction: row;
width: 100%;
justify-content: center;
align-items: center;
}
.input-sender-container{
margin-top: 1rem;
}
.sender-select{
padding: 0.5rem;
border-radius: 5px;
var(--color-background);
color: var(--color-text);
border: 1px solid var(--color-text-secondary);
min-width: 150px;
margin-right: 1rem;
cursor: pointer;
transition: border-color 0.2s ease-in-out;
&:hover{
    border-color: var(--color-text);
}
}
.sender-select option{
border: none;
var(--color-background);
}
#new-message-button{
font-size: 1.5rem;
width: 1.5rem;
height: 1.5rem;
background-color: #00000000;
border: none;
color: var(--color-text-secondary);
transition: color 0.2s ease-in-out;
transition: opacity 0.4s ease-out;
opacity: 1;
cursor: pointer;
&:hover{
    color: var(--color-accent);
}
}
#new-message-button-hidden{
transition: opacity 0.4s ease-out;
opacity: 0;
pointer-events: none;
}
#new-message-input{
transition: opacity 0.5s ease-out;
opacity: 0;
transition: margin-top 0.5s ease-out;
pointer-events: none;
margin-top: -1rem;
width: 100%;
}
#new-message-input-visible{
opacity: 1;
transition: opacity 0.5s ease-out;
transition: margin-top 0.5s ease-out;
pointer-events: all;
margin-top: 0rem;
width: 100%;
}


/* User Dashboard */
.user-dashboard {
padding: 1rem;
color: var(--color-text);
}

.user-dashboard__header {
display: flex;
justify-content: flex-start;
margin-bottom: 1rem;
}

.btn {
background: var(--color-accent);
color: var(--color-text);
border: none;
padding: 0.5rem 1rem;
cursor: pointer;
font-size: 1rem;
border-radius: 5px;
transition: background 0.3s ease;
}

.btn-primary:hover {
background: #3a8b8b;
}

.btn-icon {
background: var(--color-surface);
border: none;
color: var(--color-text);
font-size: 1.2rem;
cursor: pointer;
}

.user-dashboard__table-container {
overflow-x: auto;
}

.user-dashboard__table {
width: 100%;
border-collapse: collapse;
}

.user-dashboard__table th,
.user-dashboard__table td {
text-align: left;
padding: 0.75rem;
border-bottom: 1px solid var(--color-text-secondary);
}

.user-dashboard__table th {
cursor: pointer;
color: var(--color-text-secondary);
font-weight: 600;
text-transform: uppercase;
}

.user-dashboard__table td {
color: var(--color-text);
}

/* .modal {
position: fixed;
display:none;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
} */

/* .modal-content {
background: #2b2b2b;
padding: 2rem;
border-radius: 8px;
} */

.close-modal {
position: absolute;
top: 1rem;
right: 1rem;
cursor: pointer;
color: var(--color-text);
font-size: 1.5rem;
}

/* Flash Messages */
.error-container{
position: fixed;
display: flex;
top: 5vh;
left: 50vw;
transform: translate(-50%, 0);
z-index: 999;

background-color: rgb(255, 72, 72);
border-radius: 0.375rem;
box-shadow: var(--card-box-shadow);

transform-origin:0;
visibility: hidden;
animation: error_popup .2s ease-out .1s forwards;
}
.success-container{
position: fixed;
display: flex;
top: 5vh;
left: 50vw;
transform: translate(-50%, 0);
z-index: 999;

background-color: rgb(0, 182, 30);
border-radius: 0.375rem;
box-shadow: var(--card-box-shadow);

transform-origin:0;
visibility: hidden;
animation: error_popup .2s ease-out .1s forwards;
}
@keyframes error_popup{
0%   {     
scale: 0%;
visibility: visible;
}
80%   {
scale: 110%;
visibility: visible;
}
100% { 
scale: 100%;
visibility: visible;
} 
}
.flashes{
padding: 0.45rem 1.5rem 0.45rem 1.5rem;
color: var(--color-text);
list-style-type: none;
}

@keyframes fade_out {
0% {
    opacity: 1;
    visibility: visible;
}
100% {
    opacity: 0;
    visibility: hidden;
}
}

/* Inputs */
#create-user-form{
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: repeat(9, 1fr);
grid-template-areas: 
"modal-title modal-title"
"first-name last-name"
"username username"
"email-address email-address"
"phone-number phone-number"
"password password"
"password-confirm password-confirm"
"role confirmed"
"submit submit";
gap: 0.2rem;
}
#edit-user-form{
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: repeat(7, 1fr);
grid-template-areas: 
"modal-title modal-title"
"first-name last-name"
"username username"
"email-address email-address"
"phone-number phone-number"
"role confirmed"
"submit submit";
gap: 0.2rem;
}
#modal-title{
grid-area: modal-title;
}
.first-name{
grid-area: first-name;
}
.last-name{
grid-area: last-name;
}
.username{
grid-area: username;
}
.email-address{
grid-area: email-address;
}
.phone-number{
grid-area: phone-number;
}
.password{
grid-area: password;
}
.password-confirm{
grid-area: password-confirm;
}
.role{
grid-area: role;
}
.confirmed{
grid-area: confirmed;
}
#system-data-graph{
var(--color-background);
}
.submit{
grid-area: submit;
& input[type="submit"]{
    background-size: 200% auto;
    background-image: linear-gradient(to right, #84fab0 0%, var(--color-accent) 51%, #84fab0 100%);
}

}
.cancel{
grid-area: cancel;
& input[type="submit"]{
    background-size: 200% auto;
    background-image: linear-gradient(to right, var(--base-orange) 0%, #ff0d0d 51%, var(--base-orange) 100%);
}
}


input:focus {
outline: none;
}

.form-group {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
outline: none;
border-radius: 20px;
}

.form-group input {
display: flex;
box-sizing: border-box;
font-size: large;
background-color: black;
color: var(--color-text);
outline: none;
border: none;
display: block;
width: 100%;
border-radius: 5px;
padding: 1.5rem 1.2rem 0.2rem 1.2rem;
transition: .2s ease all;
&:focus{
    box-shadow: 0 1px 0 0 rgb(75, 75, 75);
}
&::placeholder {
    color: transparent;
  }
}

.form-group label {
position: absolute;
top: 35%;
left: 1rem;
color: rgb(168, 168, 168);
pointer-events: none;
transition: transform 250ms;
transform-origin: left;
font-size: 1rem; 
}

.form-group input:focus + .label,
.form-group input:not(:placeholder-shown) + .label {
transform: translateY(-70%) scale(0.85); 
}

.form-group input[type="submit"]{
padding: 0.3rem;
margin: 0.5rem;

color: var(--color-text);
text-align: center;
cursor: pointer;
transition: .2s ease all;
background-position: right center;
&:hover{
    background-position: left center;
}
}
.form-group select{
padding: 0.5rem;
margin: 0.5rem;
outline: none;
border: none;
font-size: 1rem;
border-radius: 5px;
box-shadow: none;
color: var(--color-text);
text-align: center;
cursor: pointer;
var(--color-background);
}

.form-group select option {
    background-color: var(--color-surface);
}

.hidden {
  display: none !important;
}

/* Drag and drop styling */
.highlight-drop {
  border: 1px dashed var(--color-accent) !important;
  background-color: rgba(60, 160, 160, 0.03);
  position: relative; /* Ensure relative positioning for absolute children */
  border-radius: 5px;
}

.highlight-drop::after {
  content: "Drop file here";
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-accent);
  font-size: 24px;
  font-weight: 450;
  opacity: 0.8;
  pointer-events: none;
  padding: 8px 20px;
  background-color:  rgba(60, 160, 160, 0.0);
  border-radius: 4px;
  z-index: 5;
  white-space: nowrap;
}

/* Styles specific for the prompts page */

.prompt-management-grid {
    display: grid;
    grid-template-columns: 1fr 3fr;
    grid-template-areas: "metadata prompts" ;
    gap: 6rem;
    padding: 1rem;
    max-height: 90vh;
}


.prompt-section{
    grid-area: prompts;
    background: var(--color-background);
    padding: 1rem;
    border-radius: 5px;
    overflow-y: scroll;
    max-height: 100%;
}
.prompt-section::-webkit-scrollbar {
    display: block;
    width: 2px;
    background-color: var(--color-surface);
  }
.prompt-section::-webkit-scrollbar-thumb {
    display: block;
    width: 8px;
    background-color: var(--color-accent);
  }
.prompt-section-item {
    background: var(--color-background);
    padding: 1rem;
    border-radius: 5px;
}
.metadata-section{
    grid-area: metadata;
    background: var(--color-background);
    padding: 1rem;
    border-radius: 5px;
}

.submit-container{
    display: flex;
    flex-direction: row;
    gap: 1rem;
    width: 90%;
    align-items: center;
    margin-top: 0.3rem;
}

.prompt-section-item label {
    display: block;
    margin-bottom: 0.1rem;
}
.prompt-textarea {
    width: 100%;
    height: 35vh;
    background-color: black;
    color: var(--color-text);
    border: 1px solid var(--color-surface);
    border-radius: 5px;
    padding: 1rem;
    font-size: small;
    resize: none;
}
.prompt-save-btn {
    background: var(--color-accent);
    color: var(--color-text);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 5px;
    transition: background 0.3s ease;
}
.prompt-save-btn:hover {
    background: #3a8b8b;
}
.prompt-name {
    width: 30%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}
.prompt-select{
    width: 20%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}
.runble-select{
    width: 50%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}

.latest_sort{
    background-color: rgb(70, 70, 70);
}


.login_container{
    display: flex;
    flex-direction: column;
    width: 30%;
    height: 40%;
    justify-self: center;
    justify-content: space-around;
    align-items: center;

}

.signup_container{
   display: flex;
   flex-direction: column;
   width: 30%;
   height: 40%;
   justify-self: center;
   justify-content: space-around;
   align-items: center; 
}

.form_ form{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3vh;
    align-items: center;
    width: 100%;
    height: 100%;
}



/* Styles specific for the prompts page */
.prompt-management-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;

}
.prompt-section {
    margin-bottom: 2rem;
    background-color: #202123;
}
.prompt-section label {
    display: block;
    margin-bottom: 0.1rem;
}
.prompt-textarea {
    width: 100%;
    height: 35vh;
    background-color: black;
    color: var(--color-text);
    border: 1px solid var(--color-surface);
    border-radius: 5px;
    padding: 1rem;
    font-size: small;
    resize: none;
}
.prompt-save-btn {
    background: var(--color-accent);
    color: var(--color-text);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 5px;
    margin-top: 0.5rem;
    transition: background 0.3s ease;
}
.prompt-save-btn:hover {
    background: #3a8b8b;
}
.textlink{
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    &:hover{
        color: var(--color-text);
    }

}
.workflow-buttons{
    display: flex;
    flex-direction: row;
    gap: 1rem;

    align-items: center;
}




/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Section wrapper */
.section {
  margin-bottom: 64px;
}

/* Section headings */
.section-heading {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: #111827;
}

/* Grid for cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Card styles */
.card {
  background-color: var(--color-text)fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111827;
}

.card p {
  font-size: 1rem;
  color: #4b5563;
}

/* Responsive typography */
@media (max-width: 768px) {
  .section-heading {
    font-size: 1.5rem;
  }

  .card {
    padding: 20px;
  }

  .card h3 {
    font-size: 1.1rem;
  }

  .card p {
    font-size: 0.95rem;
  }
}

/* Settings Page Layout */
.settings-container {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.settings-sidebar {
    width: 280px;
    var(--color-background);
    border-right: 1px solid var(--color-text-secondary);
    padding: 2rem 0;
    flex-shrink: 0;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 1rem;
    background: var(--color-surface-elevated);
}

.settings-nav-item:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.settings-nav-item.active {
    background: var(--color-accent);
    color: var(--color-text);
}

.settings-nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.settings-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--color-text)
}

.settings-header {
    padding: 2rem 3rem 1rem;
    border-bottom: 1px solid var(--color-text-secondary);
}

.settings-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.settings-section {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.settings-section.active {
    display: block;
}

.settings-content {
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Settings Cards */
.settings-card {
    background: var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-surface-hover);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.settings-card:hover {
    border-color: var(--color-surface-active);
}

.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--color-surface-elevated);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.settings-card-header i {
    color: var(--color-accent);
    font-size: 1rem;
}

.settings-card-content {
    padding: 2rem;
}

/* Profile Picture Section */
.profile-picture-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.current-profile-pic {
    flex-shrink: 0;
}

.profile-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-accent);
}

.profile-upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.file-input-group {
    position: relative;
}

.file-input-group input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-input-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.file-input-label:hover {
    background: var(--color-text-secondary);
}

.file-selected-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent);
    font-size: 0.9rem;
    font-weight: 600;
}

.file-selected-indicator i {
    font-size: 0.8rem;
}

/* Institution Section */
.institution-select-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
}

.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.connected {
    background: rgba(34, 197, 94, 0.2);
    color: rgb(34, 197, 94);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: rgb(239, 68, 68);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Integration Sections */
.integration-connected,
.integration-setup {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.integration-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    margin-bottom: 8px;
}

.integration-info p {
    margin: 0;
    color: var(--color-text);
    font-size: 0.9rem;
}

.integration-description {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Token Setup */
.token-setup {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

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

.token-display label {
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.9rem;
}

.token-code {
    background: var(--color-background);
    border: 1px solid var(--color-text-secondary);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--color-accent);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.setup-instructions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setup-instructions h4 {
    color: var(--color-text);
    margin: 0;
    font-size: 1rem;
}

.setup-instructions ol {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.setup-instructions ol li {
    margin-bottom: 0.5rem;
}

.setup-instructions code {
    background: var(--color-background);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--color-accent);
    font-family: 'Courier New', monospace;
}

.token-expiry {
    color: orange;
    font-size: 0.8rem;
    margin: 0;
}

.token-generate-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.form-help {
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

/* Cloud Storage Integration Rows */
.integration-row {
    background: var(--color-surface);
    border: 1px solid var(--color-surface-elevated);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.integration-row:hover {
    background: var(--color-surface-elevated);
    border-color: var(--color-surface-hover);
}

.integration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.integration-header span {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--color-text);
    font-weight: 600;
    font-size: 1rem;
}

.integration-header i {
    font-size: 1.2rem;
}

.integration-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Credentials Section */
.section-description {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

.add-credential-form {
    margin-bottom: 2rem;
}

.credential-input-group {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 1rem;
    align-items: center;
}

.credentials-list {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

/* Credential Row Styles */
.credential-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.8rem;
    background: var(--color-background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.credential-row:hover {
    background: var(--color-background);
    border-color: rgba(255, 255, 255, 0.2);
}

.credential-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.credential-name {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.9rem;
}

.credential-name i {
    color: var(--color-accent);
    font-size: 0.8rem;
}

.credential-values {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: fit-content;
  min-width: 20%;
}

.credential-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.credential-preview {
    font-family: 'Courier New', monospace;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    background: var(--color-background);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: flex-end;
    justify-self: flex-end;
}

.credential-delete-form {
    margin: 0;
}

.credential-delete-btn {
    background: none;
    border: none;
    color: rgba(239, 68, 68, 0.6);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credential-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(239, 68, 68, 0.9);
}

.credential-delete-btn i {
    font-size: 0.9rem;
}

/* Form Elements */
.settings-select,
.settings-input {
    padding: 0.75rem;
    background: var(--color-background);
    border: 1px solid var(--color-text-secondary);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    margin-bottom: 10px;
}

.settings-select:focus,
.settings-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.settings-select {
    cursor: pointer;
}

.settings-input[type="password"] {
    font-family: 'Courier New', monospace;
}

/* Coming Soon */
.coming-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--color-text-secondary);
    font-style: italic;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: var(--color-background);
}

.coming-soon i {
    font-size: 1.2rem;
    color: var(--color-accent);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .settings-sidebar {
        width: 250px;
    }
    
    .settings-content {
        padding: 1.5rem 2rem;
    }
    
    .credential-input-group {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
}

@media (max-width: 768px) {
    .settings-container {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        padding: 1rem 0;
    }
    
    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem;
    }
    
    .settings-nav-item {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
    }
    
    .settings-content {
        padding: 1rem;
    }
    
    .profile-picture-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .institution-select-group {
        flex-direction: column;
        align-items: stretch;
    }
}





/* Admin */
.stats-overview-container{
    display: flex;
    flex-direction: row;
    gap: 1rem;
    width: 98%;
    align-self: center;
    
}
.stats-overview{
    padding: 0.5rem;
    background-color: var(--color-surface-elevated);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 3px 10px 0 rgba(0, 0, 0, 0.19);

    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;

}
.stats-overview h3 {
    color:rgba(0,191,255,1);
    font-size: xx-large;
    font-weight: 100;
}

.widget-container{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1rem;
    width: 98%;
    align-self: center;
}
.widget-item-container{
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    padding: 1rem;
    box-shadow: var(--card-box-shadow);
    height: fit-content;
    background-color: var(--color-surface-elevated);
}
.widget-item-header{
    display: flex;
    flex-direction: row;
    gap: 1rem;

}
.true-h1{
    font-size: 2rem;
}
.admin-content{
    display: flex;
    flex-direction: row;
    overflow-y: scroll;
    gap: 1rem;
    overflow-y: scroll;
}
.admin-main-content{
    flex-grow: 1;;
}

/* Admin DB Sidebar */
.sidebar.collapsed {
    width: 60px; /* Shrink it down */
    overflow: hidden;
}

.admin-sidebar {
    width: 240px;
    color: var(--color-text);
    background-color: var(--color-background);
    padding: 1rem;
    z-index: 100;
    justify-self: flex-start;
    height: 100vh;
    transform: translate(-1rem, -1rem); /* Moves it back over the margin */
    padding-left: 1.5rem;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 12px 40px 0 rgba(0, 0, 0, 0.19);
    position: relative;
}

.admin-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: -16px;
    width: 16px;
    height: 100%;
    background: linear-gradient(90deg, var(--color-background) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.admin-menu {
    list-style: none;
    padding: 0;
}

.admin-menu li {
    margin-bottom: 1rem;
}

.admin-menu a {
    color: var(--color-text);
    text-decoration: none;
}

.active__admin a {
    font-weight: bold;
    color: #4ecdc4; /* Highlight color */
}


/* Creator ReactFlow Canvas */

.reactflow-wrapper {
    background: var(--color-background);
    border-radius: 0.375rem;
}

.reactflow-container {
    background: linear-gradient(90deg, var(--color-surface-elevated) 1px, transparent 1px),
                linear-gradient(var(--color-surface-elevated) 1px, transparent 1px);
    background-size: 25px 25px;
}

.reactflow-controls .btn {
    background: var(--color-background)
    color: var(--color-background);
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 15px;
    padding-right: 15px;
}

.reactflow-controls .btn:hover {
    background: var(--color-background)   transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ReactFlow node styling overrides */
.react-flow__node {
    cursor: default;
}

.react-flow__node.selected {
    box-shadow: 0 0 0 2px #007bff;
}

.react-flow__edge {
    cursor: default;
}

.react-flow__edge.selected .react-flow__edge-path {
    stroke: #007bff;
    stroke-width: 3;
}

/* Attribution styling */
.react-flow__attribution {
    font-size: 14px;
    opacity: 0.6;
}

/* Multi-File Upload Styling */
.file-preview {
    margin-bottom: 10px;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem;
    background: #2a2a2a;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

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

.file-item.single-file {
    border-color: #007acc;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.file-info i {
    color: #007acc;
    font-size: 16px;
    flex-shrink: 0;
}

.file-name {
    color: var(--color-text-muted);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #999;
    font-size: 12px;
    margin-left: auto;
    padding-left: 10px;
    flex-shrink: 0;
}

.remove-file-btn {
    background: #ff4444;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.remove-file-btn:hover {
    background: #ff6666;
}

.file-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid var(--color-surface);
    border-radius: 6px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.upload-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: #007acc;
}

.upload-loading i {
    font-size: 16px;
}

.upload-error {
    position: relative;
    padding: 12px;
    background: #2a1a1a;
    border: 2px solid #ff4444;
    border-radius: 6px;
    color: #ff6666;
}

.upload-error i {
    margin-right: 8px;
    font-size: 16px;
}

.error-message {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.error-details {
    margin: 8px 0 0 24px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.error-details li {
    margin-bottom: 4px;
}

.close-error-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #ff6666;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.close-error-btn:hover {
    color: #ff8888;
}

.upload-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2a2a1a;
    border: 1px solid #ffcc00;
    border-radius: 6px;
    color: #ffcc00;
    margin-bottom: 8px;
    position: relative;
}

.upload-warning i {
    font-size: 14px;
}

.close-warning-btn {
    position: absolute;
    top: 4px;
    right: 8px;
    background: transparent;
    border: none;
    color: #ffcc00;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
}

.close-warning-btn:hover {
    color: var(--color-text);
}

/* File type specific colors */
.file-info .fa-image { color: #4CAF50; }
.file-info .fa-file-pdf { color: #f44336; }
.file-info .fa-file-word { color: #2196F3; }
.file-info .fa-file-excel { color: #4CAF50; }
.file-info .fa-file-powerpoint { color: #FF9800; }
.file-info .fa-file-text { color: #9E9E9E; }
.file-info .fa-file-code { color: #E91E63; }
.file-info .fa-file-archive { color: #795548; }

/* Agent Upload Tool Styling */
.upload-request-container {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border: 2px solid #007acc;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.2);
}

.upload-request-message {
    margin-bottom: 15px;
}

.upload-request-message i {
    color: #007acc;
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.upload-request-message p {
    color: var(--color-text-muted);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.upload-request-details {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.upload-request-details small {
    color: color: var(--color-text-secondary);
    font-size: 13px;
    background: var(--color-surface);
    padding: 4px 8px;
    border-radius: 4px;
}

.upload-trigger-btn {
    background: linear-gradient(135deg, #007acc, #0056b3);
    border: none;
    border-radius: 8px;
    color: var(--color-text);
    cursor: pointer;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 204, 0.3);
}

.upload-trigger-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.4);
}

.upload-trigger-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments for multi-file upload */
@media (max-width: 600px) {
    .file-info {
        gap: 8px;
    }
    
    .file-name {
        font-size: 13px;
    }
    
    .file-size {
        font-size: 11px;
    }
    
    .file-summary {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
    }
    
    .clear-all-btn {
        align-self: center;
        width: fit-content;
    }
    
    .upload-request-details {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }
}

/* Admin Dashboard User Detail - Workflows Section */
.workflows-section {
    padding: 1.5rem;
}

.section-title {
    color: var(--color-text);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
}

.workflows-table-container {
    background: var(--color-background);
    border-radius: 8px;
    overflow: hidden;
}

.workflows-table {
    width: 100%;
    border-collapse: collapse;
}

.workflows-table thead {
    background: var(--color-background);
}

.workflows-table th {
    padding: 1rem;
    text-align: left;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workflows-table th:first-child {
    width: 40px;
    text-align: center;
}

.workflow-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.workflow-row:hover {
    background: rgba(60, 160, 160, 0.1);
}

.workflow-row td {
    padding: 1rem;
    color: var(--color-text);
}

.workflow-row td:first-child {
    text-align: center;
}

.wf-name {
    font-weight: 600;
    color: var(--color-text);
}

.wf-id {
    color: var(--color-text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.wf-timestamp {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.btn-share {
    background: var(--color-accent);
    color: var(--color-text);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-share:hover {
    background: #2d7a7a;
    transform: translateY(-2px);
}

.btn-share i {
    font-size: 0.85rem;
}

/* Share Modal Styles */
.share-modal-content {
    max-width: 600px;
}

.share-modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--color-text);
    font-size: 1.3rem;
}

.select-all-container {
    padding: 1rem;
    background: rgba(60, 160, 160, 0.1);
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(60, 160, 160, 0.3);
}

.select-all-container label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--color-text);
    cursor: pointer;
}

.select-all-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
}

.user-checkbox-item {
    background: var(--color-background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.6rem;
    transition: all 0.2s ease;
}

.user-checkbox-item:hover {
    background: var(--color-background);
    border-color: var(--color-accent);
}

.user-checkbox-item label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    color: var(--color-text);
}

.user-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cancel {
    background: var(--color-surface);
    color: var(--color-text);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cancel:hover {
    background: var(--color-text-secondary);
}

.btn-confirm {
    background: var(--color-accent);
    color: var(--color-text);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-confirm:hover {
    background: #2d7a7a;
}

/* Admin Chat History Improvements */
.admin_wf_chat_container {
    background: var(--color-background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.llm_conversation {
    margin-bottom: 1rem;
}

.llm_conversation > a {
    display: block;
    padding: 0.8rem;
    background: rgba(60, 160, 160, 0.1);
    border-left: 3px solid var(--color-accent);
    border-radius: 4px;
    margin-bottom: 1rem;
    color: var(--color-text);
    text-decoration: none;
}

.message_metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.85rem;
}

.message_metrics a {
    padding: 0.2rem 0.5rem;
    background: rgba(60, 160, 160, 0.2);
    border-radius: 3px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.message_metrics a:hover {
    background: rgba(60, 160, 160, 0.3);
    color: var(--color-text);
}

/* Tab Styling */
.dashboard-tab {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tablinks {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tablinks:hover {
    color: var(--color-text);
    border-bottom-color: rgba(60, 160, 160, 0.5);
}

.tablinks.active {
    color: var(--color-text);
    border-bottom-color: var(--color-accent);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .workflows-table {
        font-size: 0.85rem;
    }
    
    .workflows-table th,
    .workflows-table td {
        padding: 0.8rem 0.5rem;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-confirm {
        width: 100%;
        justify-content: center;
    }
}

/* Changelog Modal Styles */
.changelog-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    backdrop-filter: blur(3px);
}

.changelog-modal-overlay.show {
    display: flex;
}

.changelog-modal-content {
    background: var(--color-background);
    border: 1px solid var(--color-text-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.changelog-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-text-secondary);
}

.changelog-modal-header h2 {
    color: var(--color-text);
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.changelog-modal-header h2 i {
    color: var(--color-accent);
    font-size: 1.1rem;
}

.changelog-modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.changelog-modal-close:hover {
    background: var(--color-background)
    color: var(--color-text);
}

.changelog-modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: 60vh;
}

#changelog-content {
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

#changelog-content h1 {
    color: var(--color-accent);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 0.5rem;
}

#changelog-content h2 {
    color: var(--color-text);
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-text-secondary);
}

#changelog-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#changelog-content li {
    padding: 0.4rem 0;
    margin-left: 1rem;
    position: relative;
    color: var(--color-text-muted);
}

#changelog-content li::before {
    content: "•";
    color: var(--color-accent);
    font-size: 1.2rem;
    position: absolute;
    left: -1rem;
}

#version-badge:hover {
    color: var(--color-accent) !important;
    transition: color 0.2s ease;
}

/* Responsive modal */
@media (max-width: 768px) {
    .changelog-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .changelog-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .changelog-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .changelog-modal-body {
        padding: 1.5rem;
    }
    
    #changelog-content h1 {
        font-size: 1.5rem;
    }
    
    #changelog-content h2 {
        font-size: 1.2rem;
    }
}

/* Overlay */
/* .modal {
  display: none;                 
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
} */

/* Card */
 #newChatModal .modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: clamp(360px, 90vw, 560px);
  max-height: 80vh;
  padding: 20px 22px 18px;
  border-radius: 12px;

  background: linear-gradient(to right, var(--color-background), var(--color-surface));
  color: var(--color-text-muted);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow: auto;

  animation: modal-pop .22s ease-out;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
} 

/* Title */
.modal-content h2 {
    margin: 0 0 18px;      /* remove top margin, add space below */
    padding-top: 6px;      /* optional small breathing room */
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

/* Close button (X) */
.modal-content .close {
  position: absolute;
  top: 12px;
  right: 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.1);
  background: transparent;

  color: var(--color-text)fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;

  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .12s ease;
}
.modal-content .close:hover {
  background: #f3f4f6;
  color: #111827;
  border-color: rgba(0,0,0,.16);
  transform: translateY(-1px);
}

/* Inputs */
.modal-content input[type="text"],
.modal-content textarea {
    width: 100%;
  box-sizing: border-box;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--color-accent);   /* teal border */
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;

  background: linear-gradient(to right, var(--color-background), var(--color-surface));
  color: var(--color-text-muted);
  outline: none;
}

.modal-content textarea {
  min-height: 100px;     /* taller than input */
  resize: vertical;      /* let user drag to resize */
  line-height: 1.4;
}

.modal-content select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-accent);
    border-radius: 10px;
    font-size: 14px;
    background: linear-gradient(to right, var(--color-background), var(--color-surface));
    color: var(--color-text-muted);
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.modal-content select option[disabled] {
    color: #9aa3af;
    background-color: var(--color-background); /* fallback for selected option in some browsers */
}

/* Focus style */
.modal-content select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

/* Submit button */
.modal-content button {
  align-self: flex-end;               /* push to the right */
  margin-top: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;

  background: var(--color-accent);                /* accent */
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  transition: transform .12s ease, filter .12s ease;
}
.modal-content button:hover { filter: brightness(1.05); }
.modal-content button:active { transform: translateY(1px); }

.token-use-range-slider {
  height: 5px;
  position: relative;
  background-color: #e1e9f6;
  border-radius: 2px;
}
.token-use-range-selected {
  height: 100%;
  left: 30%;
  right: 30%;
  position: absolute;
  border-radius: 5px;
  background-color: #1b53c0;
}

.token-use-time-range {
  position: relative;
}
.token-use-range-input input {
  position: absolute;
  width: 100%;
  height: 5px;
  top: -7px;
  background: none;
  pointer-events: none;
  /*-webkit-appearance: none;
  -moz-appearance: none;*/
}
.token-use-time-range input::-webkit-slider-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  border: 3px solid #1b53c0;
  background-color: var(--color-text);
  pointer-events: auto;
  -webkit-appearance: none;
}
.token-use-time-range input::-moz-range-thumb {
  height: 15px;
  width: 15px;
  border-radius: 50%;
  border: 3px solid #1b53c0;
  background-color: var(--color-text);
  pointer-events: auto;
  -moz-appearance: none;
}

/* Animation */
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .modal-content { animation: none; }
}

/* File Browser Folder Tree Styles */
.file-browser-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.file-browser-sidebar {
    width: 200px;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    flex-shrink: 0;
}

.folder-tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--color-text);
}

.new-folder-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
}

.new-folder-btn:hover {
    color: var(--color-accent);
}

.folder-tree {
    padding: 4px 0;
}

.folder-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

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

.folder-arrow {
    width: 16px;
    margin-right: 4px;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.folder-arrow-placeholder {
    width: 16px;
    margin-right: 4px;
    display: inline-block;
}

.folder-icon {
    margin-right: 6px;
    color: var(--color-accent);
    font-size: 14px;
}

.folder-name {
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
}

.folder-rename-input {
    flex: 1;
    padding: 2px 4px;
    border: 1px solid var(--color-accent);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 14px;
    border-radius: 3px;
}

.folder-rename-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(60, 160, 160, 0.2);
}

.file-browser-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.breadcrumb {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    background: var(--color-surface);
}

.breadcrumb i {
    color: var(--color-accent);
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--color-accent);
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    text-decoration: underline;
    color: var(--color-text);
}

.folder-context-menu {
    background: var(--color-surface-elevated);
    z-index: 10000;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-width: 180px;
    z-index: 10000;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    color: var(--color-text);
    transition: background 0.2s ease;
}

.context-menu-item:hover {
    background: var(--color-surface-active);
}

.context-menu-item i {
    width: 16px;
    color: var(--color-accent);
    font-size: 14px;
}

.context-menu-item span {
    font-size: 14px;
}

.context-menu-separator {
    height: 1px;
    background: var(--color-border);
    margin: 6px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .file-browser-sidebar {
        width: 180px;
    }
    
    .folder-item {
        padding: 3px 6px;
    }
    
    .breadcrumb {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Active Folder Styling */
.folder-item.active {
    background: var(--color-accent);
    color: var(--color-text);
}

.folder-item.active .folder-name,
.folder-item.active .folder-icon {
    color: var(--color-text);
}

.folder-item-main {
    cursor: pointer;
    border-left: 3px solid var(--color-accent);
}

.folder-item-main:hover {
    background: var(--color-surface-hover);
}

.breadcrumb-root {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-root:hover {
    color: var(--color-text);
}

/* Drag and Drop Styles */
.file-browser-item.dragging {
    opacity: 0.5;
    cursor: move;
}

.folder-item.drag-over {
    background: rgba(60, 160, 160, 0.2);
    border-left: 3px solid var(--color-accent);
}

.file-browser-list.drag-over {
    background: rgba(60, 160, 160, 0.05);
    border: 2px dashed var(--color-accent);
}

/* User Permissions Management (admin/roles) */
.permissions-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.permissions-header {
    margin-bottom: 2rem;
}

.permissions-header h1 {
    color: var(--color-text);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.permissions-header p {
    color: var(--color-text-secondary);
    font-size: 1rem;
}

.permissions-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
}

.user-selection {
    margin-bottom: 2rem;
}

.user-selection h2 {
    color: var(--color-text);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.form-select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.form-select:hover {
    border-color: var(--color-accent);
}

.form-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(60, 160, 160, 0.1);
}

.permission-editor {
    margin-top: 2rem;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-border);
}

.editor-header h2 {
    color: var(--color-text);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.role-badge {
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: var(--color-text);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.permission-item {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.permission-item:hover {
    border-color: var(--color-accent);
    background: var(--color-surface-elevated);
}

.permission-info h4 {
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.permission-info p {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.permission-toggle {
    flex-shrink: 0;
    margin-left: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-surface-hover);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--color-text);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.editor-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-text);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--color-surface-active);
}

.status-message {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

.status-message.status-success {
    background: var(--color-success);
    color: var(--color-text);
}

.status-message.status-error {
    background: var(--color-danger);
    color: var(--color-text);
}

.status-message.status-info {
    background: var(--color-info);
    color: var(--color-text);
}

/* Responsive Permissions */
@media (max-width: 768px) {
    .permissions-container {
        padding: 1rem;
    }
    
    .permissions-content {
        padding: 1rem;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    
    .editor-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Admin Workspaces Page (admin/workflows) */
.workspaces-section {
    padding: 1.5rem;
}

.workspaces-table-container {
    background: var(--color-background);
    border-radius: 8px;
    overflow: hidden;
}

.workspaces-table {
    width: 100%;
    border-collapse: collapse;
}

.workspaces-table thead {
    background: var(--color-background);
}

.workspaces-table th {
    padding: 1rem;
    text-align: left;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workspaces-table th:first-child {
    width: 40px;
    text-align: center;
}

.workspace-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
    background-color: var(--color-background);
    border: 1px var(--color-surface-hover)
}

.workspace-row:hover {
    background: var(--color-surface-hover);

}

.workspace-row td {
    padding: 1rem;
    color: var(--color-text);
}

.workspace-row td:first-child {
    text-align: center;
}

.ws-name {
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: color 0.2s ease;
}

.ws-name:hover {
    color: var(--color-accent);
}

.ws-id {
    color: var(--color-text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.ws-timestamp {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.workspace-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-delete {
    background: #dc3545;
    color: var(--color-text);
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-delete i {
    font-size: 0.9rem;
}

/* Back Link */
.back-link-container {
    margin-bottom: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: var(--color-surface);
    color: var(--color-text);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-accent);
    transform: translateX(-2px);
}

.back-link i {
    font-size: 0.9rem;
}

/* Workspace Results Modal */
.view-WS-Results-modal-content {
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

.workspace-report-item {
    margin-bottom: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.workspace-report-item h3 {
    color: var(--color-text);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
}

.workspace-report-item p {
    color: var(--color-text-secondary);
    margin: 0.5rem 0;
}

.workspace-report-item strong {
    color: var(--color-text);
}

/* Responsive Workspaces */
@media (max-width: 768px) {
    .workspaces-table {
        font-size: 0.85rem;
    }
    
    .workspaces-table th,
    .workspaces-table td {
        padding: 0.8rem 0.5rem;
    }
    
    .workspace-actions {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .btn-share,
    .btn-delete {
        width: 100%;
    }
}
