/* Chatbot Widget Styles for WCL Informática */

:root {
    --chat-bg-dark: #02050f;
    --chat-bubble-size: 60px;
    --chat-window-width: 380px;
    --chat-window-height: 520px;
}

/* Chatbot Floating Bubble Button */
.chatbot-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: var(--chat-bubble-size);
    height: var(--chat-bubble-size);
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4), 0 0 10px rgba(138, 43, 226, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: bubblePulse 2s infinite alternate;
}

.chatbot-bubble i {
    color: var(--text-white);
    font-size: 24px;
    transition: transform 0.3s ease;
}

.chatbot-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.6), 0 0 15px rgba(138, 43, 226, 0.5);
}

.chatbot-bubble.active i {
    transform: rotate(90deg);
}

/* Chat Window Container */
.chatbot-window {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: var(--chat-window-width);
    height: var(--chat-window-height);
    max-width: calc(100vw - 60px);
    max-height: calc(100vh - 150px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 210, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chat Header */
.chatbot-header {
    background: var(--chat-bg-dark);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.chatbot-info-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar-container {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.chatbot-avatar-container i {
    color: var(--color-primary);
    font-size: 16px;
}

.chatbot-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 9px;
    height: 9px;
    background: #00ff66;
    border-radius: 50%;
    border: 2px solid var(--chat-bg-dark);
    box-shadow: 0 0 6px #00ff66;
}

.chatbot-title h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
    margin: 0;
}

.chatbot-title span {
    font-size: 10px;
    color: var(--text-gray);
    display: block;
}

.chatbot-close-btn {
    color: var(--text-gray);
    font-size: 18px;
    transition: var(--transition-smooth);
}

.chatbot-close-btn:hover {
    color: var(--color-pink);
}

/* Chat Messages Content Area */
.chatbot-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

/* Scrollbar customization */
.chatbot-body::-webkit-scrollbar {
    width: 5px;
}
.chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
.chatbot-body::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Message Styles */
.chatbot-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    margin-bottom: 2px;
}

.chatbot-msg.bot {
    align-self: flex-start;
}

.chatbot-msg.user {
    align-self: flex-end;
}

.chatbot-msg-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.5;
}

.chatbot-msg.bot .chatbot-msg-bubble {
    background: var(--bg-card-hover);
    color: var(--text-white);
    border-bottom-left-radius: 3px;
    border: 1px solid var(--border-color);
}

.chatbot-msg.user .chatbot-msg-bubble {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0088cc 100%);
    color: var(--text-white);
    border-bottom-right-radius: 3px;
    box-shadow: 0 3px 10px rgba(0, 210, 255, 0.15);
}

.chatbot-msg-time {
    font-size: 9px;
    color: var(--text-gray);
    margin-top: 4px;
    margin-left: 4px;
}

.chatbot-msg.user .chatbot-msg-time {
    align-self: flex-end;
    margin-right: 4px;
    margin-left: 0;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card-hover);
    border-radius: 14px;
    border-bottom-left-radius: 3px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    background: var(--text-gray);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.chatbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing span:nth-child(2) { animation-delay: -0.16s; }

/* Quick Replies Quick Actions Container */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    width: 100%;
}

.quick-reply-btn {
    background: rgba(0, 210, 255, 0.05);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--color-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.quick-reply-btn:hover {
    background: var(--color-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
    border-color: var(--color-primary);
}

/* Support Email Form inside Chat */
.chatbot-email-form {
    background: rgba(4, 8, 20, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.chatbot-email-form h4 {
    font-family: var(--font-heading);
    font-size: 12.5px;
    color: var(--color-primary);
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-email-form .form-control {
    font-size: 12px;
    padding: 8px 10px;
    background: rgba(2, 5, 15, 0.8);
}

.chatbot-email-form textarea.form-control {
    resize: none;
    height: 70px;
}

.chatbot-email-form .btn-submit-email {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--text-white);
    font-weight: 700;
    font-size: 11px;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    text-align: center;
    transition: var(--transition-smooth);
}

.chatbot-email-form .btn-submit-email:hover {
    box-shadow: var(--shadow-neon-blue);
    transform: translateY(-1px);
}

/* Chat Input Bar */
.chatbot-footer {
    background: var(--chat-bg-dark);
    padding: 12px 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-input {
    flex-grow: 1;
    background: rgba(4, 8, 20, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-white);
    font-size: 12.5px;
    outline: none;
    transition: var(--transition-smooth);
}

.chatbot-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.1);
}

.chatbot-send-btn {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--color-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    transition: var(--transition-smooth);
}

.chatbot-send-btn:hover {
    background: var(--color-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

/* Rating Buttons */
.chatbot-rating-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 15px 0;
}

.rating-star-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.rating-star-btn i {
    color: var(--text-gray);
    font-size: 18px;
    transition: var(--transition-smooth);
}

.rating-star-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    transform: scale(1.1);
}

.rating-star-btn:hover i {
    color: #ffd700;
}

/* Animations */
@keyframes bubblePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.04); }
}

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

@keyframes bubblePop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Media Query for mobile chat adjustment */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
    .chatbot-bubble {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    .chatbot-bubble i {
        font-size: 24px;
    }
}

/* Media Query for tablets and larger mobile devices */
@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-window {
        width: 90%;
        max-width: 90%;
        right: 5%;
    }
}
