/* css/kanban.css */

/* === PAGE WRAPPER === */
.kanban-page-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 0;
}

/* === BOARD: sem scroll lateral, preenche altura disponível === */
.kanban-board {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow-x: hidden; /* SEM scroll lateral */
  overflow-y: hidden;
  box-sizing: border-box;
}

/* === COLUNAS: dividem a largura igualmente, altura cheia === */
.kanban-column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(18, 10, 36, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  overflow: hidden;
}

.kanban-column.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.07);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

/* Top accent borders */
.kanban-column.col-new        { border-top: 3px solid var(--accent-cyan); }
.kanban-column.col-contact    { border-top: 3px solid var(--accent-purple); }
.kanban-column.col-unanswered { border-top: 3px solid #ff7b00; }
.kanban-column.col-trial      { border-top: 3px solid #f59e0b; }
.kanban-column.col-wait       { border-top: 3px solid var(--accent-pink); }
.kanban-column.col-support    { border-top: 3px solid #3b82f6; }
.kanban-column.col-converted  { border-top: 3px solid #10b981; }
.kanban-column.col-lost       { border-top: 3px solid #ef4444; }

/* === CABEÇALHO DA COLUNA === */
.kanban-column-header {
  padding: 0.65rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.75rem 0.75rem 0 0;
  flex-shrink: 0;
}

.kanban-column-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow: hidden;
}

.kanban-column-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-column-count {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.2);
  flex-shrink: 0;
}

/* === CONTAINER DOS CARDS: SCROLL VERTICAL AQUI === */
.kanban-cards-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;   /* scroll apenas nos leads */
  overflow-x: hidden;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* Scrollbar estilizada dos leads */
.kanban-cards-container::-webkit-scrollbar {
  width: 4px;
}
.kanban-cards-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
.kanban-cards-container::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.4);
  border-radius: 3px;
}
.kanban-cards-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.6);
}

/* Placeholder para coluna vazia */
.kanban-cards-container:empty::after {
  content: '↓ Solte aqui';
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 80px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
}

.kanban-column.drag-over .kanban-cards-container:empty::after {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.06);
}

/* === CARDS === */
.kanban-card {
  background: rgba(28, 17, 56, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.55rem;
  padding: 0.65rem 0.7rem;
  cursor: grab;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  overflow: visible;
}

.kanban-card:active { cursor: grabbing; }

.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.97);
  border-style: dashed;
  border-color: var(--accent-cyan);
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35);
  background: rgba(35, 22, 70, 0.95);
}

.kanban-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  word-break: break-word;
}

.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.kanban-card-tag {
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tag-whatsapp { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.tag-instagram { background: rgba(236,72,153,0.15); color: #ec4899; border: 1px solid rgba(236,72,153,0.3); }
.tag-site { background: rgba(59,130,246,0.15); color: #3b82f6; border: 1px solid rgba(59,130,246,0.3); }
.tag-manual { background: rgba(157,78,221,0.15); color: #9d4edd; border: 1px solid rgba(157,78,221,0.3); }

/* === AÇÕES DOS CARDS === */
.kanban-card-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.25rem !important;
  padding-top: 0.4rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
  opacity: 1 !important;
}

/* === BUBBLE CHAT SYSTEM === */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem;
}

.chat-bubble-wrapper {
  display: flex;
  width: 100%;
}

.chat-bubble-wrapper.left {
  justify-content: flex-start;
}

.chat-bubble-wrapper.right {
  justify-content: flex-end;
}

.chat-bubble-wrapper.center {
  justify-content: center;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.55rem 0.8rem;
  font-size: 0.8rem;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.chat-bubble.chat-client {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-radius: 0 10px 10px 10px;
}

.chat-bubble.chat-user {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(157, 78, 221, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: var(--text-primary);
  border-radius: 10px 10px 0 10px;
}

.chat-bubble.chat-system {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 0.72rem;
  font-style: italic;
  max-width: 95%;
  text-align: center;
  box-shadow: none;
}

.chat-bubble-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
  display: block;
}

.chat-client .chat-bubble-header {
  color: var(--accent-cyan);
}

.chat-user .chat-bubble-header {
  color: var(--accent-pink);
}

.chat-bubble-time {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-align: right;
  display: block;
}

/* Animation and glow for newly arrived leads in the Kanban */
@keyframes glowPulse {
  0% {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 5px rgba(168, 85, 247, 0.2);
  }
  50% {
    border-color: #a855f7;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.65), inset 0 0 8px rgba(168, 85, 247, 0.15);
  }
  100% {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 5px rgba(168, 85, 247, 0.2);
  }
}

.glow-new-lead {
  animation: glowPulse 1.5s infinite !important;
  border: 1px solid #a855f7 !important;
}

/* Styling for cold inactive leads */
.cold-lead-card {
  border-color: rgba(59, 130, 246, 0.25) !important;
  background: rgba(15, 23, 42, 0.6) !important;
  box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.05) !important;
}

.cold-lead-card:hover {
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35), inset 0 0 10px rgba(59, 130, 246, 0.1) !important;
}

@keyframes pulse-orange {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}


