@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,600;1,500&display=swap');

#silvia-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: 'Montserrat', sans-serif;
}

/* ================== BOTÃO FLUTUANTE COM PULSO PREMIUM ================== */
#silvia-chat-launcher {
    background-color: #651715;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(230, 225, 220, 0.2);
    position: relative; 
    animation: silviaPremiumPulse 2s infinite;
}

#silvia-chat-launcher:hover {
    transform: scale(1.08) translateY(-5px);
    animation-play-state: paused; 
    box-shadow: 0 15px 35px rgba(101, 23, 21, 0.5);
}

/* CORREÇÃO DO ÍCONE: Removido o filtro branco para a logo aparecer real */
#silvia-chat-launcher img {
    width: 35px; /* Tamanho ajustado para ficar bem visível */
    height: auto;
    object-fit: contain;
}

/* ================== KEYFRAMES DO PULSO ================== */
@keyframes silviaPremiumPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(101, 23, 21, 0.6), 
                    0 10px 30px rgba(101, 23, 21, 0.3);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(101, 23, 21, 0), 
                    0 10px 30px rgba(101, 23, 21, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(101, 23, 21, 0), 
                    0 10px 30px rgba(101, 23, 21, 0.3);
    }
}

/* ================== JANELA DO CHAT (AJUSTADA) ================== */
#silvia-chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 340px; /* Reduzido de 380px para ficar mais delicado */
    height: 520px; /* Reduzido de 600px para não cobrir tanto a tela */
    background-color: #f7f5f2;
    border-radius: 20px; /* Bordas levemente mais suaves */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(101, 23, 21, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: silviaFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ================== CABEÇALHO ================== */
#silvia-chat-header {
    background-color: #651715;
    color: #E6E1DC;
    padding: 20px 20px; /* Um pouco mais enxuto para a nova proporção */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.silvia-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.silvia-logo-small {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #E6E1DC;
    padding: 6px;
    border: 2px solid rgba(255,255,255,0.1);
}

.silvia-header-text {
    display: flex;
    flex-direction: column;
}

.silvia-name {
    font-family: 'Playfair Display', Georgia, serif; 
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.silvia-status {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.silvia-status::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: #4CAF50;
    border-radius: 50%;
}

#silvia-chat-close {
    background: none;
    border: none;
    color: rgba(230, 225, 220, 0.6);
    font-size: 26px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    margin-top: -10px;
}

#silvia-chat-close:hover {
    color: #fff;
}

/* ================== CORPO DO CHAT ================== */
#silvia-chat-body {
    flex: 1;
    padding: 25px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-image: linear-gradient(to bottom, #E6E1DC 0%, #f7f5f2 100%);
}

#silvia-chat-body::-webkit-scrollbar {
    width: 5px;
}
#silvia-chat-body::-webkit-scrollbar-track {
    background: transparent;
}
#silvia-chat-body::-webkit-scrollbar-thumb {
    background: rgba(101, 23, 21, 0.2);
    border-radius: 10px;
}

/* ================== MENSAGENS ================== */
.silvia-msg {
    padding: 14px 18px;
    max-width: 85%;
    font-size: 0.9rem; /* Fonte um pingo menor para caber melhor na nova largura */
    line-height: 1.5;
    font-weight: 400;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    animation: msgFadeIn 0.3s ease forwards;
}

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

.ia-msg {
    background-color: #ffffff;
    color: #444;
    align-self: flex-start;
    border-radius: 4px 18px 18px 18px; 
    border: 1px solid rgba(101, 23, 21, 0.04);
}

.user-msg {
    background-color: #651715;
    color: #E6E1DC;
    align-self: flex-end;
    border-radius: 18px 18px 4px 18px; 
}

/* ================== RODAPÉ / INPUT ================== */
#silvia-chat-footer {
    padding: 15px 20px;
    background-color: #ffffff;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid rgba(0,0,0,0.04);
}

#silvia-user-input {
    flex: 1;
    border: 1px solid #eaeaea;
    background-color: #fcfcfc;
    border-radius: 30px;
    padding: 12px 18px;
    outline: none;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#silvia-user-input:focus {
    border-color: rgba(101, 23, 21, 0.3);
    box-shadow: 0 0 0 4px rgba(101, 23, 21, 0.05);
    background-color: #fff;
}

#silvia-user-input::placeholder {
    color: #aaa;
}

#silvia-send-btn {
    background-color: #651715;
    color: #E6E1DC;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
}

#silvia-send-btn:hover {
    background-color: #4a100f;
    transform: scale(1.05);
}

#silvia-send-btn svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

.silvia-typing {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin-left: 5px;
    align-self: flex-start;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Responsividade Básica */
@media (max-width: 480px) {
    #silvia-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        max-height: 520px;
        bottom: 80px;
        right: 20px;
    }
}