/* Chatbot Component Styles */
.chatbot-float {
    width: 49px;
    height: 49px;
    background-color: #366B2A;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    text-decoration: none;
    z-index: 1000;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(54, 107, 42, 0.4);
    position: relative;
    overflow: visible;
}

.chatbot-float .notification-badge {
    position: absolute;
    top: -9px;
    right: -8px;
    background: #E43636;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
    z-index: 1001;
}

@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes glow-badge {
    0% { box-shadow: 0 0 5px rgba(228, 54, 54, 0.5); }
    50% { box-shadow: 0 0 15px rgba(228, 54, 54, 0.8), 0 0 25px rgba(228, 54, 54, 0.4); }
    100% { box-shadow: 0 0 5px rgba(228, 54, 54, 0.5); }
}

.chatbot-float .notification-badge.opened {
    animation: glow-badge 3s infinite;
}

.chatbot-float.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.chatbot-float:hover {
    transform: scale(1.1);
    background-color: #2d5a23;
    color: #fff;
    box-shadow: 0 6px 20px rgba(54, 107, 42, 0.6);
}

.floating-dots {
    display: flex;
    gap: 3px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.floating-dots .dot {
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.floating-dots .dot1 {
    animation-delay: 0s;
}

.floating-dots .dot2 {
    animation-delay: 0.2s;
}

.floating-dots .dot3 {
    animation-delay: 0.4s;
}

.chatbot-float>i {
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chatbot-float.loaded .floating-dots {
    opacity: 0;
}

.chatbot-float.loaded>i {
    opacity: 1;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.chatbot-window {
    position: fixed !important;
    bottom: 100px !important;
    right: 85px !important;
    top: auto !important;
    left: auto !important;
    width: 368px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: scale(1);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chatbot-window.closing {
    transform: scale(0.8);
    opacity: 0;
}

.chatbot-header {
    background: #063232;
    color: white;
    padding: 15px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    border-radius: 15px 15px 0 0;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 16px;
    color: white;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 300px;
}

.chatbot-messages::-webkit-scrollbar {
    display: none;
}

.chatbot-messages::after {
    content: '';
    display: block;
    clear: both;
    height: 0;
}

.message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    clear: both;
    white-space: pre-line;
}

.message.user {
    background: #366B2A;
    color: white;
    float: right;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.message.bot {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    float: left;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.bot.welcome-message {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    color: #495057;
}

.message.bot.welcome-message strong {
    color: #366B2A;
    font-weight: 600;
}

.chatbot-input {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 22px;
    padding: 10px 16px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

.chatbot-input input:focus {
    border-color: #366B2A;
    box-shadow: 0 0 0 2px rgba(54, 107, 42, 0.1);
}

.chatbot-input input::placeholder {
    color: #999;
    font-style: italic;
}

.chatbot-input button {
    background: #f7941d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    font-size: 16px;
}

.chatbot-input button:hover {
    background: #e6850a;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    float: left;
    max-width: 85%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .chatbot-window {
        width: 320px;
        height: 450px;
        right: 15px;
        bottom: 120px;
    }
}