/* Chatbot Styles */

/* Button */
.chatbot-button {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    background-color: var(--background-data-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.chatbot-button:hover {
    transform: scale(1.05);
    background-color: var(--background-data-text);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.chatbot-button i {
    font-size: 28px;
    color: #333;
}

/* Popup */
.chatbot-popup {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 0px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chatbot-popup.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Header */
.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
    background-color: #333;
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.chatbot-header-title {
    display: flex;
    align-items: center;
    font-weight: bold;
}

.chatbot-header-title i {
    margin-right: 10px;
    font-size: 18px;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
}

.chatbot-clear-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    margin-right: 10px;
    transition: opacity 0.2s ease;
}

.chatbot-clear-button:hover {
    opacity: 0.8;
}

.chatbot-header-close {
    cursor: pointer;
    padding: 5px;
    font-size: 25px;
}

.chatbot-header-close:hover {
    opacity: 0.8;
}

/* Content */
.chatbot-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.chatbot-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Messages */
.chatbot-message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

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

.chatbot-message-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.chatbot-message-bot .chatbot-message-icon {
    background-color: var(--background-data-text);
}

.chatbot-message-bot .chatbot-message-icon i {
    color: #333;
}

.chatbot-message-user .chatbot-message-icon {
    background-color: #e8f5e9;
}

.chatbot-message-user .chatbot-message-icon i {
    color: #2e7d32;
}

.chatbot-message-content {
    background-color: var(--background-data-text);
    padding: 12px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    color: var(--text-grey-dark);
}

.chatbot-message-bot .chatbot-message-content {
    border-top-left-radius: 5px;
}

.chatbot-message-user {
    flex-direction: row-reverse;
}

.chatbot-message-user .chatbot-message-icon {
    margin-right: 0;
    margin-left: 10px;
}

.chatbot-message-user .chatbot-message-content {
    background-color: #006699;
    color: white;
    border-top-right-radius: 5px;
}

/* Help Topics */
.chatbot-help-topics {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.chatbot-help-topic {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #006699;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chatbot-help-topic:hover {
    background-color: #005580;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chatbot-help-topic-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.chatbot-help-topic-icon i {
    color: #006699;
    font-size: 14px;
}

.chatbot-help-topic-content p {
    margin: 0;
    font-size: 14px;
    color: white;
    font-weight: 500;
}

/* Input */
.chatbot-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
}

.chatbot-input input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
    outline: none;
}

.chatbot-input input:focus {
    border-color: #006699;
}

.chatbot-input button {
    background-color: var(--background-data-text);
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chatbot-input button:hover {
    background-color: #00557a;
}

/* Loading Animation */
.chatbot-loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.chatbot-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #006699;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chatbot-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.chatbot-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Error Message */
.chatbot-message-bot.error .chatbot-message-content {
    background-color: #ffebee;
    color: #d32f2f;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .chatbot-popup {
        right: 10px;
        bottom: 80px;
        width: calc(100% - 20px);
        max-width: 350px;
    }
    
    .chatbot-button {
        right: 20px;
        bottom: 20px;
    }
}