

.message.user {
    align-self: flex-end;
    background-color: #007bff;
    color: white;
    border-radius: 20px;
    border-top-right-radius: 0;
}

.message.errorChat{
    background-color:#d63638 ;
}

.message-content {
    word-wrap: break-word;
    position: relative;
}

.message.assistant{
    display: flex;
    align-items: flex-start;
}


.message.assistant .message-content{
    background-color: #f8f9fa;
    color: #000;
    border-top-left-radius: 0;
    padding: 15px;
    word-wrap: break-word;
    max-width:calc(100% - 50px);
    border-bottom-left-radius: 10%;
    border-bottom-right-radius: 10%;
    border-top-right-radius: 10%;
}


.message {
    margin-bottom: 30px;
    max-width: 90%;
}

.chat-error-message{
    font-style: italic;
    margin-top: 5px;
    font-size: .9em;

}



.chat-buttons{
    border-top: 1px solid #ccc;
    margin-top: 15px;
    padding:0;
    padding-top: 10px;
    display: flex;
    align-items: center;
}

.messageTag{
    white-space:nowrap;
    color:red;
}

.message-content{
    font-size: 1em;
    line-height: 1.5em;
}

.message-content p:first-child{
    margin-top: 0;
}

.chatContent .message:not(:last-child) .firstOnly{
    display: none;
}


.chat-buttons button.rnbtn{
    display: inline-flex;
    align-items: center;    

}

.chat-buttons button.rnbtn rn-fontawesome{
    margin-right: 5px;
}
.chatGlobe{
    cursor: pointer;
}

.chatGlobe img{
    transition: transform 0.25s ease;
}

.chatGlobe:hover img{
    transform: scale(1.1);
}

.chatGlobe.hidden {
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* Chat Panel Styles */
.chat-panel {
    position: fixed;
    width: 0;
    height: 0;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    opacity: 0;
    transition: width 0.4s ease, 
                height 0.4s ease, 
                opacity 0.4s ease, 
                right 0.4s ease, 
                top 0.4s ease;
}

.chat-panel.visible {
    width: 400px;
    height: 600px;
    opacity: 1;
}

.chat-panel.hidden {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.points_wrapper{
    opacity: 0;
    transition: opacity 0.5s ease;
}

.aibutton:hover .points_wrapper{
    opacity: 1;
}

.aibutton {
    background-color: #7a5af8;
    border: none;
    --round: 0.75rem;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.25s ease;
    border-radius: var(--round);
    border: none;
    outline: none;
    padding: 5px 10px;
  }
  .aibutton::before,
  .aibutton::after {
    content: "";
    position: absolute;
    inset: 0;
    transition: all 0.5s ease-in-out;
    border-radius: calc(var(--round) - var(--space));
    z-index: 0;
  }
  .aibutton::before {
    --space: 1px;

  }

  .aibutton::after {

    --space: 0px;
    background-image: red;
    opacity: 0;
      transition: opacity 0.5s ease-in-out;
      background-image: radial-gradient(
        65.28% 65.28% at 50% 100%,
        rgba(223, 113, 255, 0.8) 0%,
        rgba(223, 113, 255, 0) 100%
      ),
      linear-gradient(0deg, #7a5af8, #7a5af8);
  }


  .aibutton:not(.disabled):hover::after {
    --space: 2px;
    opacity: 1;
    background-image: radial-gradient(
        65.28% 65.28% at 50% 100%,
        rgba(223, 113, 255, 0.8) 0%,
        rgba(223, 113, 255, 0) 100%
      ),
      linear-gradient(0deg, #7a5af8, #7a5af8);
  }


  .aibutton:active .inner{
    transform: scale(0.95);
  }

 
  
  .points_wrapper {
    overflow: hidden;
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    z-index: 1;
  }
  
  .points_wrapper .point {
    bottom: -10px;
    position: absolute;
    animation: floating-points infinite ease-in-out;
    pointer-events: none;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 9999px;
  }
  @keyframes floating-points {
    0% {
      transform: translateY(0);
    }
    85% {
      opacity: 0;
    }
    100% {
      transform: translateY(-55px);
      opacity: 0;
    }
  }
  .points_wrapper .point:nth-child(1) {
    left: 10%;
    opacity: 1;
    animation-duration: 2.35s;
    animation-delay: 0.2s;
  }
  .points_wrapper .point:nth-child(2) {
    left: 30%;
    opacity: 0.7;
    animation-duration: 2.5s;
    animation-delay: 0.5s;
  }
  .points_wrapper .point:nth-child(3) {
    left: 25%;
    opacity: 0.8;
    animation-duration: 2.2s;
    animation-delay: 0.1s;
  }
  .points_wrapper .point:nth-child(4) {
    left: 44%;
    opacity: 0.6;
    animation-duration: 2.05s;
  }
  .points_wrapper .point:nth-child(5) {
    left: 50%;
    opacity: 1;
    animation-duration: 1.9s;
  }
  .points_wrapper .point:nth-child(6) {
    left: 75%;
    opacity: 0.5;
    animation-duration: 1.5s;
    animation-delay: 1.5s;
  }
  .points_wrapper .point:nth-child(7) {
    left: 88%;
    opacity: 0.9;
    animation-duration: 2.2s;
    animation-delay: 0.2s;
  }
  .points_wrapper .point:nth-child(8) {
    left: 58%;
    opacity: 0.8;
    animation-duration: 2.25s;
    animation-delay: 0.2s;
  }
  .points_wrapper .point:nth-child(9) {
    left: 98%;
    opacity: 0.6;
    animation-duration: 2.6s;
    animation-delay: 0.1s;
  }
  .points_wrapper .point:nth-child(10) {
    left: 65%;
    opacity: 1;
    animation-duration: 2.5s;
    animation-delay: 0.2s;
  }
  
  .inner {
    z-index: 2;
    position: relative;
    width: 100%;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.2s ease-in-out, transform 0.05s ease-in-out;
  }

  .aibutton .inner .aiMessage{
    margin-left: 5px;
  }

  .aibutton.disabled{
    background-color: #555;
  }
  
  .aibutton.compact .inner .aiMessage {
    max-width: 0;
    width: 0;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: max-width 0.5s ease, opacity 0.3s ease, width 0.5s ease, margin 0.5s ease,margin-left 0.5s ease;
    display: inline-block;
    padding-left: 0;
    margin-left: 0px;

  }
  
  .aibutton.compact:hover .inner .aiMessage {
    max-width: 200px;
    width: auto;
    opacity: 1;
    margin-left: 5px;
  }
  
  .inner svg.icon {
    width: 35px;
    height: 35px;
    transition: fill 0.1s linear;
  }
  
  
  .aibutton:hover svg.icon {
    fill: transparent;
    animation:
      dasharray 1s linear forwards
  }
  @keyframes dasharray {
    from {
      stroke-dasharray: 0 0 0 0;
    }
    to {
      stroke-dasharray: 40 40 0 0;
    }
  }
.chatModeToggle {
    text-align: right;
    padding: 6px 10px;
    font-size: 12px;
    position: absolute;
    top: 0;
    left: 1px;
}

.chatModeToggle a {
    text-decoration: none;
    color: #666;
    cursor: pointer;
}

.chatModeToggle a:hover {
    color: #333;
    text-decoration: underline;
}

/* Mode-specific styles */
.chat-mode-normal {
    background: #ffffff;
    transition: background 0.3s ease;
}

.chat-mode-normal .chatModeToggle a {
    color: #888;
}

.chat-mode-external {
    background: #f0f4ff;
    transition: background 0.3s ease;
}


.chat-mode-external .chatModeToggle a {
    color: #4a6cf7;
    font-weight: 600;
}

.chat-mode-external .chatModeToggle a:hover {
    color: #3451c7;
}

.chat p {
    font-size: 16px !important;
}

.chatContent {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px;

}

.message-content {
    padding: 15px;
    word-wrap: break-word;
}

.chatStatusButton {
    text-decoration: none;
}

.slideIn {
    animation: slideInFromBottom 0.3s ease-in-out;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.externalResponseOnly {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    font-size: 12px;
    color: #4a6cf7;
    cursor: pointer;
    user-select: none;
}

.externalResponseOnly input[type="checkbox"] {
    cursor: pointer;
}
.chatContainer {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 10px;
    position: relative;
}

.chatInput {
    width: 100%;
    max-height: 12em;
    /* 6 lines */
    overflow-y: auto;
    resize: none;
}

.chatInput p {
    margin-top: 0 !important;
}

.chatInput .placeholder {
    color: #ccc;
    font-style: italic;
}

.submitButton {
    transition: transform 0.2s ease-in-out;
}

.submitButton:hover {
    transform: scale(1.1);
}

.modelSelector {
    border: none !important;
    outline: none;
    text-align: right;
    margin-right: 5px !important;
    transform: color 0.2s ease-in-out !important;
    color: #666 !important;
}

.modelSelector:focus {
    border: none !important;
    outline: none;
    box-shadow: none !important;
}

/* Autocomplete styling */
.suggestions-container {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100000;
    width: 200px;
}

/* File upload styling */
.chatContainer.dragOver {
    border-color: #4a90d9;
    background-color: rgba(74, 144, 217, 0.05);
}

.attachButton {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    color: #666;
    transition: color 0.2s ease-in-out;
    margin-right: 2px;
}

.attachButton:hover {
    color: #333;
}

.filePreviewArea {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.filePreviewItem {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 72px;
    min-width: 72px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px;
    background-color: #fafafa;
}

.filePreviewThumbnail {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.filePreviewIcon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #888;
}

.filePreviewName {
    font-size: 10px;
    color: #666;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    margin-top: 2px;
}

.fileRemoveButton {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    transition: transform 0.15s ease;
}

.fileRemoveButton:hover {
    transform: scale(1.15);
}

.fileInput {
    display: none;
}
/* Autocomplete styling */
.suggestions-container {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100000;
    width: 200px;
}

.suggestion-item {
    padding: 6px 10px;
    cursor: pointer;
}

.suggestion-item.selected {
    background-color: #e6f7ff;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.suggestion-item strong {
    font-weight: bold;
    color: #0066cc;
}

.suggestion-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item.sticky-parent {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    font-weight: 500;
    color: #666;
    z-index: 1;
    margin-bottom: 4px;
}

.suggestion-item.sticky-parent .suggestion-item-content {
    color: #666;
}

.suggestion-item.child-item {
    padding-left: 20px;
}

.external-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    animation: fadeIn 0.2s ease;
}

.external-chat-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 680px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
    overflow: hidden;
}

.external-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f0f4ff;
}

.external-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.external-chat-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.external-chat-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.external-chat-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.external-chat-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.external-chat-section-label .badge {
    background: #4a6cf7;
    color: #fff;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.external-chat-prompt-area {
    width: 100%;
    min-height: 180px;
    max-height: 250px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #334155;
    background: #f8fafc;
    resize: vertical;
    box-sizing: border-box;
}

.external-chat-response-area {
    width: 100%;
    min-height: 120px;
    max-height: 200px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #334155;
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
}

.external-chat-response-area:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.external-chat-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.external-chat-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.external-chat-btn-copy {
    background: #e2e8f0;
    color: #334155;
}

.external-chat-btn-copy:hover {
    background: #cbd5e1;
}

.external-chat-btn-copy.copied {
    background: #dcfce7;
    color: #166534;
}

.external-chat-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.external-chat-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.external-chat-btn-cancel:hover {
    background: #e2e8f0;
}

.external-chat-btn-send {
    background: #4a6cf7;
    color: #fff;
}

.external-chat-btn-send:hover {
    background: #3b5de7;
}

.external-chat-btn-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.external-chat-instructions {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}