#ask-finn-container {
    right: 0;
    bottom: 0;
    z-index: 102;
    position: fixed;
}

/* Navigation bar ask-finn container */
#main-navbar #ask-finn-container {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: auto;
}

#askfinn-wrapper {
    max-width: auto;
    margin: auto;
    display: flex;
    justify-content: flex-end;
}

#chatbox-header{
    padding: 10px;
    position: relative;
}

#ask-close{
    position: absolute;
    top: 0;
    right: 0;
    scale: 1.5;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.3s ease; /* Add transition for color change */
}

#ask-close:hover{
    color: #67BC7C;
}

#ask-finn{
    font-size: 34px;
    font-weight: 600;
    background: -webkit-linear-gradient(#67BC7C, #60DDCB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0px;
}

#ask-finn-subtitle{
    margin: 0px;
    margin-bottom: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

#chatbox-container{
    display:flex;
    z-index: 9999;
    width: 40%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(103, 188, 124, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border-radius: 15px 0px 0px 0px;
    right: 0;
    bottom: 0;
    position: fixed;
    flex-direction: column;
    transition: opacity 0.2s ease; 
}


#chatbox-container.hidden {
    display: none !important; /* Transition to this state */
    pointer-events: none; /* Make it non-interactive */
}


.arrow-right {
    width: 0; 
    height: 0; 
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    margin-top: 6px;
    border-left: calc(2 * 4px * 0.866) solid #b0b0b045;
  }

  .arrow-left {
    width: 0; 
    height: 0; 
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent; 
    margin-top: 6px;
    border-right:calc(2 * 4px * 0.866) solid #7cba8224; 
  }

#chat-box{
    overflow: scroll;
    height: 50vh;
    color: white;
    
    /* Hide scrollbar for Firefox, Chrome, and Edge */
    scrollbar-width: none;
}

/* Hide scrollbar for Safari and other WebKit browsers */
#chat-box::-webkit-scrollbar {
    display: none; 
}

.assistant-message {
    background: rgba(103, 188, 124, 0.2) !important;
    color: white !important;
    border-radius: 10px;
    padding: 10px;
    margin: 5px 0;
}

.user-message {
    background: rgba(103, 188, 124, 0.4) !important;
    color: white !important;
    border-radius: 10px;
    padding: 10px;
    margin: 5px 0;
    text-align: right;
}

.assistant-img{
    max-width: 50px;
    height: 100%;
}

.assistant-alignment{
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.user-alignment{
    flex-direction: row;
    justify-content: flex-end;
}

.user-img{
    max-width: 30px;
    margin-left: 3px;
    height: 100%;
}

.messageContainer{
    display:flex;
}

#send-button{
    background: #67BC7C;
    border-radius: 0 8px 8px 0;
    padding: 0;
    position: absolute;
    bottom: 0;
    right: 0;
    margin-bottom: 15px;
    margin-right: 15px;
    height: 57px !important;
    width: 57px;
    border: 1px solid rgba(103, 188, 124, 0.3);
    border-left: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

#send-button:hover {
    background-color: #5aa86b;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(103, 188, 124, 0.3);
}

#send-button i {
    color: white;
    font-size: 18px;
}

#send-icon{
    max-width: 96px;
}

textarea#user-input {
    width: calc(100% - 57px);
    padding: 20px !important;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(103, 188, 124, 0.3);
    border-radius: 8px 0px 0px 8px;
    border-right: none;
    bottom: 0;
    margin: 15px 0px 15px 0px;
    height: 57px !important;
    color: white;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    overflow: hidden;
    text-align: left;
    vertical-align: middle;
}

textarea#user-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

textarea#user-input:focus {
    outline: none;
    border-color: #67BC7C;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(103, 188, 124, 0.2);
}

#user-container{
    display: flex;
    justify-content: flex-start;
    position: sticky;
    padding: 0 15px;
}

.loader {
    animation: spin 2s linear infinite;
}

.loading-message{
    background: #7cba8224 !important;
    display:flex;
}

.loading-alignment{
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.loadingMessageContainer{
    display:flex;
    justify-content: flex-end;
}

.dot{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: green;
    margin: 2px;
    animation: loadingFade 1s infinite;
}

.dot:nth-child(1) {
    animation-delay: 0s;
  }
  
  .dot:nth-child(2) {
    animation-delay: 0.2s;
  }
  
  .dot:nth-child(3) {
    animation-delay: 0.4s;
  }


  @keyFrames loadingFade {
      0%{
          opacity:0;
      }
      50%{
          opacity: 0.8;
      }
      100%{
          opacity: 0;
      }
  }

.message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}

/* All children of message get this styling. These elements are generated by marked on the fly */
.message * {
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
}

/* Tables are weirdly compressed due to lower specificity css rules so we undo that here */
.message table {
    border-collapse: separate;
    border-spacing: 1.5em 0px;
}

/* Any messages should get the typical blue coloring so users can see they are links. Have to do this because there is a lot of !important spam */
.message a {
    color: #007bff !important;
}

.message h1,
.message h2,
.message h3,
.message h4,
.message h5,
.message h6 {
    margin-top: 0.8rem;
    margin-bottom: 0.3rem;
}

/* Reduce header sizes so they don't look grotesquely large compared to normal text in the chat */
.message h1 { font-size: 1.7em; }
.message h2 { font-size: 1.4em; }
.message h3 { font-size: 1.1em; } 
.message h4 { font-size: 0.95em; } 
.message h5 { font-size: 0.825em; } 
.message h6 { font-size: 0.825em; }  

.thumbs{
    max-width: 35px;
    margin: 5px;
    cursor: pointer;
  }

.feedback-message{
    background: #7cba8224 !important;
    display:flex;
}

.feedback-alignment{
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.feedbackMessageContainer{
    display:flex;
    justify-content: flex-end;
}

@media only screen and (max-width: 768px) {
    #ask-finn-container {
        bottom: 70px !important; /* Position above mobile navbar */
    }
    
    #chatbox-container{
        width: 100%;
        max-height: calc(100vh - 80px) !important; /* Ensure it doesn't go above navbar */
    }

    .finn-button{
        margin: -5px;
    }

    .message{
        font-size: 0.75rem;
    }

    #ask-finn-subtitle{
        font-size: 1rem;
    }

    #user-input{
        width: 100%;
        padding: 17px !important;
    }

}

@media only screen and (min-width: 768px) and (max-width: 1080px){
    #chatbox-container{
        width: 50%;
    }
}

