/* ==============================================================================
   TASKS & ACTIVITIES MANAGEMENT SYSTEM - STYLESHEET
   ============================================================================== */

/* Tasks View Section Container */
#view-tasks {
  display: none;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 20px 40px 20px;
  animation: fadeIn 0.25s ease-out;
}

#view-tasks.active {
  display: block;
}

/* Tasks Toolbar Header */
.tasks-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.tasks-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.tasks-view-switch-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.tasks-view-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tasks-view-switch-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.tasks-view-switch-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tasks-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tasks-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 260px;
}

.tasks-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted, #94a3b8);
  pointer-events: none;
}

.tasks-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.tasks-search-input:focus {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.07);
}

.btn-new-task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.btn-new-task:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* Smart Filters Pill Row */
.tasks-filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tasks-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tasks-filter-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.tasks-filter-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 600;
}

.tasks-filter-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.tasks-filter-btn.active .tasks-filter-badge {
  background: rgba(255, 255, 255, 0.22);
}

/* ─────────────────────────────────────
   KANBAN BOARD VIEW
   ───────────────────────────────────── */

.tasks-kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  min-height: calc(100vh - 230px);
  align-items: start;
}

@media (max-width: 1024px) {
  .tasks-kanban-board {
    display: flex;
    overflow-x: auto;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
  }
  .tasks-kanban-column {
    min-width: 320px;
    scroll-snap-align: start;
  }
}

.tasks-kanban-column {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tasks-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.tasks-col-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tasks-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tasks-col-dot.todo { background: #60a5fa; box-shadow: 0 0 8px rgba(96, 165, 250, 0.6); }
.tasks-col-dot.in_progress { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.6); }
.tasks-col-dot.completed { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }

.tasks-col-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.tasks-col-count {
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
}

.tasks-cards-dropzone {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 420px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tasks-cards-dropzone.drag-over {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 10px;
}

.tasks-empty-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 16px;
  color: var(--text-muted, #64748b);
  gap: 8px;
  font-size: 12.5px;
  text-align: center;
}

/* Task Card - Sleek Minimalist Linear/Notion Style */
.task-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}

.task-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

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

.task-card.task-dragging {
  opacity: 0.3;
  transform: scale(0.98);
  border-style: dashed;
}

.task-card.task-completed {
  opacity: 0.6;
}

/* Card Main Area */
.task-card-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-card-content {
  flex: 1;
  min-width: 0;
}

.task-card-title-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.task-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #f1f5f9;
  line-height: 1.35;
  word-break: break-word;
  transition: color 0.15s ease;
}

.task-card-title.strike {
  text-decoration: line-through;
  color: #64748b;
}

.task-card-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  margin: 4px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Delete Button on Hover */
.task-card-del-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.task-card:hover .task-card-del-btn {
  opacity: 0.7;
}

.task-card-del-btn:hover {
  opacity: 1 !important;
  color: #f87171;
}

/* Checkbox */
.task-checkbox-container {
  display: inline-flex;
  position: relative;
  cursor: pointer;
  user-select: none;
  padding-top: 1px;
}

.task-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.task-checkbox-checkmark {
  height: 15px;
  width: 15px;
  background-color: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  display: inline-block;
  transition: all 0.15s ease;
}

.task-checkbox-container:hover input ~ .task-checkbox-checkmark {
  border-color: rgba(255, 255, 255, 0.5);
}

.task-checkbox-container input:checked ~ .task-checkbox-checkmark {
  background-color: #ffffff;
  border-color: #ffffff;
}

.task-checkbox-checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 3px;
  width: 3.5px;
  height: 7px;
  border: solid #000000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-checkbox-container input:checked ~ .task-checkbox-checkmark:after {
  display: block;
}

/* Meta Footer Row */
.task-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Discreet Priority Badges (Only Urgent / High shown) */
.task-priority-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 1px 6px;
  border-radius: 4px;
}

.task-priority-badge.priority-urgent {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.task-priority-badge.priority-high {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Discreet Neutral Relation Tags */
.task-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

/* Due Date */
.task-card-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
}

.task-card-date.overdue {
  color: #f87171;
  font-weight: 600;
}

/* AI Tag */
.task-ai-tag {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
  opacity: 0.7;
}

.task-ai-inline {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* ─────────────────────────────────────
   LIST VIEW
   ───────────────────────────────────── */

.tasks-list-container {
  background: rgba(18, 18, 22, 0.6);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
}

.tasks-batch-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(30, 30, 40, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.tasks-batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.tasks-table th {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-muted, #94a3b8);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.tasks-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #ffffff;
  vertical-align: middle;
}

.task-list-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.task-list-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.task-list-row.row-selected {
  background: rgba(99, 102, 241, 0.08);
}

.task-status-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.task-status-badge.status-todo { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.task-status-badge.status-in_progress { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.task-status-badge.status-completed { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.task-status-badge.status-canceled { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.task-title-cell span.strike {
  text-decoration: line-through;
  color: var(--text-muted, #64748b);
}

.task-table-relation-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-table-relation-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.overdue-text {
  color: #ef4444;
  font-weight: 600;
}

.task-action-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  padding: 5px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.task-action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* ─────────────────────────────────────
   IN-ENTITY TASK WIDGET (MODAL)
   ───────────────────────────────────── */

.in-entity-tasks-wrapper {
  padding: 4px 0;
}

.in-entity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.in-entity-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.in-entity-sub {
  margin: 3px 0 0 0;
  font-size: 11.5px;
  color: var(--text-muted, #94a3b8);
}

.in-entity-add-btn {
  padding: 6px 12px;
  font-size: 12px;
}

.in-entity-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.in-entity-task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 14px;
  transition: all 0.2s ease;
}

.in-entity-task-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.in-entity-task-row.completed {
  opacity: 0.65;
}

.in-entity-task-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.in-entity-task-title {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  display: block;
  word-break: break-word;
}

.in-entity-task-title.strike {
  text-decoration: line-through;
  color: var(--text-muted, #64748b);
}

.in-entity-task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
}

.in-entity-task-type {
  color: var(--text-muted, #94a3b8);
}

.in-entity-task-date {
  color: var(--text-muted, #94a3b8);
}

.in-entity-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.in-entity-del-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.in-entity-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
}

/* ─────────────────────────────────────
   AI TASK CONFIRMATION TOAST / CARD
   ───────────────────────────────────── */

.ai-task-toast-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1300;
  max-width: 440px;
  width: calc(100% - 48px);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ai-task-toast-card {
  background: rgba(20, 20, 28, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.15);
}

.ai-task-toast-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.ai-task-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ai-task-toast-text {
  flex: 1;
}

.ai-task-toast-text strong {
  font-size: 13.5px;
  color: #ffffff;
  display: block;
}

.ai-task-toast-preview {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin: 4px 0 0 0;
  line-height: 1.4;
}

.ai-task-toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.ai-task-toast-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}
