:root {
    --heading-size: 14px;
}

#cloudprime-chatbot {
    position:fixed;
    bottom:90px;
    right:20px;
    width:370px;
    height:60vh;
    min-height:400px;
    max-height:600px;
    background:white;
    border-radius:15px;
    box-shadow:0 5px 30px rgba(0,0,0,.2);
    z-index:10000;
    display:flex;
    flex-direction:column;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    transition:opacity .3s,transform .3s;
    transform:translateY(20px);
    opacity:0;
}
#cloudprime-chatbot.open {
    transform:translateY(0);
    opacity:1;
}

#chatbot-header {
    background:#2c3e50;
    color:white;
    padding:15px;
    border-radius:15px 15px 0 0;
    display:flex;
    align-items:center;
    gap:15px;
    flex-shrink:0;
}
.chatbot-avatar img,
.avatar-placeholder {
    width:45px;
    height:45px;
    border-radius:50%;
    background:#34495e;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
}
.chatbot-info h3 {
    margin:0;
    font-size:16px;
    font-weight:600;
}
.chatbot-info p {
    margin:0;
    font-size:12px;
    opacity:.8;
}
#chatbot-minimize {
    margin-left:auto;
    background:none;
    border:none;
    color:white;
    font-size:30px;
    font-weight:bold;
    cursor:pointer;
    line-height:1;
}

#chatbot-messages {
    flex:1;
    overflow-y:auto;
    padding:20px;
    background:#f4f7f9;
    display:flex;
    flex-direction:column;
    gap:15px;
}
.message {
    display:flex;
    max-width:85%;
    flex-direction:column;
}
.message.user {
    align-self:flex-end;
    align-items:flex-end;
}
.message.bot,
.message.system,
.message.error {
    align-self:flex-start;
    align-items:flex-start;
}
.message-sender {
    font-size:12px;
    color:#555;
    margin-bottom:4px;
    margin-left:5px;
}
.message.user .message-sender {
    margin-right:5px;
}
.message-content {
    padding:10px 15px;
    border-radius:18px;
    line-height:1.5;
    word-wrap:break-word;
}
.message.user .message-content {
    background:#007bff;
    color:white;
    border-bottom-right-radius:4px;
}
.message.bot .message-content {
    background:white;
    color:#333;
    border:1px solid #e9ecef;
    border-bottom-left-radius:4px;
}
.message.system .message-content,
.message.error .message-content {
    font-size:13px;
    background:#e6f7ff;
    color:#005f8f;
    border:1px solid #b3e0ff;
    border-radius:8px;
    text-align:center;
    width:100%;
}
.message.error .message-content {
    background:#ffebee;
    color:#c62828;
    border-color:#ffcdd2;
}

/* predefined questions */
#chatbot-predefined {
    padding:10px 15px;
    border-top:1px solid #e9ecef;
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.predefined-question {
    padding:6px 12px;
    background:#f1f3f5;
    border:1px solid #dee2e6;
    border-radius:20px;
    cursor:pointer;
    font-size:13px;
    color:#000 !important;          /* force black text */
    transition:background .2s,border-color .2s;
}
.predefined-question:hover {
    background:#e9ecef;
    border-color:#ced4da;
}

/* contact form */
#chatbot-contact-form {
    padding:15px;
    border-top:1px solid #e9ecef;
    background:#f8f9fa;
}
#chatbot-contact-form h4 {
    margin:0 0 5px;
    font-size: var(--heading-size);
    text-align:center;
}
#chatbot-contact-form p {
    font-size:12px;
    text-align:center;
    color:#666;
    margin-bottom:12px;
}
#chatbot-contact-form input {
    width:100%;
    padding:8px;
    margin-bottom:8px;
    border:1px solid #ced4da;
    border-radius:5px;
    box-sizing:border-box;
}
#save-contact {
    width:100%;
    padding:10px;
    background:#28a745;
    color:white;
    border:none;
    border-radius:5px;
    cursor:pointer;
    font-weight:600;
}

/* input area */
#chatbot-input-area {
    display:flex;
    padding:10px;
    border-top:1px solid #e9ecef;
    background:white;
    border-radius:0 0 15px 15px;
    flex-shrink:0;
    gap:8px;
}
#chatbot-input {
    flex:1;
    padding:10px 15px;
    border:1px solid #ced4da;
    border-radius:20px;
    outline:none;
    font-size:14px;
}
#chatbot-input:focus {
    border-color:#007bff;
}
.voice-button {
    width:40px;
    height:40px;
    background:#fff;
    border:1px solid #ced4da;
    border-radius:50%;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
}
.voice-button .mic-icon {
    font-size:16px;
}
#chatbot-send {
    width:40px;
    height:40px;
    background:#007bff;
    color:white;
    border:none;
    border-radius:50%;
    cursor:pointer;
    font-size:18px;
    display:flex;
    align-items:center;
    justify-content:center;
}
#chatbot-send:hover {
    background:#0056b3;
}

/* toggle button */
#chatbot-toggle {
    position:fixed;
    bottom:20px;
    right:20px;
    width:60px;
    height:60px;
    background:#007bff;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    z-index:9999;
    box-shadow:0 2px 10px rgba(0,0,0,.2);
    transition:transform .2s;
}
#chatbot-toggle:hover {
    transform:scale(1.1);
}
.chat-icon {
    font-size:24px;
    color:white;
}

/* whatsapp */
.whatsapp-button-container {
    text-align:center;
}
.whatsapp-button {
    display:inline-block;
    background:#25d366;
    color:white;
    padding:10px 15px;
    border-radius:8px;
    text-decoration:none;
    margin-top:5px;
    font-weight:600;
}
.whatsapp-button:hover {
    background:#128c7e;
}

/* responsive */
@media (max-width:480px){
    #cloudprime-chatbot {
        width:100%;
        height:100%;
        bottom:0;
        right:0;
        border-radius:0;
        max-height:100%;
    }
    #chatbot-toggle {
        bottom:15px;
        right:15px;
    }
/* force visible microphone button on all screens */
.voice-button {
    background: #ffffff !important;
    border: 1px solid #ced4da !important;
}
.voice-button .mic-icon {
    font-size: 16px;
    filter: none;
}
}