
#chat_widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100020;
    font-family: 'Poppins', Arial, sans-serif;
}

#chat_button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #019DEA, #0066CC);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(1, 157, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1);
}

#chat_button.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

#chat_button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(1, 157, 234, 0.6);
    background: linear-gradient(135deg, #0066CC, #019DEA);
}

#chat_button svg {
    width: 28px;
    height: 28px;
}

#chat_button::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: #00ff00;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

#chat_window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    height: 450px;
    background: #0A1F3A;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(1, 157, 234, 0.3);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#chat_window.show {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

#chat_window.hide {
    animation: slideDown 0.3s ease-out forwards;
}

#chat_header {
    background: linear-gradient(135deg, #019DEA, #0066CC);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

#chat_header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

#chat_avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: white;
    padding: 2px;
}

#chat_info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

#chat_status {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}

#chat_status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

#chat_close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#chat_close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#chat_messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #0A1F3A;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(1, 157, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(1, 157, 234, 0.05) 0%, transparent 50%);
}

.chat_message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.chat_message.support {
    background: linear-gradient(135deg, rgba(1, 157, 234, 0.1), rgba(0, 102, 204, 0.1));
    border: 1px solid rgba(1, 157, 234, 0.3);
    color: #E5F0FF;
    border-radius: 12px 12px 12px 4px;
}

.chat_message.user {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    margin-left: 20px;
    border-radius: 12px 12px 4px 12px;
}

#chat_input_area {
    padding: 20px;
    border-top: 1px solid rgba(1, 157, 234, 0.3);
    background: #0A1F3A;
}

#chat_input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(1, 157, 234, 0.3);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    resize: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

#chat_input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#chat_input:focus {
    border-color: #019DEA;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(1, 157, 234, 0.2);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

#chat_window.show {
    display: flex;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#chat_messages::-webkit-scrollbar {
    width: 6px;
}

#chat_messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#chat_messages::-webkit-scrollbar-thumb {
    background: rgba(1, 157, 234, 0.5);
    border-radius: 3px;
}

#chat_messages::-webkit-scrollbar-thumb:hover {
    background: rgba(1, 157, 234, 0.7);
}

@media (max-width: 480px) {
    #chat_window {
        width: 300px;
        height: 400px;
    }

    #chat_widget {
        bottom: 15px;
        right: 15px;
    }

    #chat_button {
        width: 55px;
        height: 55px;
    }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, rgba(1, 157, 234, 0.1), rgba(0, 102, 204, 0.1));
    border: 1px solid rgba(1, 157, 234, 0.3);
    border-radius: 12px 12px 12px 4px;
    color: #E5F0FF;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #019DEA;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}