/* Sistema de Chat - Estilos */

/* Ícone do Chat - Canto inferior direito */
.chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #153F59;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(21, 63, 89, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
}

.chat-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(21, 63, 89, 0.4);
}

.chat-icon i {
    color: white;
    font-size: 24px;
}

/* Badge de notificação */
.chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #EF4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Indicador de Status Online - Bolinha Verde */
.chat-online-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 12px;
    height: 12px;
    background: #10B981;
    border: 2px solid white;
    border-radius: 50%;
    display: none;
    animation: pulse-green 2s infinite;
    z-index: 1001;
}

.chat-online-indicator.active {
    display: block;
}

@keyframes pulse-green {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Janela do Chat */
.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    border: 1px solid #E5E7EB;
}

.chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cabeçalho do Chat */
.chat-header {
    background: #153F59;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chat-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Lista de Conversas */
.chat-conversations {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.conversation-item {
    padding: 15px 20px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.conversation-item:hover {
    background-color: #F9FAFB;
}

.conversation-item.active {
    background-color: #EEF2FF;
    border-left: 3px solid #4F46E5;
}

.conversation-item.inactive {
    opacity: 0.6;
    background-color: #F8F9FA;
}

.conversation-item.inactive:hover {
    background-color: #F1F3F4;
}

.conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6B7280, #9CA3AF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.conversation-info {
    flex: 1;
}

.conversation-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
    font-size: 14px;
}

.conversation-last-message {
    color: #6B7280;
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.conversation-time {
    color: #9CA3AF;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.inactive-label {
    background-color: #FEF3C7;
    color: #D97706;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
}

/* Área de Mensagens */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #F9FAFB;
    display: none;
}

.chat-messages.active {
    display: block;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.message.received .message-bubble {
    background-color: white;
    color: #374151;
    border-bottom-left-radius: 4px;
}

.message.sent .message-bubble {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 2px;
}

/* Área de Input */
.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #E5E7EB;
    background: white;
    display: none;
}

.chat-input-area.active {
    display: block;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #D1D5DB;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    max-height: 80px;
    min-height: 40px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chat-send-btn {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Estado vazio */
.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #6B7280;
}

.chat-empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #D1D5DB;
}

.chat-empty-state h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.chat-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        bottom: 90px;
        right: 20px;
        left: 20px;
    }
    
    .chat-icon {
        bottom: 15px;
        right: 15px !important;
        width: 55px;
        height: 55px;
    }
    
    .chat-icon i {
        font-size: 22px;
    }
}

/* Scrollbar personalizada */
.chat-conversations::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-conversations::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: #F3F4F6;
}

.chat-conversations::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.chat-conversations::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Estilos para nova conversa */
.new-conversation-form {
    padding: 20px;
    text-align: center;
}

.new-conversation-form h4 {
    color: #153F59;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.new-conversation-form p {
    color: #6B7280;
    margin-bottom: 20px;
    font-size: 14px;
}

.contact-options {
    margin-bottom: 20px;
}

.contact-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: #F8FAFC;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #374151;
    margin-bottom: 10px;
}

.contact-option:hover {
    background: #153F59;
    border-color: #153F59;
    color: white;
    transform: translateY(-2px);
}

.contact-option i {
    font-size: 18px;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: #6B7280;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.btn-back:hover {
    background: #4B5563;
    transform: translateY(-1px);
}

.btn-back i {
    font-size: 12px;
}

/* Botão Nova Conversa */
.btn-new-conversation {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.btn-new-conversation:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

/* Seção de Chamar Suporte */
.support-call-section {
    padding: 20px;
    border-top: 1px solid #E5E7EB;
    background-color: #FAFBFC;
}

.support-divider {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.support-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #E5E7EB;
    z-index: 1;
}

.support-divider span {
    background-color: #FAFBFC;
    padding: 0 15px;
    color: #6B7280;
    font-size: 12px;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.btn-call-support {
    width: 100%;
    background: linear-gradient(135deg, #059669, #10B981);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-call-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(5, 150, 105, 0.3);
    background: linear-gradient(135deg, #047857, #059669);
}
