/* Chatbot Widget - CETEC */
#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#chatbot-toggle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #009688;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, background 0.3s;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 150, 136, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(0, 150, 136, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 150, 136, 0);
    }
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    background: #00796b;
}

#chatbot-toggle i {
    color: #fff;
    font-size: 38px;
}

#chatbot-container {
    display: none;
    position: absolute;
    bottom: 95px;
    right: 0;
    width: 450px;
    height: 625px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    flex-direction: column;
    overflow: hidden;
}

#chatbot-container.open {
    display: flex;
}

#chatbot-header {
    background: #009688;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#chatbot-header .avatar {
    width: 63px;
    height: 63px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

#chatbot-header .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#chatbot-header .info h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

#chatbot-header .info small {
    opacity: 0.85;
    font-size: 12px;
}

#chatbot-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
}

#chatbot-close:hover {
    opacity: 1;
}

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.bot {
    background: #fff;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chat-message.user {
    background: #009688;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message .typing {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.chat-message .typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.chat-message .typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-message .typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

#chatbot-input-area {
    padding: 12px 15px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    resize: none;
    max-height: 80px;
}

#chatbot-input:focus {
    border-color: #009688;
}

#chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #009688;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

#chatbot-send:hover {
    background: #00796b;
}

#chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    #chatbot-container {
        width: calc(100vw - 40px);
        height: 450px;
        right: -10px;
    }
}
