html, body {
  background-color: #ffffff;
  color: #333333;
  padding: 5px 5px;
  font-family: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, Helvetica, "Apple Color Emoji", Arial, "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 18px;
  display: flex;
  line-height: 1.5;
  flex-direction: column;
  height: 100%;
  padding: 2px;
  margin: 2px;
}

input, * {
  background-color: #fff;
  color: #333333;
  margin: 2px 2px;
  font-family: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, Helvetica, "Apple Color Emoji", Arial, "Segoe UI Emoji", "Segoe UI Symbol";
}

p {
  padding: 2px 5px;
  margin: 2px 2px;
  margin-top: 0px;
}

input::placeholder, textarea::placeholder {
  background-color: #ffffff;
  color: #666666;
}

.send_msg {
  display: inline-block;
}

.page-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.main {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
    overflow-y: hidden;
}

.hover-zoom {
  transition: transform 0.1s ease;
}

.hover-zoom:hover {
  
  transform: translateX(100px) scale(6);
  z-index: 1;
}


.chat-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-right: 16px;
}

chat-ai {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top:50px;
}

chat-form {
  flex-shrink: 0;
  margin: 0;
  display: flex;
  padding: 0;
}

.chat-entry {
  display: flex;
  width: 100%;
}


chat-message {
  /* max-width: 69%; */
  width: 100%;
  padding: 4px 8px;
  margin: 2px 0;
  display: block;
  background-color: #fff;
}

.outer-msg {
  display: flex;
  flex-direction: row;
  width: 100%;
}

img.avatar {
  height: 48px;
  display: none;
  margin-right: 10px;
  padding-top: 8px;
}

chat-message[show-avatar] img.avatar {
  display: inline-block;
  margin-top: 16px;
}

chat-message .outer-msg.without-avatar {
  margin-top: -8px; /* Reduce top margin for messages without avatars */
}

chat-message:first-of-type .outer-msg.without-avatar {
  margin-top: 0; /* Reset top margin for the first message */
}.message {
  padding: 5px 5px;
  margin: 0;
  background-color:  #fff;
}

.outer-msg.user {
  flex-direction: column;
  align-items: flex-end;
}

.message:has(.action-summary) {
  width: 100%;
}

.user {
  align-self: flex-end;
}

.msg-user {
  background-color: #e3f2fd;
  border-radius: 30px; 
  box-sizing: border-box;
  padding: 4px 14px;
  color: #333333;
}

.ai {
  align-self: flex-start;
}

.msg-ai {
  /* background-color: #080808; */
  border: 1px solid #e0e0e0;
  border-radius: 30px;
  width: 80%;
  background-color: #f5f5f5;
  color: #333333;
}

.msg-ai:first-child {
  display: flex;
  /* align/justfiy to top */  
  align-items: flex-start;
  justify-content: flex-start;
}

.spacer {
  height: 0.25em;
  display: block;
  background-color: #fff;
}

textarea, .text_lg {
  background-color: #ffffff !important;
  color: #333333 !important;
  width: 90%;
  min-height: 4em;
  max-height: 500px; /* Maximum height before scrolling */
  overflow-y: auto; /* Allows the textarea to expand as the user types */
  scrollbar-width: none;
  padding: 10px;
  border-radius: 15px;
  flex-shrink: 0;
  height: 4em;
  border: 1px solid #e0e0e0;
}

#inp_message {
  width: 95%;
}

.message-container {
  width: 100%;
}

.text_lg {
  height: 35vh;
  scrollbar-width: thin;
}

input, .text_inp {
  background-color: #ffffff;
  color: #333333;
  border-radius: 15px;
  padding: 10px 20px;
  margin: 10px;
  transition: background-color 0.3s ease;
  border: 1px solid #e0e0e0;
}

/* Modern New Chat Button Styling */
button, .btn {
  /* Base styling */
  background: linear-gradient(145deg, #4a5eff, #2e41e3);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 8px;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Plus icon before text */
.new-chat-btn::before {
  content: "+";
  font-size: 1.2em;
  font-weight: 400;
}

.new-chat-btn {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}


/* Hover effect */
button, .btn:hover, .new-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  background: linear-gradient(145deg, #5a6eff, #3e51f3);
  cursor: pointer;
}

/* Active/Click state */
button, .btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Focus state for accessibility */
button, .btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 94, 255, 0.3);
}

/* Custom scrollbar styles */

/* Firefox */
* {
  scrollbar-width: auto
  scrollbar-color: #cccccc #ffffff;
}

/* Chrome, Edge, and Safari */
*::-webkit-scrollbar {
  width: 8px;
}

*::-webkit-scrollbar-track {
  background: #ffffff;
}

*::-webkit-scrollbar-thumb {
  background-color: #cccccc;
  border-radius: 10px;
  border: 2px solid #ffffff;
}

button:hover {
  background-color: #5a6eff;
}

/* Dropdown styles */
select, .dropdown {
  background-color: #ffffff;
  color: #333333;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 5px 10px;
  margin: 10px;
  transition: background-color 0.3s ease;
}

select:hover, .dropdown:hover {
  background-color: #f5f5f5;
}

select option, .dropdown option {
  background-color: #ffffff;
  color: #333333;
}

/* Custom file input styles */
.custom-file-input {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 200px;
  height: 40px;
  overflow: hidden;
  background-color: #f5f5f5;
  color: #333333;
  border-radius: 15px;
  padding: 10px 20px;
  margin: 10px;
  transition: background-color 0.3s ease;
  border: 1px solid #e0e0e0;
}

.custom-file-input input[type="file"] {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  padding: 0;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  filter: alpha(opacity=0);
}

.custom-file-input .file-label {
  display: inline-block;
  width: 100%;
  height: 100%;
  text-align: center;
  line-height: 20px;
  cursor: pointer;
}

.custom-file-input:hover {
  background-color: #e8e8e8;
}

/* Settings Editor Styles */
.settings-editor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 90%;
  margin: auto;
}

.settings-editor label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
}

.settings-editor button {
  width: 50%;
  max-width: 200px;
}

.settings-editor ul {
  list-style-type: none;
  padding: 0;
}

.settings-editor li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.settings-editor li button {
  background-color: #ff4d4d;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.settings-editor li button:hover {
  background-color: #ff1a1a;
}

.param_name { font-weight: bold; }
.param_value { color: #666666; }

summary {
  border-radius: 8px;
  color: #333333;
}

details {
  width: 100%;
}

.fn_result, .code-result { 
  white-space: normal !important;
  word-break: break-word !important;
  font-family: monospace !important;
 /* text-wrap: wrap !important; */
}

.fn_name {
  cursor: pointer;
}

.one_line_result {
  overflow-x: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
}

/* .action { border: 2px solid teal; border-radius: 5px; } */

code {
  max-width: 85%;
  font-family: monospace;
}

form.persona {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 90%;
  margin: auto;
}

.persona label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
}

.persona button {
  width: 50%;
  max-width: 200px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid #333333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner.show { display: inline-block; } .spinner:not(.show) { display: none; }

chat-message {
  display: block;
  margin-bottom: 2px; /* Default spacing between messages */
  margin-top: 0px;
}

chat-message .outer-msg.without-avatar {
  margin-top: -8px; /* Reduce top margin for messages without avatars */
  margin-bottom: 0px;
}

chat-message:first-of-type .outer-msg.without-avatar {
  margin-top: 0; /* Reset top margin for the first message */
}

.image_input {
  width: 200px;
}


/* Add new styles for image preview */
.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  min-height: 0;
  max-height: 100px;
  overflow-y: auto;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 15px;
  margin-bottom: 8px;
}

.preview-thumbnail {
  position: relative;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
}

.preview-thumbnail img {
  height: 100%;
  width: auto;
}

.remove-image {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(255, 77, 77, 0.8);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-image:hover {
  background: rgba(255, 26, 26, 0.9);
}

.preview-thumbnail:hover .remove-image {
  display: flex;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 25px 0;
    font-size: 0.9em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

thead tr {
    background-color: #4a90e2;  /* Nice blue header */
    color: #ffffff;
    text-align: left;
    font-weight: 600;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

/* Zebra striping for rows */
tbody tr:nth-of-type(even) {
    background-color: #f8f9fa;
}

tbody tr:last-of-type {
    border-bottom: 2px solid #4a90e2;
}

/* Hover effect */
tbody tr:hover {
    background-color: #e3f2fd;
    color: #333333;
    transform: scale(1.002);
}

/* Optional: Add some subtle animation for sorting/filtering */
tbody tr {
    /* animation: fadeIn 0.5s ease-in; */
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Optional: Make it responsive */
@media screen and (max-width: 600px) {
    table {
        font-size: 0.8em;
    }
    
    th, td {
        padding: 8px 10px;
    }
}

.bigavatar {
  width: 180px;
}

.minilogo {
  margin-top: -30px;
  width: 32px;
}

/* File attachment styles */
.file-attachment {
  display: inline-flex;
  align-items: center;
  background: rgba(240, 240, 245, 0.8);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 5px 0;
  max-width: 100%;
  overflow: hidden;
}

.file-attachment a {
  display: flex;
  align-items: center;
  color: #333333;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-attachment svg {
  margin-right: 8px;
  flex-shrink: 0;
}

.file-attachment:hover {
  background: rgba(230, 230, 240, 0.9);
}

.file-attachment a:hover {
  text-decoration: underline;
}

.left-side {
  overflow-y: auto;
}

/* Mobile overrides */
@media screen and (max-width: 768px) {
  .left-side {
    background: #ffffff !important;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1) !important;
  }
}

/* Action component overrides */
action-component .action-summary {
  background: #f5f5f5 !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
}

action-component .param-preview {
  color: #666666 !important;
}

action-component .fn_name {
  color: #333333 !important;
}

/* Additional light theme overrides for stubborn elements */
html {
  background-color: #ffffff !important;
  color: #333333 !important;
}

* {
  background-color: #fff !important;
  color: #333333 !important;
}

/* Ensure specific elements stay light */
input, textarea, select {
  background-color: #ffffff !important;
  color: #333333 !important;
}

/* Override any remaining dark backgrounds */
.msg-user, .msg-ai, .custom-file-input, .settings-editor li {
  background-color: #f5f5f5 !important;
  color: #333333 !important;
}

/* Fix scrollbars */
*::-webkit-scrollbar-track {
  background: #ffffff !important;
}

*::-webkit-scrollbar-thumb {
  background-color: #cccccc !important;
}

