
#aiChatWidget {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#chatBox {
  flex: 1;
  overflow-y: auto;
  max-height: 100%;
}
.btn-control {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
  transition: background 0.3s;
  border-radius: 4px;
}

.btn-control:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tooltip-wrapper {
  display: flex;
  align-items: center;
  margin-left: auto;
}

  .tooltip-wrapper .custom-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
  }

  .tooltip-wrapper:hover .custom-tooltip {
    opacity: 1;
  }

  .tooltip-wrapper.rainbow-mia a {
    position: relative;
    display: inline-block;
    padding: 8px 14px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    background: rgb(201, 26, 95);
    z-index: 2;
    overflow: visible;     isolation: isolate;
  }

  .tooltip-wrapper.rainbow-mia a::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: -1;
    background: linear-gradient(115deg, #4fcf70, #fad648, #a767e5, #12bcfe, #44ce7b);
    background-size: 400% 100%;
    border-radius: 12px;
    animation: rainbowBorder 3s linear infinite;
    animation-play-state: paused;
    opacity: 0;
    transition: opacity 0.4s ease;
  }

  .tooltip-wrapper.rainbow-mia:hover a::before {
    animation-play-state: running;
    opacity: 1;
  }

  @keyframes rainbowBorder {
    to {
      background-position: -200% 0;
    }
  }

  .chat-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 30px;
    padding: 8px 12px;
    position: relative;
    gap: 10px;
    border: none;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  }

  .chat-input-wrapper textarea {
    border: none;
    resize: none;
    flex: 1;
    font-size: 1rem;
    border-radius: 0;
    outline: none;
    padding: 6px 0;
    box-shadow: none;
    background: transparent;
  }

  .chat-input-wrapper textarea {
    border: none;
    resize: none;
    flex: 1;
    font-size: 1rem;
    border-radius: 5px;
    outline: none;
  }
  .fade-in-text {
    animation: fadeInRight 0.3s ease-out;
  }


  #fileUploadButton {
    background: #f0f0f0;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #2c2c74;
    font-size: 18px;
    transition: background 0.2s ease;
  }
  #fileUploadButton:hover {
    background: #e0e0e0;
  }

  #sendButton {
    background: #2c2c74;
    border: none;
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: background 0.3s;
  }
  #sendButton:hover {
    background: #1a1a5e;
  }

  .file-preview-box {
    margin-top: 10px;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    color: #880e4f;
  }

  .file-icon {
    font-size: 3rem;
    margin-right: 10px;
  }

  .file-details {
    flex-grow: 1;
    font-size: 0.9rem;
    word-break: break-word;
  }

  .remove-file-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #880e4f;
    cursor: pointer;
  }
  .file-preview-pdf {
    background: #fde7ef;
    color: #880e4f;
  }

  .file-preview-image {
    background: #e0f7fa;
    color: #006064;
  }

  .file-preview-word {
    background: #e3f2fd;
    color: #0d47a1;
  }

  .file-preview-excel {
    background: #e8f5e9;
    color: #1b5e20;
  }

  .file-preview-default {
    background: #eeeeee;
    color: #424242;
  }
  .card-footer {
    background: #fff !important;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    padding: 12px;
  }

  @media screen and (max-width: 768px) {
  #aiChatWidget {
    width: 95vw !important;
    height: 90vh !important;
    bottom: 10px !important;
    right: 10px !important;
    border-radius: 15px !important;
  }

  .card-header {
    flex-wrap: wrap;
    padding: 15px;
    height: auto !important;
  }

  .card-header .title {
    font-size: 1.3rem !important;
  }

  .btn-control {
    font-size: 1rem;
  }

  #chatBox {
    font-size: 0.95rem;
    padding-bottom: 20px;
  }

  .chat-input-wrapper textarea {
    font-size: 0.95rem;
  }
}
.session-entry {
  padding: 6px 10px;
  margin: 4px 0;
  background: #eee;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.session-entry:hover {
  background: #ddd;
}
.sidebar-button.active {
  color: #283593;
  font-weight: bold;
}
.chat-history-list-sidebar {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100% - 120px);
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.chat-sessions-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.chat-sessions-scroll {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-session-btn {
  background-color: #eee;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.chat-session-btn:hover {
  background-color: #dce5f2;
}
.chat-sidebar {
  height: 100%;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: width 0.3s ease;
  overflow-x: hidden;
  border-right: 1px solid #ddd;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
}

.chat-sidebar.collapsed {
  width: 60px;
}

.chat-sidebar.expanded {
  width: 240px;
  align-items: flex-start;
}

.sidebar-header {
  width: 100%;
  padding: 6px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
}

#toggleSidebarBtn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 4px;
  padding: 4px 6px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #333;
  width: 100%;
  white-space: nowrap;
  transition: background 0.2s ease;
  padding: 8px 10px;
  font-size: 14px;
}

.sidebar-button:hover {
  background: #f0f0f0;
}

.sidebar-label {
  display: none;
}

.chat-sidebar.expanded .sidebar-label {
  display: inline;
}

.chat-session-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  margin: 0;
  gap: 0;
}


.chat-session-btn {
  background-color: #f3f3f3;
  border: none;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s ease;
  box-sizing: border-box;
}


.chat-session-btn:hover {
  background-color: #e0e0e0;
}
#miaSidebar.collapsed .session-name {
  display: none !important;
}
.session-name {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.chat-sidebar.expanded .session-name {
  opacity: 1;
}


.chat-sidebar.collapsed .chat-session-list {
  display: none !important;
}


.chat-sidebar.collapsed .chat-session-btn {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-indent: -9999px;
  height: 40px;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

.chat-sidebar.collapsed .chat-session-btn::before {
  content: "💬";
  text-indent: 0;
  display: inline-block;
  font-size: 16px;
}
.sidebar-button:first-of-type {
  margin-top: 0 !important;
}
.chat-session-btn .btn-link {
  padding: 4px;
  font-size: 14px;
}
.chat-session-card {
  background-color: #f3f3f3;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chat-session-card:hover {
  background-color: #e0e0e0;
}

.chat-session-body {
  padding-right: 32px;
}

.chat-title {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-date {
  font-size: 12px;
  color: #666;
}

.chat-trash {
  position: absolute;
  bottom: 6px;
  right: 8px;
}
.chat-session-current {
  background-color: #f0f0f0 !important;
  border-radius: 8px;
}

.chat-session-current .chat-title {
  color: #333;
}

.chat-session-current .chat-title.chat-actual {
  color: green !important;
}


