/* === feedback.css === */
/* ======================================================
   === SECTION: KANBAN BOARD & TASK TRACKER ===
   ====================================================== */

/* --- Kanban Board Container --- */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
  align-items: flex-start;
}

/* --- Kanban Column --- */
.kanban-col {
  flex: 1;
  min-width: 260px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px 12px 0 0;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 2;
}
.kanban-col-header .col-count {
  margin-left: auto;
  font-weight: 900;
  font-size: 0.85rem;
}
.kanban-col-body {
  padding: 8px;
  min-height: 120px;
  flex: 1;
  transition: background 0.2s;
}
.kanban-col-body.drag-over {
  background: rgba(99, 102, 241, 0.08);
  border-radius: 0 0 12px 12px;
}
.kanban-col-empty {
  text-align: center;
  padding: 24px 12px;
  color: #cbd5e1;
  font-size: 0.75rem;
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  margin: 4px;
}

/* Column colors */
.kanban-col--new .kanban-col-header { background: #fef9c3; color: #854d0e; }
.kanban-col--in-progress .kanban-col-header { background: #dbeafe; color: #1d4ed8; }
.kanban-col--review .kanban-col-header { background: #e0e7ff; color: #4338ca; }
.kanban-col--completed .kanban-col-header { background: #dcfce7; color: #166534; }

/* --- Kanban Card --- */
.kanban-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.15s ease;
  position: relative;
}
.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Priority left border */
.kanban-card--critical { border-left: 3px solid var(--red); }
.kanban-card--high { border-left: 3px solid #f97316; }
.kanban-card--medium { border-left: 3px solid var(--yellow); }
.kanban-card--low { border-left: 3px solid var(--accent); }

/* Card header row */
.kanban-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.kanban-card-ticket {
  font-family: monospace;
  font-size: 0.65rem;
  font-weight: 800;
  color: #6366f1;
}
.kanban-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 6px;
  word-break: break-word;
}

/* Priority badge */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.priority-badge--critical { background: #fef2f2; color: var(--red); }
.priority-badge--high { background: #fff7ed; color: #ea580c; }
.priority-badge--medium { background: #fffbeb; color: #b45309; }
.priority-badge--low { background: #eff6ff; color: var(--accent); }

/* Category badge */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  background: #f1f5f9;
  color: #64748b;
}

/* Card footer */
.kanban-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.kanban-card-assignee {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #475569;
}
.kanban-card-assignee .avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 0.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kanban-card-date {
  font-size: 0.6rem;
  color: #94a3b8;
  margin-left: auto;
}
.kanban-card-comments {
  font-size: 0.6rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* --- Filters & Toolbar --- */
.kanban-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.kanban-filter {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  background: white;
  color: #334155;
  cursor: pointer;
}
.kanban-filter:focus {
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.kanban-search {
  padding: 6px 12px 6px 32px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: inherit;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 10px center;
  min-width: 180px;
}

/* --- Task Detail Modal --- */
.task-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.task-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.task-modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.25s ease;
}
@keyframes modalSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.task-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
  border-radius: 16px 16px 0 0;
}
.task-modal-header .ticket-num {
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 800;
  color: #6366f1;
  background: #eff6ff;
  padding: 2px 10px;
  border-radius: 6px;
}
.task-modal-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.task-modal-close:hover { background: #f1f5f9; color: #334155; }

.task-modal-body {
  padding: 20px 24px;
}
.task-modal-body .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.task-modal-body .form-group {
  margin-bottom: 14px;
}
.task-modal-body .form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.task-modal-body .form-input,
.task-modal-body .form-select,
.task-modal-body .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #1e293b;
  background: white;
  transition: border-color 0.15s;
}
.task-modal-body .form-input:focus,
.task-modal-body .form-select:focus,
.task-modal-body .form-textarea:focus {
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}
.task-modal-body .form-textarea {
  resize: vertical;
  min-height: 80px;
}
.task-modal-body .task-title-input {
  font-size: 1.1rem;
  font-weight: 800;
  border: none;
  padding: 0;
  color: #0f172a;
  background: transparent;
}
.task-modal-body .task-title-input:focus {
  box-shadow: none;
  outline: none;
  border-bottom: 2px solid #6366f1;
  border-radius: 0;
}

/* Meta row */
.task-meta-row {
  display: flex;
  gap: 16px;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.task-meta-row i { margin-right: 4px; }

/* --- Comments Section --- */
.task-comments-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  margin-top: 16px;
}
.task-comments-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-comments-title .comment-count {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.65rem;
  padding: 1px 7px;
  border-radius: 99px;
}

/* Comment item */
.comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f8fafc;
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 0.55rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.comment-avatar--system {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}
.comment-body {
  flex: 1;
  min-width: 0;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.comment-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e293b;
}
.comment-time {
  font-size: 0.6rem;
  color: #94a3b8;
}
.comment-text {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.5;
  word-break: break-word;
}
.comment-text--system {
  font-style: italic;
  color: #94a3b8;
  font-size: 0.72rem;
}

/* Add comment form */
.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-end;
}
.comment-form textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: inherit;
  resize: none;
  min-height: 38px;
  max-height: 120px;
}
.comment-form textarea:focus {
  border-color: #6366f1;
  outline: none;
}
.comment-form button {
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.comment-form button:hover { background: #4f46e5; }

/* Task modal footer */
.task-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  border-radius: 0 0 16px 16px;
  position: sticky;
  bottom: 0;
}
.task-modal-footer .btn-save {
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-modal-footer .btn-save:hover { background: #4f46e5; }
.task-modal-footer .btn-delete {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.task-modal-footer .btn-delete:hover { background: #fee2e2; }

/* --- History log in comments --- */
.history-entry {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  align-items: center;
}
.history-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}
.history-text {
  font-size: 0.7rem;
  color: #94a3b8;
  font-style: italic;
}
.history-time {
  font-size: 0.6rem;
  color: #cbd5e1;
  margin-left: auto;
  white-space: nowrap;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .kanban-board {
    flex-direction: column;
  }
  .kanban-col {
    max-width: 100%;
    min-width: 100%;
  }
  .task-modal {
    max-width: 100%;
    max-height: 95vh;
  }
  .task-modal-body .form-row {
    grid-template-columns: 1fr;
  }
  .kanban-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .kanban-search {
    min-width: 100%;
  }
}
