* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chat-bubble-enter {
    animation: bubbleEnter 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bubbleEnter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pulse-ring {
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    80%, 100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.typing-dots {
    display: inline-flex;
    align-items: center;
}

.typing-dots span {
    height: 4px;
    width: 4px;
    margin: 0 1px;
    background-color: #9CA3AF;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-scroll {
    scrollbar-width: thin;
    scrollbar-color: #E5E7EB transparent;
}

.chat-scroll::-webkit-scrollbar {
    width: 4px;
}

.chat-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.chat-scroll::-webkit-scrollbar-thumb {
    background-color: #E5E7EB;
    border-radius: 2px;
}

.chat-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #D1D5DB;
}

.gradient-bg {
    background: linear-gradient(135deg, #00b33d 0%, #00a037 100%);
}

.message-user {
    background: linear-gradient(135deg, #00b33d 0%, #00a037 100%);
}

.message-bot {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.shadow-chat {
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.1), 0 8px 8px -5px rgba(0, 0, 0, 0.04);
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Compact styles */
.compact-header {
    padding: 8px 12px;
}

.compact-messages {
    padding: 8px;
}

.compact-input {
    padding: 8px 12px;
}

.compact-message {
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.3;
}

.compact-avatar {
    width: 24px;
    height: 24px;
}

.compact-toggle {
    width: 44px;
    height: 44px;
}
#chat-box{
    z-index: 999998 !important;
}
#chat-toggle{
    z-index: 9999 !important;
}
.hidden {
    display: none !important;
}
#chat-box{
    height: 700px;
    width: 580px !important;
    max-height: 100vw !important;
    max-width: 90vw !important;
    border: solid 1px #f1f1f1;
}
#send-btn{
    height: 46px;
    width: 46px;
}
.text-xs{
    white-space: pre-wrap;
    font-size: 13px;
}
.max-w-xs{
    max-width: 85% !important;
}
#chat-icon{
    padding: 10px;
}
.message-bot a{
    color: #1e90ff;
}
.message-bot a:hover{
    color: #d0814b;
    text-decoration: underline !important;
}
.img-icon-hunonic-ai{
    width: 18px;
}
.img-icon-hunonic-ai-botname{
    border: solid 1px #e7e7e7;
    border-radius: 3px;
    width: 24px;
}

/* Suggested questions styling */
.suggested-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #f1f1f1;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.suggested-question {
    font-size: 12px;
    padding: 6px 12px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.suggested-question:hover {
    background-color: #e6f7ff;
    border-color: #00a037;
    color: #00a037;
}

.fade-out {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* Textarea style */
#hunonic-chat-bot-textarea {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    overflow-y: auto;
}

#hunonic-chat-bot-textarea:focus {
    border-color: #00a037;
    box-shadow: 0 0 0 2px rgba(0, 160, 55, 0.2);
}


#chat-toggle #b-chat-icon{
    width: 58px;
    height: 58px;
}
#chat-toggle #b-chat-icon #chat-icon{
    font-size: 26px;
}

#chat-messages h1{
    font-size: 18px;
}
#chat-messages h2{
    font-size: 17px;
}
#chat-messages h3{
    font-size: 16px;
    padding: 0 !important;
    margin: 0 !important;
}
#chat-messages h4{
    font-size: 15px;
}
#chat-messages h5, #chat-messages h6{
    font-size: 14px;
}
.message-bot div:first-child
{
    margin-bottom: 5px;
}
.message-user div:first-child{
    margin-bottom: 5px;
}
.message-bot > .prose > ul > li > p:first-child{
    margin-top: 10px !important;
}
.message-bot ul li > ul li::before{
    content: "- ";
}

.text-wrap-break {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    overflow: hidden !important;
}

/* Enhanced Image styles - Messenger-like */
.message-images {
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
}

.message-image {
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Single image */
.message-images.single-image .message-image {
    max-width: 280px;
    max-height: 200px;
    width: auto;
    height: auto;
}

/* Two images */
.message-images.two-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    max-width: 280px;
}

.message-images.two-images .message-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* Three images */
.message-images.three-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    max-width: 280px;
    height: 200px;
}

.message-images.three-images .message-image:first-child {
    grid-row: 1 / 3;
    height: 100%;
}

.message-images.three-images .message-image:not(:first-child) {
    height: 96px;
}

/* Four images */
.message-images.four-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    max-width: 280px;
    height: 200px;
}

.message-images.four-images .message-image {
    width: 100%;
    height: 96px;
    object-fit: cover;
}

/* More than 4 images */
.message-images.multiple-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    max-width: 280px;
    height: 200px;
    position: relative;
}

.message-images.multiple-images .message-image {
    width: 100%;
    height: 96px;
    object-fit: cover;
}

.message-images.multiple-images .image-overlay {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.message-images.multiple-images .image-overlay:hover {
    background: rgba(0, 0, 0, 0.8);
}

.image-preview {
    position: relative;
    display: inline-block;
    margin: 5px;
}

.image-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    border: 2px solid #e5e7eb;
}

.image-preview .remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-area {
    display: none;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.image-upload-area.show {
    display: block;
}

/* Enhanced Modal styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    backdrop-filter: blur(4px);
}

.image-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

.image-modal .close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    color: #333;
}

.image-modal .close-modal:hover {
    background: white;
    transform: scale(1.1);
}

.image-modal .image-counter {
    margin-top: 15px;
    color: white;
    font-size: 14px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
}

.image-modal .nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    color: #333;
}

.image-modal .nav-button:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.image-modal .nav-button.prev {
    left: 20px;
}

.image-modal .nav-button.next {
    right: 20px;
}

/* Loading styles */
.uploading-image {
    position: relative;
    opacity: 0.7;
}

.uploading-image::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #00a037;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.upload-progress {
    background: rgba(0, 179, 61, 0.1);
    border: 1px dashed #00a037;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: #00a037;
    margin: 5px 0;
}

.upload-progress .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #00a037;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Message content spacing */
.message-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-text {
    order: 2;
}

.message-images {
    order: 1;
}

/* User message images on right */
.message-user .message-images {
    align-self: flex-end;
}

/* Bot message images on left */
.message-bot .message-images {
    align-self: flex-start;
}
.message-recalled{
    color: #a2a2a2 !important;
}