.chat-ia-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 9999;
    font-family: Arial, Helvetica, sans-serif;
}

.chat-ia-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

@keyframes chat-ia-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes chat-ia-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.chat-ia-teaser {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 8px;
    clip-path: inset(0 0 0 100%);
    opacity: 0;
    transition: clip-path 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.chat-ia-teaser.visible {
    clip-path: inset(0 0 0 0%);
    opacity: 1;
}

.chat-ia-teaser-bg {
    display: block;
    width: 172px;
    height: 46px;
}

.chat-ia-teaser-txt {
    position: absolute;
    max-width: 80%;
    height: auto;
}

.chat-ia-btn {
    width: 46px;
    height: 46px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    animation: chat-ia-pulse 2.5s ease-in-out infinite;
}

.chat-ia-btn:hover {
    animation: none;
    transform: scale(1.12);
}

.chat-ia-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-ia-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.chat-ia-btn.hidden {
    display: none;
}

.chat-ia-window {
    position: absolute;
    bottom: 50px;
    right: 0;
    width: 355px;
    max-width: calc(100vw - 40px);
    height: 460px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
}

.chat-ia-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: all 0.3s ease; 
}

.chat-ia-header {
    background: #03152C;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-ia-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-ia-header-icon {
    width: 36px;
    height: 36px;
    background: #03152C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-ia-header-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.chat-ia-header-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1.18);
}

.chat-ia-header-title {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chat-ia-header-subtitle {
    color: #FFFFFF;
    font-size: 11px;
    opacity: 0.8;
    margin: 0;
}

.chat-ia-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-ia-close:hover {
    opacity: 1;
}

.chat-ia-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.chat-ia-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
}

.chat-ia-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}

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

.chat-ia-message.ia {
    align-self: flex-start;
}

.chat-ia-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-ia-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-ia-message.ia .chat-ia-message-avatar {
    background: #03152C;
}

.chat-ia-message.user .chat-ia-message-avatar {
    background: #6c757d;
}

.chat-ia-message-avatar svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.chat-ia-message-avatar {
    overflow: hidden;
}

.chat-ia-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1.18);
}

.chat-ia-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-ia-message.ia .chat-ia-message-content {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-ia-message.user .chat-ia-message-content {
    background: #03152C;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-ia-typing {
    display: flex;
    gap: 10px;
    align-self: flex-start;
    max-width: 85%;
}

.chat-ia-typing .chat-ia-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #03152C;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-ia-typing .chat-ia-message-avatar svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.chat-ia-typing-dots {
    background: #fff;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-ia-typing-dots span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

.chat-ia-typing-text {
    font-size: 12px;
    color: #667eea;
    font-style: italic;
}

.chat-ia-busca-badge {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #667eea;
    opacity: 0.8;
}

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

.chat-ia-input-area {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-ia-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-ia-input:focus {
    border-color: #667eea;
}

.chat-ia-input::placeholder {
    color: #aaa;
}

.chat-ia-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #03152C;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.chat-ia-send:hover {
    transform: scale(1.05);
}

.chat-ia-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-ia-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    margin-left: 2px;
}

.chat-ia-char-count {
    font-size: 11px;
    color: #999;
    text-align: right;
    padding: 0 15px 5px;
    background: #fff;
}

.chat-ia-char-count.warning {
    color: #e74c3c;
}

@media (max-width: 768px) {
    .chat-ia-container {
        bottom: 70px;
        right: 15px;
    }
    
    .chat-ia-window {
        position: fixed;
        width: calc(100vw - 80px);
        max-width: 300px;
        height: 50vh;
        max-height: 340px;
        bottom: 50px;
        right: 15px;
        left: auto;
        border-radius: 16px;
    }
    
    .chat-ia-header {
        padding: 12px 15px;
    }
    
    .chat-ia-header-title {
        font-size: 15px;
    }
    
    .chat-ia-header-subtitle {
        font-size: 10px;
    }
    
    .chat-ia-messages {
        padding: 15px;
        gap: 12px;
    }
    
    .chat-ia-message-content {
        padding: 10px 14px;
        font-size: 14px;
        max-width: 85%;
    }
    
    .chat-ia-input-container {
        padding: 10px;
    }
    
    .chat-ia-input {
        padding: 12px 14px;
        font-size: 16px; 
    }
    
    .chat-ia-send {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .chat-ia-container {
        bottom: 80px;
        right: 10px;
    }
    
    .chat-ia-window {
        width: calc(100vw - 60px);
        max-width: 280px;
        height: 60vh;
        max-height: 380px;
        bottom: 50px;
        right: 10px;
        left: auto;
        border-radius: 12px;
    }
    
    .chat-ia-btn {
        width: 40px;
        height: 40px;
    }
    
    .chat-ia-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .chat-ia-header {
        padding: 10px 12px;
    }
    
    .chat-ia-header-icon {
        width: 32px;
        height: 32px;
    }
    
    .chat-ia-header-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .chat-ia-header-title {
        font-size: 14px;
    }
    
    .chat-ia-messages {
        padding: 12px;
        gap: 10px;
    }
    
    .chat-ia-message-content {
        padding: 10px 12px;
        font-size: 14px;
        max-width: 88%;
        line-height: 1.4;
    }
    
    .chat-ia-input-container {
        padding: 8px;
    }
    
    .chat-ia-input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .chat-ia-send {
        width: 40px;
        height: 40px;
    }
    
    .chat-ia-send svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 360px) {
    .chat-ia-window {
        width: calc(100vw - 40px);
        max-width: 260px;
        height: 60vh;
        max-height: 360px;
        bottom: 50px;
        right: 8px;
        left: auto;
    }
    
    .chat-ia-container {
        bottom: 75px;
        right: 8px;
    }
    
    .chat-ia-btn {
        width: 40px;
        height: 40px;
    }
}

/* .chat-ia-container.initialized .chat-ia-window {
    animation: bounceIn 0.5s ease;
} */

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    50% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
