/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Chatbot Bubble */
.chatbot-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #117f10 0%, #0a5c0a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(17, 127, 16, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    animation: float 3s ease-in-out infinite;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(17, 127, 16, 0.4);
}

.chatbot-bubble i {
    color: white;
    font-size: 28px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 380px;
    max-width: 90vw;
    height: 550px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chatbot-container.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #117f10 0%, #0a5c0a 100%);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar i {
    font-size: 22px;
}

.chatbot-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 3px;
}

.chatbot-info .status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-info .status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 5px;
}

.close-btn:hover {
    opacity: 1;
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.bot-message {
    align-self: flex-start;
}

.bot-message .message-content {
    background: #e9f5e9;
    border-radius: 18px 18px 18px 5px;
    padding: 12px 15px;
}

.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #117f10 0%, #0a5c0a 100%);
    color: white;
    border-radius: 18px 18px 5px 18px;
    padding: 12px 15px;
}

.message-content p {
    margin: 0;
    line-height: 1.4;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 0 5px;
}

/* Quick Options */
.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.quick-option {
    background: white;
    border: 1px solid #117f10;
    color: #117f10;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-option:hover {
    background: #117f10;
    color: white;
    transform: translateY(-2px);
}

/* Chatbot Input */
.chatbot-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

.chatbot-input input:focus {
    border-color: #117f10;
}

.chatbot-input button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #117f10;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input button:hover {
    background: #0a5c0a;
    transform: scale(1.05);
}

.chatbot-input button#voiceInput {
    background: #f0f0f0;
    color: #117f10;
}

.chatbot-input button#voiceInput:hover {
    background: #e0e0e0;
}

/* Chatbot Footer */
.chatbot-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 12px;
}

.chatbot-footer p {
    margin: 5px 0;
    color: #666;
}

.chatbot-footer a {
    color: #117f10;
    text-decoration: none;
    margin-left: 5px;
}

.chatbot-footer a:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 15px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #117f10;
    border-radius: 50%;
    opacity: 0.6;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-bubble {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }

    .chatbot-bubble i {
        font-size: 24px;
    }

    .chatbot-container {
        bottom: 100px;
        right: 20px;
        left: 20px;
        width: auto;
        height: 500px;
    }

    .chatbot-input {
        padding: 10px;
    }

    .chatbot-input button {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        max-height: 70vh;
    }

    .quick-options {
        justify-content: center;
    }

    .quick-option {
        font-size: 11px;
        padding: 6px 10px;
    }
}


/* Additional styles for Rasa integration */

/* Buttons from Rasa */
.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    justify-content: flex-start;
}

.quick-option {
    background: white;
    border: 1px solid #117f10;
    color: #117f10;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-option:hover {
    background: #117f10;
    color: white;
    transform: translateY(-2px);
}

/* Images from Rasa */
.message img {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Cards from Rasa (if you use them) */
.rasa-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #117f10;
}

.rasa-card h4 {
    color: #117f10;
    margin-bottom: 8px;
    font-size: 14px;
}

.rasa-card p {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 15px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #117f10;
    border-radius: 50%;
    opacity: 0.6;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Error messages */
.error-message {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 13px;
}

/* Connection status */
.connection-status {
    position: absolute;
    top: 10px;
    right: 50px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #4CAF50;
    color: white;
}

.connection-status.offline {
    background: #f44336;
}