/* Alem AI Chat Widget Styles */
/* Import this CSS file to add the chat widget styles to any page */

/* Floating button */
#chatButton {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(0, 132, 132, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    padding: 0;
    overflow: hidden;
}

.welcome-note{
    color: #fff;
    padding: 10px 10px 5px;
    float: left;
    width: calc(100% - 65px);
    margin-left: 35px;
    text-align: center;
}


.chat-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Hide chat button when chat is open */
#chatButton.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

#chatButton:hover:not(.hidden) {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 132, 132, 0.5);
}

#chatButton:hover:not(.hidden) .chat-icon {
    transform: scale(1.05);
}

.ripple-animation {
    animation: ripple-animation 2s infinite;
}


.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0px rgba(0, 132, 132, 0.7);
    }

    100% {
        box-shadow: 0 0 0 15px rgba(0, 132, 132, 0);
    }
}

@keyframes ripple-animation {
    0% {
        box-shadow: rgba(153, 153, 153, 0.2) 0px 0px 0px 3.525px, rgba(153, 153, 153, 0.13) 0px 0px 0px 13.525px;
    }
    
    50% {
        box-shadow: rgba(153, 153, 153, 0.4) 0px 0px 0px 7px, rgba(153, 153, 153, 0.25) 0px 0px 0px 20px;
    }

    100% {
        box-shadow: rgba(153, 153, 153, 0.2) 0px 0px 0px 3.525px, rgba(153, 153, 153, 0.13) 0px 0px 0px 13.525px;
    }
}

/* Chat window */
#chatWidget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    height: 80vh;
    max-height: 590px;
    background: #008484;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
}

#chatHeader {
    background: #008584;
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

#chatTitle {
    font-size: 18px;
    font-weight: 700;
}

#closeChat {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    position: absolute;
    right: 8px;
    top: 8px;
}

#closeChat:hover {
    background: rgba(255, 255, 255, 0.18);
}

#closeChat .fallback-x {
    display: inline-block;
    font-weight: 700;
    line-height: 1;
}

#messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fafafa;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user {
    align-self: flex-end;
    background: #008484;
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant {
    align-self: flex-start;
    background: #e8f4f4;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message a {
    color: #006969;
    text-decoration: underline;
}

#chatInputContainer {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
    gap: 10px;
    background: white;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid #ddd;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
}

#userInput:focus {
    border-color: #008484;
    box-shadow: 0 0 0 2px rgba(0, 132, 132, 0.2);
}

#sendBtn {
    padding: 12px 24px;
    border-radius: 9999px;
    border: none;
    background: #008484;
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

#sendBtn i {
    font-size: 18px;
    line-height: 1;
}

#sendBtn:hover {
    background: #006969;
}

#sendBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsive design for mobile */
@media (max-width: 480px) {
    #chatWidget {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        right: 20px;
        left: 20px;
        bottom: 100px;
    }
    
    #chatButton {
        bottom: 20px;
        right: 20px;
    }
}
