/**
 * Chat Widget Styles
 * Portugal Pelo Mundo
 */

/* Botão Flutuante */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #F04F00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(240, 79, 0, 0.4);
    transition: all 0.3s;
    z-index: 9998;
    color: white;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(240, 79, 0, 0.5);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Janela de Chat */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

.chat-widget.open {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

/* Header do Chat */
.chat-header {
    background: linear-gradient(135deg, #F04F00 0%, #d44400 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    padding: 3px;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.chat-close-btn:hover {
    opacity: 0.8;
}

/* Mensagens */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.chat-message.admin {
    align-items: flex-start;
}

.chat-message.visitor {
    align-items: flex-end;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chat-message.admin .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-message.visitor .message-bubble {
    background: #F04F00;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-sender {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    padding: 0 8px;
    font-weight: 500;
}

.message-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    padding: 0 8px;
}

/* Input de Mensagem */
.chat-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
}

.chat-input:focus {
    outline: none;
    border-color: #F04F00;
}

.chat-send-btn {
    background: #F04F00;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #d44400;
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar personalizada */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #F04F00;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #d44400;
}

/* Responsivo */
@media (max-width: 768px) {
    .chat-widget {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 80px;
    }
    
    .chat-toggle-btn {
        right: 20px;
        bottom: 20px;
    }
}
