#chat-widget {
    font-family: "Roboto", sans-serif;
    position: fixed;
    bottom: 0;
    right: 0;
    width: 48%;
    background: white;
    border-radius: 0;
    box-shadow: -10px 0px 15px rgb(0 0 0 / 38%);
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
    letter-spacing: .00625em;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5rem;
}

.standalone {
    width: 100% !important;
    max-width: 65% !important;
    height: 100% !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0px 0px 15px rgb(0 0 0 / 18%) !important;
}

.standalone-app {
    background-color: #F2F2F2;
}

#chat-header {
    background: #00629B;
    color: white;
    padding: 15px;
    display: flex;
   /* Enables Flexbox */
    align-items: center;
   /* Centers vertically */
    justify-content: space-between;
   /* Keeps title on left and button on right */
   z-index: 999;
}
#chat-header span {
    flex-grow: 1;
   /* Makes it take up available space */
    text-align: left;
    font-size: 1.5em;
}
#chat-messages {
    height: calc(100% - 130px); /* Adjust based on header + input + footer */
    padding: 15px;
    overflow-y: auto;
}
#chat-input {
    padding: 10px;
   /*border-top: 1px solid #ddd;
    */
    display: flex;
    height: 60px;
}
#message-input {
    flex: 1;
    padding: 5px 8px;
    border: 0;
    border-radius: 5px;
    background: #f5f5f5;
    color: #545454;
    font-size: 16px;
}
#send-btn {
    padding: 8px;
    background: #00629B;
    color: white;
    border: none;
    border-radius: 5px;
    height: 40px;
    margin-left: 5px;
}
#send-btn:focus {
    outline-offset: 2px !important;
}
.send-active {
    background: #00629B;  
}

button#send-btn:hover {
    background: #172c49;
}

.message:first-child {
    margin-top: 15px;
}

.message {
    margin: 20px 0;
}

.user {
    text-align: right;
}
.bot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.bot-avatar {
    flex: 0 auto;
    /*background: #00629b;*/
    width: 35px;
    height: 35px;
    margin: 2px 5px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3px;
    border-radius: 23px;
}

 .bot-avatar img {
     width: 35px !important;
     height: 34px !important;
}

.message-content {
    display: inline-block;
    max-width: 80%;
    padding: 10px;
    border-radius: 10px;
    font-size: 16px;
}

.message-content > div h1,
.message-content > div h2,
.message-content > div h3,
.message-content > div h4,
.message-content > div h5,
.message-content > div h6 {
    font-family: sans-serif;
    margin: 0.5em 0;
}

/* Standard size scale */
.message-content > div h1 { font-size: 2em; }
.message-content > div h2 { font-size: 1.5em; }
.message-content > div h3 { font-size: 1.17em; }
.message-content > div h4 { font-size: 1em; }
.message-content > div h5 { font-size: 0.83em; }
.message-content > div h6 { font-size: 0.67em; }

.user .message-content {
    background: #F3F4F6;
    color: #182a49;
}
.bot .message-content {
    flex: 0 auto;
    color: black;
}

.bot-loading {
    background: #182b49;
}

.bot .message-content p:first-child {
    margin-top: 0;
}

.citation {
    font-size: 12px;
    color: #2563EB;
    display: block;
}
.bot .message-content svg {
    display: block;
    margin: auto;
}

.thinking-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: #182b49;
    gap: 0.15em;
}

.thinking-dots {
    display: inline-flex;
    gap: 0.15em;
}

.thinking-dots span {
    animation: thinkingDot 1.2s ease-in-out infinite;
    opacity: 0.4;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinkingDot {
    0%, 20% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.4;
    }
}

.message-content hr {
    border: 1px solid #e8e8e8;
    margin: 20px 0;
}

/* chat tools styles */

.chat-tools {
    display: flex;
    width: 180px;
    padding: 5px 0 0 40px;
}

/*Feedback*/

.feedback-container {
    display: flex;
    gap: 2px;
}

button.thumbs-up,button.thumbs-down  {
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 3px;
    padding: .375rem;
}

button.thumbs-up:hover ,button.thumbs-down:hover  {
    background: #f3f4f6;
}

.thumbs-down.f-negative:focu, .thumbs-down.f-positive:focus {
    outline: none !important;
}

/* Default state */
button.thumbs-up svg g {
  fill: white;
  stroke: black;
}

/* Active state */
button.thumbs-up.f-positive svg g {
  fill: #006600;
  stroke: #006600;
}

/* Default state */
button.thumbs-down svg g {
  fill: white;
  stroke: black;
}

button.thumbs-down.f-negative {
    color: #d70030;
}

/* Active state */
button.thumbs-down.f-negative svg g {
  fill: #d70030;
  stroke: #d70030;
}

/* Copy button styles */

.copy-container {
    display: flex;
    margin-right: 2px;
}

.copy-button {
    display: flex;
    background: none;
    border: 0;
    justify-content: center;
    align-items: center;
    padding: .375rem;
    border-radius: 3px;
    cursor: pointer;
}

.copy-button:hover {
    background: #f3f4f6;
}

button.copy-button:active {
    background: #e7ecf4;
}

.copy-button svg {
    margin-top: -5px;
}

/* Fade transition styles */
.fade-enter-active, .fade-leave-active {
    transition: opacity 0.2s;
}
#send-btn svg {
    fill: currentColor;
   /* Inherits the text color of the button */
    width: 24px;
    height: 24px;
}
.fade-enter-from, .fade-leave-to {
    opacity: 0;
}
/* Style for the close (Ã—) and menu chat buttons in the header */
#close-btn {
    background: rgb(24 43 73 / 65%);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 17px;
    margin-right: 10px;
}
#menu-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 17px;
    margin-right: 10px;
}
#close-btn:hover, #menu-btn:hover {
    background: rgb(24 38 77);
}   
/* Chat bubble styling */
#chat-bubble {
    background-color: #03629c !important;
    cursor: pointer !important;
    position: fixed;
    padding: 0 10px;
    bottom: 20px;
    right: 20px;
    min-width: 193px;
    height: 49px;
    border-radius: 35px;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 10px rgb(0 0 0 / 44%);
    text-align: center;
    font-family: roboto, sans-serif;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    background: url(https://cdn.ucsd.edu/tritongpt/img/tgpt-orb.png);
    border: 0;
    background-position: 14px;
    background-repeat: no-repeat;
    z-index: 999999;
}
#chat-bubble p {
    margin: 0;
}

#chat-bubble svg {
    height: 33px;
    margin-left: 5px;
    width: 33px;
    fill: #FFFFFF;
}

#chat-bubble:focus {
    outline-offset: 2px;
    outline: solid 2px #015fcc;
}
/* Citations */ 

.inline-citation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 4px;
    font-size: 0.8em;
    font-weight: bold;
    text-decoration: none;
    color: #0056b3; /* UCSD Blue */
    background-color: #e8f0fe; /* Light blue */
    border-radius: 50%;
    border: 1px solid #0056b3;
    text-align: center;
    line-height: 16px;
    transition: all 0.2s ease-in-out;
  }
  
  .inline-citation:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
  }

  /* Tooltip */
  
/* Tooltip container */
.cite {
    position: relative;
    display: inline-flex;
  }
  
  /* Tooltip text */
  .cite .tooltiptext {
    visibility: hidden;
    width: 168px;
    background-color: #ffffff;
    text-align: center;
    padding: 5px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #021627;
  
    /* Position the tooltip text */
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 0%;
    margin-left: -75px;
  
    /* Fade in tooltip */
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  /* Tooltip arrow */
  .cite .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #d1d5db transparent transparent transparent;
  }
  
  /* Show the tooltip text when you mouse over the tooltip container */
  .cite:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
  }

  .tooltiptext a {
    color: #0057b3;
}

  .tooltiptext img {
    display: inline-block !important;
    top: 4px;
    position: relative;
    left: -3px;
    color: #101827;
}

/* code block */
code {
    background-color: #e7ecf4;
    color: #2f3849;
    font-family: monospace;
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Related Questions */

.rq-title {
    color: #2f384b;
    margin: 15px 0;
}

.related-question {
    display: block;
    cursor: pointer !important;
    padding: 7px 15px;
    margin: 8px 0;
    border-radius: 27px;
    color: #00629b;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    background: #fff;
    border: 1px solid #00629b;
    transition: all 0.2s ease-in-out;
}

.related-question a {
    cursor: pointer;
}

.related-question:hover {
    color: #fff;
    background: #00629b;
    text-decoration: none;
}

/* Chat Footer */

#chat-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0px 20px;
    width: 100%;
    background: #fff;
    font-size: 13px;
    color: #eee;
}

#chat-footer p {
    margin: 0;
    text-align: center;
    color: #1f2933;
}

#chat-footer .chat-disclaimer {
    width: 100%;
    font-size: 12px;
    line-height: 1.5;
}

#chat-footer .chat-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
}

#chat-footer .chat-credit {
    white-space: nowrap;
}

#chat-footer .chat-separator {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1;
}

.footer-separator {
    margin: 0 10px;
}

#chat-footer a {
    color: #113f65;
    text-decoration: none;
}

#chat-footer a:hover,
#chat-footer a:focus {
    text-decoration: underline;
}

/* Menu */

#info-menu-container {
    position: absolute;
    bottom: 0;
    right: 56px;
    width: 207px;
    height: 107px !important;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
    top: 55px;
}

#info-menu {
    position: relative; /* Ensure pseudo-element positions correctly */
    height: auto;
    background-color: #fff;
    padding: 15px;
    border-radius: 6px ;
    box-shadow: 0 2px 10px rgb(0 0 0 / 21%);
    width: 100%;
    animation: slideUp 0.9s ease-out;
}

#info-menu a:hover {
    text-decoration: underline
}

/* Add the triangle pointer */
#info-menu::before {
    content: "";
    position: absolute;
    top: -10px; /* Adjust based on triangle size */
    right: 20px; /* Adjust to align with your button */
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}

#menu-close-btn {
    position: absolute;
    right: -87px;
    background: rgb(230 230 230);
    border: none;
    color: rgb(68 68 68);
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 17px;
    margin-right: 10px;
    height: 25px;
    width: 25px;
    top: -3px;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#info-menu hr {
    width: 100%;
    border: 1px solid #eee;
}

#info-menu ul {
    list-style: none;
    padding: 0;
    margin: 0
}

#info-menu > ul > li {
    /* border: 1px solid #eee; */
    padding: 5px;
}

#info-menu > ul > li > a {
    color: #00629b;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}

  /* Mobile */ 

@media screen and (max-width: 768px) {
    #chat-widget {
        width: 60%;
    }
}

@media screen and (max-width: 450px) {
    #chat-widget {
        width: 100%;
    }
    .standalone {
        max-width: 100% !important;
    }
}
