@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');

#chatbot-bubble {
    position: fixed;
    bottom: 2vh; /* Relative to viewport height for better scaling */
    z-index: 999999 !important;
    width: clamp(60px, 8vw, 80px); /* Responsive size with min/max bounds */
    height: clamp(60px, 8vw, 80px);
    border-radius: 50%;
    cursor: pointer;
    background: #0a1551;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    overflow: hidden;
    border: 4px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-bubble:hover {
    transform: scale(1.1);
}

#chatbot-bubble.pulsing::before,
#chatbot-bubble.pulsing::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(120px, 16vw, 140px); /* Responsive pulse ring size */
    height: clamp(120px, 16vw, 140px);
    border: 2px solid rgba(0, 200, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
    animation: pulseRing 2s infinite;
    z-index: -1;
}
#chatbot-bubble.pulsing::after {
    animation-delay: 1s;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0.8;
    }
    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

#chatbot-frame {
    position: fixed;
    bottom: calc(2vh + clamp(60px, 8vw, 80px) + 10px); /* Position above bubble */
    width: clamp(280px, 85vw, 400px); /* Responsive width */
    height: clamp(400px, 65vh, 600px); /* Responsive height */
    max-width: 90vw; /* Prevent overflow on small screens */
    max-height: 80vh; /* Prevent overflow on small screens */
    border: none;
    z-index: 999999 !important;
    display: none;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: #ffffff; /* Ensure background consistency */
}

#chatbot-greeting {
    position: fixed;
    bottom: calc(2vh + clamp(60px, 8vw, 80px) + 12px); /* Align with frame */
    max-width: clamp(180px, 60vw, 250px); /* Responsive greeting width */
    padding: clamp(8px, 2vw, 12px); /* Responsive padding */
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: clamp(12px, 3.5vw, 14px); /* Responsive font size */
    z-index: 999998 !important;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: 'Inter', Arial, sans-serif;
}
#chatbot-greeting.fade-in-out {
    animation: fadeInOut 3s ease-in-out 1;
}
@keyframes fadeInOut {
    0%   { opacity: 0; transform: scale(0.9); }
    50%  { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}
/* Responsive adjustments */
@media (max-width: 600px) {
    #chatbot-frame {
        width: 90vw; /* Full width on small screens */
        max-width: 360px;
        height: clamp(350px, 60vh, 500px); /* Adjust height for smaller screens */
    }
    #chatbot-greeting {
        max-width: 200px;
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    #chatbot-bubble {
        width: clamp(50px, 7vw, 60px);
        height: clamp(50px, 7vw, 60px);
    }
    #chatbot-frame {
        width: 95vw;
        max-width: 320px;
        height: clamp(300px, 55vh, 450px);
    }
    #chatbot-greeting {
        max-width: 180px;
        font-size: 11px;
        padding: 8px;
    }
}

@media (min-width: 1200px) {
    #chatbot-frame {
        width: 400px; /* Fixed width for large screens */
        height: 600px;
    }
    #chatbot-greeting {
        max-width: 300px;
        font-size: 16px;
    }
}

#chatbot-close-button {
    position: fixed;
    z-index: 1000000 !important; /* Higher than iframe to ensure visibility */
    width: 20px; /* Reduced to fit the cross icon */
    height: 20px; /* Reduced to fit the cross icon */
    color: #fff !important;
    display: none; /* Hidden by default */
    cursor: pointer;
    font-size: 20px; /* Adjusted for cross visibility */
    line-height: 20px; /* Match height for centering */
    text-align: center;
    transition: color 0.3s ease, transform 0.3s ease; /* Updated transition */
    font-family: 'Inter', Arial, sans-serif;
}
#chatbot-close-button * {
  color: inherit !important;
}

#chatbot-close-button:hover {
    color: #cccccc !important; /* Lighter white on hover with !important */
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #chatbot-close-button {
        width: 24px;
        height: 24px;
        font-size: 14px;
        line-height: 24px;
    }
}

@media (max-width: 400px) {
    #chatbot-close-button {
        width: 20px;
        height: 20px;
        font-size: 12px;
        line-height: 20px;
    }
}
