/*
=============================================================================
RAG WIDGET STYLES
=============================================================================
Defines the visual appearance, floating behavior, and smooth animations 
of the chat widget. It uses a high z-index to ensure it always floats 
above the host website's content.
=============================================================================
*/

/*body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}*/

/* Floating toggle button */
#chatbot-button {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 60px;
    height: 60px;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
	background: linear-gradient(135deg, #339933 0%, #330099 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000; /* Keeps button on top of other elements */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.2);
}

#chatbot-button:active {
    transform: scale(0.95);
}

/* Main chat container */
#chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    /*background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);*/
	background: linear-gradient(135deg, rgba(51,153,51,0.05) 0%, rgba(51,0,153,0.08) 100% );
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

/* CSS Animations for smooth opening/closing */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

#chatbot-header {
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
	background: linear-gradient(135deg, #339933 0%, #330099 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border-radius: 0 0 20px 20px;
}

/* Custom Scrollbar */
#chatbot-messages::-webkit-scrollbar { width: 6px; }
#chatbot-messages::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 10px; }
#chatbot-messages::-webkit-scrollbar-thumb { /*background: rgba(102, 126, 234, 0.5);*/ background: rgba(51, 153, 51, 0.5); border-radius: 10px; }
#chatbot-messages::-webkit-scrollbar-thumb:hover { /*background: rgba(102, 126, 234, 0.7);*/ background: rgba(51, 153, 51, 0.7); }

#chatbot-input-area {
    display: flex;
    padding: 15px;
    background: rgba(255,255,255,0.9);
    border-top: 1px solid rgba(0,0,0,0.1);
    border-radius: 0 0 20px 20px;
}

#chatbot-input {
    flex: 1;
    padding: 12px 15px;
    /*border: 2px solid rgba(102, 126, 234, 0.3);*/
	border: 2px solid rgba(51, 153, 51, 0.3);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

#chatbot-input:focus { /*border-color: #667eea;*/ border-color: #339933; }

#chatbot-send {
    margin-left: 10px;
    padding: 12px 20px;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
	background: linear-gradient(135deg, #339933 0%, #330099 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#chatbot-send:hover {
    transform: translateY(-2px);
    /*box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);*/
	box-shadow: 0 4px 15px rgba(51, 153, 51, 0.4);
}

#chatbot-send:active { transform: translateY(0); }

/* Chat bubbles */
.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    text-align: right;
    margin-left: auto;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
	background: linear-gradient(135deg, #339933 0%, #330099 100%);
    color: white;
    /*box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);*/
	box-shadow: 0 2px 10px rgba(51, 153, 51, 0.3);
}

.message.bot {
    text-align: left;
    margin-right: auto;
    background: white;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Three-dot typing animation */
.typing { display: inline-block; }
.typing::after { content: ''; animation: typing 1.5s infinite; }
@keyframes typing {
    0%, 60%, 100% { content: ''; }
    30% { content: '.'; }
}

/* Responsive design for mobile phones */
@media (max-width: 480px) {
    #chatbot-window {
        width: 90vw;
        height: 70vh;
        bottom: 80px;
        right: 5vw;
    }
    #chatbot-button { bottom: 15px; right: 15px; }
}