/* Import JetBrains Mono from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

/* Base styles */

html, body {
  background-color: #101020;
  color: #f0f0f0;
  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: transparent;
  color: #f0f0f0;
  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: #101020;
  color: #f0f0f0;
}

.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: transparent;
}

.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:  transparent;
}

.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: #333;
  border-radius: 30px; 
  box-sizing: border-box;
  padding: 4px 14px;
}

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

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

.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: transparent;
}

textarea, .text_lg {
  background-color: #101020 !important;
  color: #f0f0f0 !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;
}

#inp_message {
  width: 95%;
}

.message-container {
  width: 100%;
}

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

input, .text_inp {
  background-color: #101020;
  color: #f0f0f0;
  border-radius: 15px;
  padding: 10px 20px;
  margin: 10px;
  transition: background-color 0.3s ease;
}

/* 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.2);
}

/* 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.3);
  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.2);
}

/* 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: #333 #101020;
}

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

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

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

button:hover {
  background-color: #555;
}

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

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

select option, .dropdown option {
  background-color: #101020;
  color: #f0f0f0;
}

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

.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: #555;
}

/* 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 #333;
}

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

.settings-editor li button:hover {
  background-color: #ff1a1a;
}
.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: #555;
}

/* 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 #333;
}

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

.settings-editor li button:hover {
  background-color: #ff1a1a;
}
.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: 30px;
  cursor: pointer;
}

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

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

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

select option, .dropdown option {
  background-color: #101020;
  color: #f0f0f0;
}
select, .dropdown {
  background-color: #101020;
  color: #f0f0f0;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 5px 10px;
  margin: 10px;
  transition: background-color 0.3s ease;
}

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

select option, .dropdown option {
  background-color: #101020;
  color: #f0f0f0;
}
select, .dropdown {
  background-color: #101020;
  color: #f0f0f0;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 5px 10px;
  margin: 10px;
  transition: background-color 0.3s ease;
}

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

select option, .dropdown option {
  background-color: #101020;
  color: #f0f0f0;
}
select, .dropdown {
  background-color: #101020;
  color: #f0f0f0;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 5px 10px;
  margin: 10px;
  transition: background-color 0.3s ease;
}

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

select option, .dropdown option {
  background-color: #101020;
  color: #f0f0f0;
}

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

.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: #555;
}

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

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

select option, .dropdown option {
  background-color: #101020;
  color: #f0f0f0;
}
select, .dropdown {
  background-color: #101020;
  color: #f0f0f0;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 5px 10px;
  margin: 10px;
  transition: background-color 0.3s ease;
}

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

select option, .dropdown option {
  background-color: #101020;
  color: #f0f0f0;
}

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

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

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

button:hover {
  background-color: #555;
}

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

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

select option, .dropdown option {
  background-color: #101020;
  color: #f0f0f0;
}

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

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

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

button:hover {
  background-color: #555;
}

/* Custom scrollbar styles */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #333 #101020;
}

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

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

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

button:hover {
  background-color: #555;
}

/* Custom scrollbar styles */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #333 #101020;
}

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

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

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

button:hover {
  background-color: #555;
}

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

summary {
  border-radius: 8px;
  color: white;
}

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(255, 255, 255, 0.3);
  border-top: 4px solid #fff;
  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: #101020;
  border: 1px solid #333;
  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.15);
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
}

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

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

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

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

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

/* Hover effect */
tbody tr:hover {
    background-color: #2d3748;
    color: #ffffff;
    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(30, 30, 50, 0.6);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 5px 0;
  max-width: 100%;
  overflow: hidden;
}

.file-attachment a {
  display: flex;
  align-items: center;
  color: #f0f0f0;
  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(40, 40, 70, 0.8);
}

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

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

/* Enhanced Shell/Terminal output styling */
pre.shellout {
  background: linear-gradient(to bottom, #2d2d2d 0%, #1e1e1e 30px, #1a1a1a 100%);
  border: 1px solid #404040;
  border-radius: 12px;
  padding: 0;
  margin: 15px 0;
  overflow-x: auto;
  max-height: 50vh;
  overflow-y: auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  position: relative;
}

/* Mock terminal title bar */
pre.shellout::before {
  content: '';
  display: block;
  height: 30px;
  background: linear-gradient(to bottom, #3a3a3a, #2d2d2d);
  border-bottom: 1px solid #1a1a1a;
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Terminal window controls (dots) */
pre.shellout::after {
  content: '';
  position: absolute;
  top: 11px;
  left: 12px;
  width: 12px;
  height: 12px;
  background: #ff5f56;
  border-radius: 50%;
  box-shadow: 
    20px 0 0 #ffbd2e,
    40px 0 0 #27c93f,
    0 0 0 1px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

/* Code element inside shellout pre */
pre.shellout code {
  background-color: transparent;
  color: #e8e8e8;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.6;
  padding: 15px 20px;
  padding-top: 10px;
  margin: 0;
  border: none;
  white-space: pre-wrap;
  display: block;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Custom scrollbar for terminal */
pre.shellout::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

pre.shellout::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 0 0 12px 0;
}

pre.shellout::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 5px;
  border: 2px solid #1a1a1a;
}

pre.shellout::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

