/* CRM Styles */

/* Dashboard Cards */
.card-estatistica {
    transition: transform 0.2s;
}

.card-estatistica:hover {
    transform: translateY(-2px);
}

/* Chat Styles */
.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #e5ddd5;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23e5ddd5"/><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></svg>');
}

.message-wrapper {
    margin-bottom: 0.5rem;
    display: flex;
    width: 100%;
}

.message-wrapper.message-sent {
    justify-content: flex-end;
}

.message-wrapper.message-received {
    justify-content: flex-start;
}

.message-group {
    margin-bottom: 0.5rem;
    display: flex;
    width: 100%;
}

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

/* Mensagens enviadas - à direita */
.message-bubble.sent,
.message-bubble.enviada {
    background-color: #dcf8c6;
    color: #333;
    border-radius: 8px 8px 2px 8px;
    margin-left: 20px;
}

/* Mensagens recebidas - à esquerda */
.message-bubble.received,
.message-bubble.recebida {
    background-color: #ffffff;
    color: #333;
    border-radius: 8px 8px 8px 2px;
    margin-right: 20px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    display: block;
    text-align: right;
    margin-top: 4px;
    color: #666;
}

.message-bubble.sent .message-time,
.message-bubble.enviada .message-time {
    color: #4a4a4a;
}

.message-bubble.received .message-time,
.message-bubble.recebida .message-time {
    color: #999;
}

/* Indicadores de mensagem */
.message-sender {
    margin-bottom: 4px;
}

.message-sender small {
    font-size: 10px;
    font-weight: 600;
}

.message-footer {
    margin-top: 6px;
    flex-wrap: nowrap;
}

.message-type {
    font-size: 9px;
    padding: 2px 6px;
    margin-right: 8px;
}

.message-bubble.sent .message-sender small,
.message-bubble.enviada .message-sender small {
    color: #2d5016;
}

.message-bubble.received .message-sender small,
.message-bubble.recebida .message-sender small {
    color: #0066cc;
}

/* Chat Input */
.chat-input {
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #e9ecef;
}

.chat-input-group {
    display: flex;
    gap: 0.5rem;
}

.chat-input-field {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    resize: vertical;
    border-radius: 1.25rem;
    padding: 0.75rem 1rem;
}

.chat-send-btn {
    align-self: flex-end;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Leads List */
.lead-item {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
}

.lead-item:hover {
    background-color: #f8f9fa;
}

.lead-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid #007bff;
}

.lead-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.lead-info {
    flex: 1;
    margin-left: 0.75rem;
}

.lead-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.lead-phone {
    color: #6c757d;
    font-size: 0.875rem;
}

.lead-status {
    margin-top: 0.5rem;
}

.lead-temperature {
    margin-left: 0.5rem;
}

/* Status Badges */
.badge-status-novo {
    background-color: #17a2b8;
}

.badge-status-quente {
    background-color: #28a745;
}

.badge-status-frio {
    background-color: #6c757d;
}

.badge-status-negociacao {
    background-color: #ffc107;
    color: #212529;
}

.badge-status-convertido {
    background-color: #007bff;
}

/* Temperature Icons */
.temperature-quente {
    color: #dc3545;
}

.temperature-morno {
    color: #ffc107;
}

.temperature-frio {
    color: #17a2b8;
}

/* Responsive */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
    }
    
    .chat-container {
        height: 400px;
    }
    
    .lead-item {
        padding: 0.75rem;
    }
}

/* Loading States */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.action-buttons .btn {
    padding: 0.375rem 0.5rem;
}

/* Charts */
.chart-container {
    height: 300px;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}

/* Modal Improvements */
.modal-header .modal-title {
    display: flex;
    align-items: center;
}

.modal-header .modal-title i {
    margin-right: 0.5rem;
}

/* Form Styles */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar,
.card-body::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb,
.card-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.card-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
