/* Atlas Chat Widget — diovanefranco.com.br */
.atlas-chat-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    padding: 0.8rem 1.3rem 0.8rem 1rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: system-ui, -apple-system, sans-serif;
    box-shadow: 0 4px 20px rgba(27, 94, 32, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: atlasFloatIn 1s ease 1.5s both;
}
.atlas-chat-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 32px rgba(27, 94, 32, 0.5);
}
.atlas-chat-btn:active {
    transform: translateY(0) scale(0.97);
}
.atlas-chat-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.atlas-chat-btn-text {
    white-space: nowrap;
}

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

/* Chat Window */
.atlas-chat-window {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 400px;
    height: 560px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    z-index: 1000;
    flex-direction: column;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
    animation: atlasChatOpen 0.3s ease;
}
.atlas-chat-window.open {
    display: flex;
}

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

/* Header */
.atlas-chat-header {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.atlas-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.atlas-chat-header-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.atlas-chat-header-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}
.atlas-chat-header-title {
    font-weight: 700;
    font-size: 0.95rem;
}
.atlas-chat-header-subtitle {
    font-size: 0.72rem;
    opacity: 0.8;
}
.atlas-chat-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s;
}
.atlas-chat-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Messages */
.atlas-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f5f6fa;
}
.atlas-chat-msg {
    margin-bottom: 0.8rem;
    max-width: 85%;
    animation: atlasMsgIn 0.2s ease;
}
@keyframes atlasMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.atlas-chat-msg.user {
    margin-left: auto;
}
.atlas-chat-msg.assistant {
    margin-right: auto;
}
.atlas-chat-bubble {
    padding: 0.7rem 1rem;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.55;
}
.atlas-chat-msg.user .atlas-chat-bubble {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.atlas-chat-msg.assistant .atlas-chat-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.atlas-chat-bubble p {
    margin: 0 0 0.5rem;
}
.atlas-chat-bubble p:last-child {
    margin-bottom: 0;
}
.atlas-chat-bubble strong {
    color: #1b5e20;
}

/* Typing indicator */
.atlas-typing {
    display: flex;
    gap: 4px;
    padding: 0.7rem 1rem;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    width: fit-content;
}
.atlas-typing span {
    width: 7px;
    height: 7px;
    background: #999;
    border-radius: 50%;
    animation: atlasTypingDot 1.2s ease infinite;
}
.atlas-typing span:nth-child(2) { animation-delay: 0.2s; }
.atlas-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes atlasTypingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Input area */
.atlas-chat-input-area {
    padding: 0.75rem;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
}
.atlas-chat-input-row {
    display: flex;
    gap: 0.5rem;
}
.atlas-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 80px;
    min-height: 40px;
    line-height: 1.4;
}
.atlas-chat-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46,125,50,0.12);
}
.atlas-chat-input::placeholder {
    color: #aaa;
}
.atlas-chat-send {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.atlas-chat-send:hover {
    transform: scale(1.08);
}
.atlas-chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.atlas-chat-send svg {
    width: 18px;
    height: 18px;
}

/* Footer */
.atlas-chat-footer {
    padding: 0.4rem 0.75rem;
    background: #f9f9f9;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.atlas-chat-footer-link {
    font-size: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #25D366;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    transition: background 0.2s;
}
.atlas-chat-footer-link:hover {
    background: #1da851;
    text-decoration: none;
    color: #fff;
}
.atlas-chat-disclaimer {
    font-size: 0.65rem;
    color: #999;
}

/* Links inside messages */
.atlas-msg-link {
    color: #1b5e20;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(27, 94, 32, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s;
}
.atlas-msg-link:hover {
    color: #2e7d32;
    text-decoration-color: #2e7d32;
}

/* Mobile tooltip bubble */
.atlas-chat-tooltip {
    position: fixed;
    bottom: 4.5rem;
    left: 1.5rem;
    z-index: 997;
    background: #fff;
    color: #333;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: system-ui, -apple-system, sans-serif;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    max-width: 200px;
    line-height: 1.35;
    animation: atlasTooltipIn 0.5s ease;
    pointer-events: none;
}
.atlas-chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.08);
}
@keyframes atlasTooltipIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes atlasTooltipOut {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(8px); }
}

/* Mobile */
@media (max-width: 768px) {
    .atlas-chat-btn-text {
        display: none;
    }
    .atlas-chat-btn {
        padding: 0.9rem;
        border-radius: 50%;
    }
    .atlas-chat-window {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
