/* Glassmorphism Chat Widget */
#winweb-ia-agent-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 100px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 999999;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transform-origin: bottom right;
}

#winweb-ia-agent-container {
    transition: all 0.3s ease; /* Efeito suave ao abrir */
    display: none; /* Começa escondido */
    flex-direction: column;
}

#winweb-ia-agent-container.winweb-chat-visible {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

.winweb-chat-hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateY(20px);
}

/* Header */
.winweb-chat-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.9), rgba(114, 137, 218, 0.9));
    color: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.winweb-chat-title {
    font-size: 16px;
}

#winweb-ia-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#winweb-ia-close-btn:hover {
    opacity: 1;
}

/* Messages Area */
.winweb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.winweb-chat-message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in-out;
}

.winweb-chat-message p {
    margin: 0 0 8px 0;
}
.winweb-chat-message p:last-child {
    margin: 0;
}

.winweb-bot-message {
    background: rgba(240, 242, 245, 0.9);
    color: #1c1e21;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.winweb-user-message {
    background: linear-gradient(135deg, #5865F2, #7289DA);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(88, 101, 242, 0.2);
}

/* Input Area */
.winweb-chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 20px 20px;
}

#winweb-ia-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: rgba(255, 255, 255, 0.9);
}

#winweb-ia-input:focus {
    border-color: #5865F2;
}

#winweb-ia-send-btn {
    background: #5865F2;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 10px rgba(88, 101, 242, 0.3);
}

#winweb-ia-send-btn:hover {
    background: #4752c4;
    transform: scale(1.05);
}

/* WhatsApp Button */
#winweb-ia-whatsapp-container {
    padding: 10px 15px 15px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 20px 20px;
}

.winweb-whatsapp-btn {
    display: inline-block;
    background: #25D366;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.winweb-whatsapp-btn:hover {
    background: #1ebc5a;
    color: white;
}

/* Trigger Button */
#winweb-ia-trigger-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865F2, #7289DA);
    color: white;
    border: none;
    z-index: 999998;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#winweb-ia-trigger-btn:hover {
    transform: scale(1.1);
}

/* Typing Indicator */
.winweb-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
}

.winweb-typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: #90949c;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

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

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

/* Markdown specific styles */
.winweb-bot-message a {
    color: #5865F2;
    text-decoration: underline;
}
.winweb-bot-message strong {
    font-weight: 600;
}
.winweb-checkout-btn {
    display: block;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%); /* Dourado místico */
    color: #fff !important;
    text-align: center;
    padding: 15px 20px;
    border-radius: 10px;
    text-decoration: none !important;
    font-weight: bold;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.4);
    transition: transform 0.2s;
    animation: pulse 2s infinite;
}

.winweb-checkout-btn:hover {
    transform: scale(1.05);
    background: #d4af37;
}

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