/* Opportunities Pipeline Board Styles */

/* Pipeline Column Headers - Compact and Scannable */
.pipeline-column {
  min-width: 280px; /* Slightly reduced from default since headers are shorter */
  display: flex;
  flex-direction: column;
  position: relative;
}

.pipeline-column .column-header h5 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.pipeline-column .column-header .bi-info-circle {
  cursor: help;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.pipeline-column .column-header .bi-info-circle:hover {
  color: var(--bs-primary) !important;
}

/* Stage Tooltips - Enhanced Styling */
.tooltip {
  max-width: 400px; /* Wider tooltips for detailed content */
}

.tooltip-inner {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.tooltip-inner hr {
  border-color: rgba(255, 255, 255, 0.3);
  margin: 0.5rem 0;
}

.tooltip-inner strong {
  display: block;
  margin-bottom: 0.25rem;
}

.tooltip-inner .text-muted {
  opacity: 0.8;
}

/* Compact Header Layout */
.column-header .badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
}

.column-header small {
  font-size: 0.8rem;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  .pipeline-column {
    min-width: 250px;
  }
  
  .column-header h5 {
    font-size: 0.9rem;
  }
  
  .column-header .bi-info-circle {
    font-size: 0.8rem;
  }
  
  .tooltip {
    max-width: 300px;
  }
}

/* Dark theme support for tooltips */
body.dark-theme .tooltip-inner {
  background-color: #2a3142;
  color: #e9ecef;
}

body.dark-theme .tooltip-arrow::before {
  border-top-color: #2a3142 !important;
}

/* Ensure tooltips don't interfere with drag & drop */
.pipeline-column .dragging .bi-info-circle {
  pointer-events: none;
}

/* ============================================
   FULL-COLUMN DROPZONE IMPLEMENTATION
   ============================================
   The entire pipeline-column is a dropzone, not just a small area.
   This allows users to drop cards anywhere in the column, even when
   there are many cards (10+). Similar to deals and projects kanban.
   ============================================ */

/* Entire column is droppable - flex layout for proper dropzone */
.pipeline-column .column-content {
  flex: 1; /* Take up remaining space in column */
  overflow-y: auto; /* Scrollable if needed */
  min-height: 300px; /* Ensure droppable area even when empty */
}

/* Visual feedback when dragging over column */
.pipeline-column.drag-over {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Additional styling when column has drag-over classes applied */
.pipeline-column[data-pipeline-kanban-target~="dropZone"].bg-light.border.border-primary.border-2 {
  background-color: rgba(0, 123, 255, 0.05) !important;
}

/* Ensure cards don't block dropzone interactions */
.opportunity-card {
  pointer-events: auto;
  margin-bottom: 0.5rem;
}

/* ============================================
   CONSISTENT STAGE BADGE COLORS
   ============================================
   Stage badges use a consistent color scheme across all views
   (list, show, kanban cards) for better user experience.
   ============================================ */

/* Custom purple badge for technical validation stage */
.badge-purple {
  background-color: #9b59b6;
  color: white;
}

/* Ensure badge styling is consistent across the app */
.badge {
  padding: 0.35em 0.65em;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

/* ============================================
   SORTABLE TABLE HEADERS
   ============================================
   Styling for sortable column headers in list view
   ============================================ */

/* Make table header cells flex containers */
.pipeline-list .table thead th {
  position: relative;
}

/* Sortable column header styling */
.pipeline-list .table thead th a {
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.pipeline-list .table thead th a:hover {
  color: var(--bs-primary);
}

.pipeline-list .table thead th a i {
  font-size: 0.875rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Active sort column */
.pipeline-list.table thead th a:has(.bi-arrow-up),
.pipeline-list .table thead th a:has(.bi-arrow-down) {
  color: var(--bs-primary);
  font-weight: 600;
}
