/**
 * Estilos do Widget WhatsApp - Art Design Alphaville
 * Arquivo: css/style-whatsapp.css
 */

/* Container principal */
#whatsapp-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: 'Open Sans', Verdana, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Botão flutuante */
.ww-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: ww-pulse 2s infinite;
    position: relative;
    transition: all 0.3s ease;
}

.ww-button:hover {
    background: #128C7E;
    transform: scale(1.05);
}

.ww-button-active {
    animation: none !important;
}

.ww-button-icon {
    width: 35px;
    height: 35px;
    animation: ww-wiggle 1s ease-in-out infinite;
}

.ww-button-active .ww-button-icon {
    animation: none;
}

/* Ticker (mensagens rotativas) */
.ww-ticker {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    color: #333;
    padding: 10px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    font-family: 'Open Sans', sans-serif;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.ww-ticker::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    margin-top: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent transparent #fff;
}

.ww-ticker-fade {
    opacity: 0;
}

/* Caixa de chat - AJUSTADA */
.ww-chat-box {
    position: absolute;
    bottom: 48px;
    right: 0;
    width: 300px;
    height: 290px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.95);
    transition: all 0.3s ease;
}

.ww-chat-box.ww-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header do chat - AJUSTADO */
.ww-header {
    background: linear-gradient(135deg, #25d366 0%, #128C7E 100%);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
}

.ww-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.ww-header-info {
    flex: 1;
}

.ww-header-name {
    font-weight: 600;
    font-size: 14px;
    font-family: Verdana, sans-serif;
}

.ww-header-role {
    font-size: 11px;
    font-family: 'Open Sans', sans-serif;
    opacity: 0.9;
}

.ww-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 4px;
}

.ww-close:hover {
    opacity: 1;
}

/* Área de mensagens - AJUSTADA */
.ww-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #e5ddd5 url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}

/* Mensagem - AJUSTADA */
.ww-message {
    max-width: 90%;
    animation: ww-message-appear 0.3s ease;
}

.ww-message-bot {
    align-self: flex-start;
}

.ww-message-user {
    align-self: flex-end;
}

.ww-message-content {
    background: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    border-top-left-radius: 0;
    font-size: 13px;
    font-family: 'Open Sans', sans-serif;
    line-height: 1.4;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ww-message-user .ww-message-content {
    background: #dcf8c6;
    border-top-left-radius: 8px;
    border-top-right-radius: 0;
}

.ww-message-time {
    font-size: 10px;
    font-family: 'Open Sans', sans-serif;
    color: #999;
    margin-top: 3px;
}

/* Typing indicator (3 pontinhos) */
.ww-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border-top-left-radius: 0;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ww-typing-dot {
    width: 7px;
    height: 7px;
    background: #999;
    border-radius: 50%;
    animation: ww-typing-blink 1.4s infinite both;
}

.ww-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ww-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Footer com botão de transbordo - AJUSTADO */
.ww-footer {
    padding: 10px 12px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.ww-transbordo-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: #25d366;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    font-family: Verdana, sans-serif;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.ww-transbordo-btn:hover {
    background: #128C7E;
    transform: scale(1.02);
}

/* Animações */
@keyframes ww-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@keyframes ww-wiggle {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

@keyframes ww-typing-blink {
    0% {
        opacity: 0.2;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}

@keyframes ww-message-appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsivo */
@media (max-width: 480px) {
    #whatsapp-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .ww-chat-box {
        width: calc(100vw - 30px);
        max-width: 300px;
        height: 280px;
        right: 0;
        bottom: 45px;
    }
    
    .ww-ticker {
        display: none;
    }
    
    .ww-button {
        width: 55px;
        height: 55px;
    }
    
    .ww-button-icon {
        width: 30px;
        height: 30px;
    }
}