/* Kanban Board Styles */

/*
 * DYNAMIC STATUS COLORS:
 * Status color CSS variables (--status-new, --status-contacted, etc.)
 * are injected dynamically by JavaScript from status_definitions table.
 * See: kanban.js > injectStatusColorVariables()
 */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* SVG Icon Styling */
.svg-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

h1 .svg-icon {
  margin-right: 12px;
}

h2 .svg-icon {
  margin-right: 6px;
}

/* Header - Glassmorphism */
.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.client-selector select {
  min-width: 200px;
}

.header-center {
  flex: 1;
  max-width: 500px;
  margin: 0 2rem;
}

.search-input {
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Filters Bar - Glassmorphism */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.filter-select,
.filter-input {
  min-width: 150px;
}

.stats {
  margin-left: auto;
}

/* Kanban Board - Horizontal Scrolling (Trello-style) */
.kanban-board {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: calc(100vh - 140px);
  align-items: flex-start;
}

/* Custom scrollbar for horizontal scroll */
.kanban-board::-webkit-scrollbar {
  height: 10px;
}

.kanban-board::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin: 0 1rem;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  transition: background 0.3s;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Kanban Column - Fixed width, glassmorphism */
.kanban-column {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  width: 320px;
  min-width: 320px;
  flex-shrink: 0;
  max-height: calc(100vh - 180px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.column-header {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px 12px 0 0;
  border-top: 3px solid rgba(255, 255, 255, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.column-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Status-specific column colors */
.kanban-column[data-status="new"] .column-header {
  border-top-color: var(--status-new);
}

.kanban-column[data-status="contacted"] .column-header {
  border-top-color: var(--status-contacted);
}

.kanban-column[data-status="qualified"] .column-header {
  border-top-color: var(--status-qualified);
}

.kanban-column[data-status="booked"] .column-header {
  border-top-color: var(--status-booked);
}

.kanban-column[data-status="won"] .column-header {
  border-top-color: var(--status-won);
}

.kanban-column[data-status="lost"] .column-header {
  border-top-color: var(--status-lost);
}

/* Legacy classes for won/lost (keeping for compatibility) */
.column-header.won {
  border-top-color: var(--status-won);
}

.column-header.lost {
  border-top-color: var(--status-lost);
}

.column-count {
  display: inline-block;
  min-width: 24px;
  height: 24px;
  padding: 0 0.5rem;
  background: var(--gray-200);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  text-align: center;
  line-height: 24px;
}

/* Status-specific count badge colors */
.kanban-column[data-status="new"] .column-count {
  background: var(--status-new);
}

.kanban-column[data-status="contacted"] .column-count {
  background: var(--status-contacted);
}

.kanban-column[data-status="qualified"] .column-count {
  background: var(--status-qualified);
}

.kanban-column[data-status="booked"] .column-count {
  background: var(--status-booked);
}

.kanban-column[data-status="won"] .column-count {
  background: var(--status-won);
}

.kanban-column[data-status="lost"] .column-count {
  background: var(--status-lost);
}

.column-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Empty state */
.column-empty {
  display: none;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
}

.column-content:empty + .column-empty {
  display: block;
}

/* Lead Card - Glassmorphism */
.lead-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: grab;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid var(--gray-300);
  opacity: 0;
  animation: leadCascade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Status-specific lead card border colors */
.kanban-column[data-status="new"] .lead-card {
  border-left-color: var(--status-new);
}

.kanban-column[data-status="contacted"] .lead-card {
  border-left-color: var(--status-contacted);
}

.kanban-column[data-status="qualified"] .lead-card {
  border-left-color: var(--status-qualified);
}

.kanban-column[data-status="booked"] .lead-card {
  border-left-color: var(--status-booked);
}

.kanban-column[data-status="won"] .lead-card {
  border-left-color: var(--status-won);
}

.kanban-column[data-status="lost"] .lead-card {
  border-left-color: var(--status-lost);
}

@keyframes leadCascade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Staggered animation delays for lead cards */
.lead-card:nth-child(1) { animation-delay: 0.05s; }
.lead-card:nth-child(2) { animation-delay: 0.1s; }
.lead-card:nth-child(3) { animation-delay: 0.15s; }
.lead-card:nth-child(4) { animation-delay: 0.2s; }
.lead-card:nth-child(5) { animation-delay: 0.25s; }
.lead-card:nth-child(6) { animation-delay: 0.3s; }
.lead-card:nth-child(7) { animation-delay: 0.35s; }
.lead-card:nth-child(8) { animation-delay: 0.4s; }
.lead-card:nth-child(9) { animation-delay: 0.45s; }
.lead-card:nth-child(10) { animation-delay: 0.5s; }

.lead-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.lead-card:active {
  cursor: grabbing;
  transform: translateY(0) scale(0.98);
}

.lead-card.sortable-ghost {
  opacity: 0.4;
  background: var(--gray-200);
}

.lead-card.sortable-drag {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: rotate(2deg);
}

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

.lead-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.lead-company {
  font-size: 12px;
  color: var(--gray-600);
}

.lead-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.lead-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--gray-100);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lead-action-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px) scale(1.05);
}

.lead-action-btn:active {
  transform: translateY(0) scale(0.98);
}

.lead-info {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.lead-info:last-child {
  margin-bottom: 0;
}

.lead-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-100);
  font-size: 11px;
  color: var(--gray-500);
}

.lead-business-type {
  font-weight: 500;
  color: var(--primary);
}

/* Undo Toast */
.undo-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  color: #333;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  border-left: 4px solid #3b82f6;
  animation: slideInToast 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInToast {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.undo-toast.hiding {
  animation: slideOutToast 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutToast {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.undo-toast-message {
  flex: 1;
}

.undo-toast-timer {
  font-size: 12px;
  opacity: 0.7;
}

.undo-btn {
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.undo-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.undo-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Scrollbar Styling for Column Content */
.column-content::-webkit-scrollbar {
  width: 6px;
}

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

.column-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: background 0.3s;
}

.column-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .kanban-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .header-left,
  .header-right {
    flex-direction: column;
    align-items: stretch;
  }

  .header-center {
    max-width: 100%;
    margin: 0;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .kanban-column {
    width: 280px;
    min-width: 280px;
  }
}
