/* Floating AI Assistant Container (Fully Responsive) */
.ai-assistant-container {
    position: fixed;
    bottom: 5%;
    left: 15%;
    transform: translateX(-50%);
    width: 250px;
    height: auto;
    cursor: pointer;
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Adjust the size of the avatar dynamically */
.ai-assistant-btn {
    position: relative;
    width: 100%;
    height: auto;
}

.ai-assistant-btn img {
    width: 100%;
    height: auto;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0));
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0));
    border-radius: 15px;
}

/* Close Button on Avatar */
.ai-close-btn {
    position: absolute;
    top: 10px;
    right: 40px;
    width: 30px;
    height: 30px;
    background: red;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    pointer-events: auto;
}

/* Speech Bubbles */
.ai-message-bubble,
.ai-message-bubble-second,
.ai-message-bubble-third{
    position: absolute;
    background: #fff;
    color: #333;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    cursor: pointer;
	z-index:100;
}

/* Position Speech Bubbles Responsively */
.ai-message-bubble {
    top: -45px;
    left: 15px;
}

.ai-message-bubble-second {
    top: 20px;
    left: -30px;
}

.ai-message-bubble-third {
    top: 100px;
    left: 30px;
}

/* Style Links in Speech Bubbles */
.ai-message-bubble span,
.ai-message-bubble-second span,
.ai-message-bubble-third span{
    font-weight: bold;
    text-decoration: underline;
    color: #09598f;
}

/* Chat Popup Styles */
#chatIframe {
    width: 100%;
    height: calc(100% - 50px);
    border: none;
    padding: 0.1em;
    margin-bottom: 0;
    background: #ffffff;
    border-radius: 10px;
}

/* SweetAlert Customization */
.swal2-html-container.ui-draggable-handle {
    padding: 0.5em;
}

div:where(.swal2-container) div:where(.swal2-popup) {
    padding: 0;
}

/* Reduce title font size in SweetAlert2 */
.swal-custom-title {
    font-size: 1em !important;  /* Ensures smaller text */
    font-weight: bold !important;  /* Reduce boldness */
    text-align: center !important;  /* Keep title centered */
    text-decoration: underline !important;  /* Add underline */
}

/* Ensure Close Button on Avatar is Clickable */
.ai-assistant-container .ai-close-btn {
    pointer-events: auto;
}

.swalButtons {
    display: flex; justify-content: center; gap: 10px; margin-top: 10px;
}

/* Buttons inside SweetAlert2 */
#restartChatBtn, #closeChatBtn {
    padding: 8px 12px;
    border: none;
    background: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#closeChatBtn {
    background: red; /* Close button remains red */
}

#restartChatBtn:hover {
    background: #0056b3; /* Darker blue on hover */
}

#closeChatBtn:hover {
    background: darkred; /* Darker red on hover */
}

/* ===================== */
/* 📌 RESPONSIVE STYLES */
/* ===================== */

/* 📱 Mobile View */
@media screen and (max-width: 768px) {
    .ai-assistant-container {
        bottom: 10px;
        left: 10px;
        transform: none;
        width: 180px; /* Smaller size for mobile */
    }

    .ai-close-btn {
        top: 5px;
        right: 125px;
        width: 25px;
        height: 25px;
        font-size: 14px;
    }

    .ai-message-bubble {
        top: -35px;
        left: 110px;
        font-size: 12px;
        padding: 6px 10px;
    }

    .ai-message-bubble-second {
        top: 10px;
        left: 140px;
        font-size: 12px;
        padding: 6px 10px;
    }
	
	.ai-message-bubble-third {
    top: 60px;
    left: 125px;
	font-size: 12px;
    padding: 6px 10px;
}
}

/* 🖥️ Large Screens */
@media screen and (min-width: 1024px) {
    .ai-assistant-container {
        bottom: 5%;
        left: 12.5%;
        transform: translateX(-50%);
        width: 300px;
    }

    .ai-message-bubble {
        top: -50px;
        left: 20px;
    }

    .ai-message-bubble-second {
        top: 25px;
        left: -30px;
    }
	
	.ai-message-bubble-third {
    top: 100px;
    left: 30px;
	font-size: 12px;
    padding: 6px 10px;
}

    .ai-close-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}

/* 🖥️ Tablet Screens (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .ai-assistant-container {
        bottom: 2%;
        left: 22%;
        transform: translateX(-50%);
        width: 220px; /* Medium size for tablets */
    }

    .ai-message-bubble {
        top: -40px;
        left: 15px;
        font-size: 13px;
        padding: 7px 11px;
    }

    .ai-message-bubble-second {
        top: 15px;
        left: -35px;
        font-size: 13px;
        padding: 7px 11px;
    }
	
	.ai-message-bubble-third {
    top: 80px;
    left: -15px;
	font-size: 12px;
    padding: 6px 10px;
}

    .ai-close-btn {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 15px;
    }
}