/* CRM Imobiliário Specific Styles */

/* CRM Header Section */
.crm-header-section {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.crm-header-section h4 {
  color: #2c3e50;
  font-weight: 600;
}

/* Kanban Board Styles */
.kanban-section {
  background-color: #f8f9fa;
  min-height: calc(100vh - 300px);
}

.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1rem;
}

.kanban-column {
  min-width: 280px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 70vh;
  flex-shrink: 0;
}

/* Kanban Headers with specific colors */
.kanban-header {
  padding: 1rem 1.25rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: between;
  align-items: center;
  font-weight: 600;
  color: white;
}

.kanban-header h6 {
  color: white;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.kanban-header .badge {
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
}

/* Column-specific header colors */
.simulacao-header {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.analise-credito-header {
  background: linear-gradient(135deg, #17a2b8, #138496);
}

.analisando-header {
  background: linear-gradient(135deg, #8e44ad, #7d3c98);
}

.reprovado-header {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.credito-aprovado-header {
  background: linear-gradient(135deg, #20c997, #17a589);
}

.vistoria-header {
  background: linear-gradient(135deg, #f39c12, #e67e22);
}

.analise-juridica-header {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.liberacao-fgts-header {
  background: linear-gradient(135deg, #e67e22, #d35400);
}

.emissao-minuta-header {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.minuta-assinada-header {
  background: linear-gradient(135deg, #28a745, #20c997);
}

/* Kanban Body */
.kanban-body {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

/* Lead Cards */
.lead-card {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #28a745;
}

.lead-info {
  margin-bottom: 0.75rem;
}

.lead-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.lead-detail {
  font-size: 0.85rem;
  color: #6c757d;
  margin: 0;
}

.lead-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #28a745;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 2px rgba(40, 167, 69, 0.1);
  padding: 0.25rem 0;
}

.lead-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lead-meta small {
  font-size: 0.75rem;
  color: #6c757d;
  display: flex;
  align-items: center;
}

.lead-meta i {
  width: 12px;
  font-size: 10px;
}

/* Drag and Drop Styles */
.lead-card.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.kanban-column.drag-over {
  background-color: #e8f5e8;
}

.kanban-column.drag-over .kanban-body {
  border: 2px dashed #28a745;
  border-radius: 8px;
}

/* Empty State */
.kanban-body:empty::after {
  content: "Arraste leads aqui";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: #6c757d;
  font-size: 0.875rem;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  background-color: #f8f9fa;
}

/* Lead Card Actions */
.lead-actions {
  display: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  gap: 0.25rem;
}

.lead-card:hover .lead-actions {
  display: flex;
}

.lead-action-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.1);
  color: #6c757d;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lead-action-btn:hover {
  background-color: #28a745;
  color: white;
}

/* Toggle buttons styling */
.btn-outline-secondary.active {
  background-color: #28a745;
  border-color: #28a745;
  color: white;
}

.btn-outline-secondary.active:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

/* Charts section styling */
.charts-section .card {
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.charts-section .card-header {
  border-bottom: 1px solid #f1f3f4;
  padding: 1.5rem 2rem;
  background-color: #ffffff;
  border-radius: 12px 12px 0 0;
}

.charts-section .card-body {
  padding: 2rem;
}

.charts-section .card-header h6 {
  color: #2c3e50;
  font-weight: 600;
  font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .kanban-board {
    flex-direction: column;
    gap: 1rem;
  }

  .kanban-column {
    min-width: 100%;
    max-height: none;
  }

  .crm-header-section .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .crm-header-section .d-flex .d-flex {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
  }
}

/* Animation for new leads */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lead-card.new-lead {
  animation: slideInFromTop 0.5s ease-out;
}

/* Status indicators */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}

.status-lead {
  background-color: #3498db;
}
.status-contrato {
  background-color: #17a2b8;
}
.status-negociacao {
  background-color: #8e44ad;
}
.status-proposta {
  background-color: #f39c12;
}
.status-ganho {
  background-color: #28a745;
}
.status-perdido {
  background-color: #dc3545;
}

/* Pipeline metrics */
.pipeline-metrics {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-item {
  text-align: center;
  flex: 1;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
}

.metric-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Lead priority indicators */
.priority-high {
  border-left: 4px solid #dc3545;
}

.priority-medium {
  border-left: 4px solid #f39c12;
}

.priority-low {
  border-left: 4px solid #28a745;
}

/* Custom scrollbar for kanban board (horizontal) */
.kanban-board::-webkit-scrollbar {
  height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Custom scrollbar for kanban columns (vertical) */
.kanban-body::-webkit-scrollbar {
  width: 6px;
}

.kanban-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.kanban-body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.kanban-body::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Loading state */
.kanban-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: #6c757d;
}

.kanban-loading::after {
  content: "";
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #28a745;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Modal Styles */
.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 1px solid #f1f3f4;
  background-color: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.modal-title {
  color: #2c3e50;
  font-weight: 600;
}

.modal-body {
  padding: 2rem;
}

.modal-body .form-label {
  color: #495057;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.modal-body .form-control-plaintext {
  font-size: 0.9rem;
  color: #212529;
  background-color: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
}

.modal-body .alert {
  border-radius: 8px;
  font-size: 0.9rem;
}

.modal-footer {
  border-top: 1px solid #f1f3f4;
  background-color: #f8f9fa;
  border-radius: 0 0 12px 12px;
}

/* Lead type indicators in modal */
.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

.alert-warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.alert-secondary {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
}

/* Toast Notification */
.toast {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border: 1px solid #e0e0e0;
  min-width: 350px;
}

.toast-body {
  padding: 1.25rem;
}

.toast-icon {
  font-size: 1.5rem;
}

.toast-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.toast-message {
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.5;
}

.toast .btn-close {
  font-size: 0.75rem;
}
