/* CRM Pipeline Styles - Modern & Sophisticated */

:root {
  --pipeline-bg: #0a0a0a;
  --pipeline-card-bg: #1a1a1a;
  --pipeline-border: rgba(212, 175, 55, 0.2);
  --gold-color: #D4AF37; /* Exact match with logo gold */
  --gold-hover: #E3C873; /* From logo gold gradient */
  --gold-light: rgba(212, 175, 55, 0.15);
  --gold-dark: #A98533; /* From logo gold gradient */
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --success-color: #D4AF37; /* Exact match with logo gold */
  --warning-color: #D4AF37; /* Exact match with logo gold */
  --danger-color: #A98533; /* From logo gold gradient */
  --info-color: #D4AF37;   /* Exact match with logo gold */
  --gold-gradient: linear-gradient(170deg, #D5B65B 0%, #A27E2F 30%, #F3E392 50%, #A98533 70%, #E3C873 100%); /* Logo gold gradient */
  --gold-gradient-reverse: linear-gradient(170deg, #E3C873 0%, #A98533 30%, #F3E392 50%, #A27E2F 70%, #D5B65B 100%); /* Logo gold gradient reversed */
}

/* Fix modal z-index to appear above everything */
.modal {
  z-index: 9999 !important;
}

.modal-backdrop {
  z-index: 9998 !important;
}

.modal-dialog {
  z-index: 10000 !important;
}

/* Action Buttons */
.btn-gold {
  background: var(--gold-gradient);
  border-color: var(--gold-color);
  color: #000;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  box-shadow: var(--shadow-gold);
  transition: all 0.3s ease;
}

.btn-gold:hover {
  background: var(--gold-gradient-reverse);
  border-color: var(--gold-hover);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(212, 175, 55, 0.3);
}

.btn-gold i {
  margin-right: 0.5rem;
}

.btn-new-lead {
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-new-lead::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
  z-index: -1;
}

.btn-new-lead:hover::after {
  transform: translateX(0);
}

/* Stat Cards */
.stat-card {
  background: linear-gradient(135deg, var(--pipeline-card-bg) 0%, rgba(21, 27, 46, 0.8) 100%);
  border: 1px solid var(--pipeline-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(212, 175, 55, 0.15);
  border-color: var(--gold-color);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.stat-icon.bg-primary {
  background: var(--gold-gradient);
}

.stat-icon.bg-success {
  background: var(--gold-gradient);
}

.stat-icon.bg-warning {
  background: var(--gold-gradient);
}

.stat-icon.bg-info {
  background: var(--gold-gradient);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Top Scrollbar */
.pipeline-scroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 20px;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  -webkit-overflow-scrolling: touch;
}

.pipeline-scroll-top::-webkit-scrollbar {
  height: 8px;
}

.pipeline-scroll-top::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.pipeline-scroll-top::-webkit-scrollbar-thumb {
  background: #D4AF37; /* Exact match with logo gold */
  border-radius: 4px;
}

.pipeline-scroll-top::-webkit-scrollbar-thumb:hover {
  background: #E3C873; /* From logo gold gradient */
}

.pipeline-scroll-content {
  height: 1px;
  /* Width will be set dynamically via JavaScript */
}

/* Pipeline Board */
.pipeline-board {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 400px;
  -webkit-overflow-scrolling: touch;
}

.pipeline-board::-webkit-scrollbar {
  height: 8px;
}

.pipeline-board::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.pipeline-board::-webkit-scrollbar-thumb {
  background: #D4AF37; /* Exact match with logo gold */
  border-radius: 4px;
}

.pipeline-column {
  flex: 0 0 320px;
  background: var(--pipeline-card-bg);
  border: 1px solid var(--pipeline-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  max-height: 800px;
}

.pipeline-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--pipeline-border);
}

.pipeline-column-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pipeline-column-count {
  background: var(--gold-color);
  color: var(--pipeline-bg);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

.pipeline-column-value {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.pipeline-cards {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 0.25rem;
}

.pipeline-cards::-webkit-scrollbar {
  width: 6px;
}

.pipeline-cards::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.pipeline-cards::-webkit-scrollbar-thumb {
  background: #D4AF37; /* Exact match with logo gold */
  border-radius: 3px;
}

/* Lead Card */
.lead-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.lead-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #D4AF37; /* Exact match with logo gold */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border-color: #D4AF37; /* Exact match with logo gold */
}

.lead-card:hover::before {
  opacity: 1;
}

.lead-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.lead-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.lead-card-company {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.lead-card-priority {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.lead-card-priority.high {
  background: #D4AF37; /* Exact match with logo gold */
  box-shadow: 0 0 8px #D4AF37;
}

.lead-card-priority.medium {
  background: #A98533; /* From logo gold gradient */
  box-shadow: 0 0 8px #A98533;
}

.lead-card-priority.low {
  background: #F3E392; /* From logo gold gradient - lighter */
  box-shadow: 0 0 8px #F3E392;
}

.lead-card-body {
  margin-bottom: 0.75rem;
}

.lead-card-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.lead-card-info i {
  color: var(--gold-color);
  width: 14px;
}

.lead-card-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--success-color);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lead-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lead-card-contacts {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.contact-progress {
  display: flex;
  gap: 2px;
}

.contact-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.contact-dot.completed {
  background: #D4AF37; /* Exact match with logo gold */
  box-shadow: 0 0 4px #D4AF37;
}

.lead-card-actions {
  display: flex;
  gap: 0.25rem;
}

.lead-card-action {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 0.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.lead-card-action:hover {
  color: #D4AF37; /* Exact match with logo gold */
  background: rgba(212, 175, 55, 0.1);
}

.lead-card-next-action {
  font-size: 0.7rem;
  color: #D4AF37; /* Exact match with logo gold */
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lead-card-next-action i {
  font-size: 0.6rem;
}

/* Drag and Drop States */
.lead-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.pipeline-column.drag-over {
  background: rgba(212, 175, 55, 0.1);
  border-color: #D4AF37; /* Exact match with logo gold */
}

/* Empty State */
.pipeline-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.pipeline-empty i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* List View */
.pipeline-list-view table {
  background: var(--pipeline-card-bg);
  border: 1px solid var(--pipeline-border);
  border-radius: 12px;
  overflow: hidden;
}

.pipeline-list-view thead {
  background: rgba(212, 175, 55, 0.1);
}

.pipeline-list-view th {
  color: #D4AF37; /* Exact match with logo gold */
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1rem;
  border-bottom: 2px solid rgba(212, 175, 55, 0.2);
}

.pipeline-list-view td {
  color: var(--text-primary);
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.pipeline-list-view tbody tr {
  transition: all 0.3s ease;
}

.pipeline-list-view tbody tr:hover {
  background: rgba(212, 175, 55, 0.05);
}

/* Stage Badge */
.stage-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stage-badge.new {
  background: rgba(23, 162, 184, 0.2);
  color: var(--info-color);
  border: 1px solid var(--info-color);
}

.stage-badge.contacted {
  background: rgba(255, 193, 7, 0.2);
  color: var(--warning-color);
  border: 1px solid var(--warning-color);
}

.stage-badge.qualified {
  background: rgba(40, 167, 69, 0.2);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.stage-badge.proposal {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-color);
  border: 1px solid var(--gold-color);
}

.stage-badge.negotiation {
  background: rgba(138, 43, 226, 0.2);
  color: #8a2be2;
  border: 1px solid #8a2be2;
}

.stage-badge.won {
  background: rgba(40, 167, 69, 0.3);
  color: #28a745;
  border: 1px solid #28a745;
}

.stage-badge.lost {
  background: rgba(220, 53, 69, 0.2);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

/* Contact Count Indicator */
.contact-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--gold-color);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .pipeline-column {
    flex: 0 0 280px;
  }
}

@media (max-width: 768px) {
  .pipeline-board {
    flex-direction: column;
  }
  
  .pipeline-column {
    flex: 1 1 auto;
    max-height: 400px;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
}

/* Animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lead-card {
  animation: slideIn 0.3s ease;
}

/* Wizard Progress */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.wizard-progress::-webkit-scrollbar {
  height: 4px;
}

.wizard-progress::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.wizard-progress::-webkit-scrollbar-thumb {
  background: var(--gold-color);
  border-radius: 2px;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 0;
}

.wizard-step {
  flex: 0 0 auto;
  min-width: 80px;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 0.25rem;
}

.wizard-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pipeline-card-bg);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.wizard-step.active .wizard-step-circle {
  background: var(--gold-color);
  border-color: var(--gold-color);
  color: var(--pipeline-bg);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.5);
  transform: scale(1.1);
}

.wizard-step.completed .wizard-step-circle {
  background: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.wizard-step-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
  margin: 0 auto;
}

.wizard-step.active .wizard-step-label {
  color: var(--gold-color);
  font-weight: 600;
}

/* Mobile wizard optimization */
@media (max-width: 768px) {
  .wizard-progress {
    justify-content: flex-start;
    gap: 0.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .wizard-step {
    min-width: 70px;
    flex: 0 0 70px;
  }
  
  .wizard-step-circle {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }
  
  .wizard-step-label {
    font-size: 0.6rem;
    max-width: 70px;
  }
  
  /* Auto-scroll to active step on mobile */
  .wizard-step.active {
    scroll-margin-left: 20px;
  }
  
  /* Mobile modal optimizations */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  .modal-xl {
    max-width: calc(100% - 1rem);
  }
  
  .modal-body {
    padding: 1rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-footer {
    padding: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    flex: 1 1 auto;
    min-width: 120px;
  }
  
  /* Lead card mobile improvements */
  .lead-card {
    padding: 0.875rem;
  }
  
  .lead-card-name {
    font-size: 0.95rem;
  }
  
  .lead-card-info {
    font-size: 0.7rem;
  }
  
  /* Pipeline board mobile */
  .pipeline-board {
    gap: 1rem;
    padding-bottom: 1.5rem;
  }
  
  .pipeline-column {
    flex: 0 0 280px;
  }
  
  /* Contact form mobile */
  .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
  }
  
  .form-control,
  .form-select {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
  
  /* Improve touch targets */
  .lead-card-action {
    min-width: 36px;
    min-height: 36px;
    padding: 0.5rem;
  }
  
  .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}
