/* ============================================
   KANBAN BOARD COMPONENTS
   Columnas Kanban, tarjetas de tareas expandibles, drag & drop
   ============================================ */

/* ============================================
   KANBAN BOARD LAYOUT
   ============================================ */

.kanban-board {
  display: flex;
  gap: 16px;
  height: 100%;
  min-height: 0;
  /* Allow flex shrinking */
  overflow-x: auto;
  overflow-y: hidden;
  padding: 5px 24px 24px 24px;
  /* Top reducido a 5px */
  align-items: flex-start;
  position: relative;
  transition: box-shadow 0.3s ease;
  user-select: none;
  /* Previene seleccionar texto al arrastrar */
}

.kanban-board.active-dragging {
  scroll-behavior: auto;
  /* Desactiva scroll suave para mayor respuesta al arrastrar */
}

.kanban-board.glow-left {
  box-shadow: inset 30px 0 40px -20px rgba(99, 102, 241, 0.3);
}

.kanban-board.glow-right {
  box-shadow: inset -30px 0 40px -20px rgba(99, 102, 241, 0.3);
}

.kanban-board::-webkit-scrollbar {
  height: 8px;
  /* Slightly taller for horizontal board */
}

.kanban-board::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 6px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* ============================================
   KANBAN COLUMN
   ============================================ */

.kanban-column {
  min-width: 305px;
  /* Reducido otros 15px */
  max-width: 375px;
  /* Reducido otros 15px */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: fit-content;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: default;
  /* Prevent inherit grab cursor */
}

.kanban-column-header:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.kanban-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #94a3b8;
  /* Medium-dark gray for dark mode headers */
}

.kanban-column-count {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.kanban-add-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kanban-add-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  transform: scale(1.05);
}

/* ============================================
   KANBAN CARDS CONTAINER
   ============================================ */

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.15);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  overflow-x: hidden;
  perspective: 1000px;
  /* 3D Perspective */
}

.kanban-cards::-webkit-scrollbar {
  width: 6px;
}

.kanban-cards::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-cards::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 6px;
}

.kanban-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.kanban-cards.drag-over {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.4);
  border-style: solid;
}

/* ============================================
   EXPANDABLE TAREA CARD
   ============================================ */

.tarea-card-expandable {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  /* Requerido para HoverMe */
  cursor: pointer;
  z-index: 1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
}

.tarea-card-expandable::before {
  content: " ";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 600px;
  background: linear-gradient(#ff2288, #387ef0);
  opacity: 0;
  transition: opacity 300ms;
  animation: rotation_9018 8000ms infinite linear;
  animation-play-state: paused;
  z-index: -2;
}

/* .tarea-card-expandable:hover::before {
  opacity: 1;
  animation-play-state: running;
} */

.tarea-card-expandable::after {
  content: " ";
  position: absolute;
  inset: 2px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 15px;
  backdrop-filter: blur(20px);
  z-index: -1;
}

/* .tarea-card-expandable:hover {
  transform: translateZ(10px) rotateX(2deg) rotateY(2deg);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    -5px 5px 15px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
} */

/* .light-mode .tarea-card-expandable:hover {
  background: white;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12);
} */

/* Drag and drop disabled */

/* ============================================
   CARD HEADER
   ============================================ */

.expandable-card-header {
  padding: 12px 27px 8px;
  position: relative;
  z-index: 2;
  border-top: 3px solid var(--priority-color, #6366f1);
  border-radius: 14px 14px 0 0;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.status-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.status-todo {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-badge.status-progress {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.status-review {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.status-done {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.expand-toggle-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  /* Cambiado a circular para que combine con el nuevo icono */
  color: #c7d2fe;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.expand-toggle-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.expand-toggle-btn .material-symbols-outlined {
  font-size: 24px;
  /* Un poco más grande para que destaque */
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.tarea-card-expandable[data-expanded="true"] .expand-toggle-btn {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.4));
  border-color: rgba(99, 102, 241, 0.6);
}

.tarea-card-expandable[data-expanded="true"] .expand-toggle-btn .material-symbols-outlined {
  transform: rotate(90deg);
  /* Rota hacia abajo al expandir */
}

.expandable-title {
  font-size: 19px;
  /* Aumentado 4px */
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.4;
  margin: 0 0 8px 0;
  word-break: break-word;
  transition: transform 0.3s ease;
}

/* .tarea-card-expandable:hover .expandable-title {
  transform: translateZ(20px);
  text-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
} */

.expandable-description {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
}

/* ============================================
   CARD MAIN CONTENT - Now inside expandable
   ============================================ */

/* ============================================
   PROGRESS SECTION (Always Visible)
   ============================================ */

.expandable-progress {
  padding: 0 27px 8px;
  position: relative;
  z-index: 2;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.progress-value {
  font-size: 13px;
  font-weight: 700;
  color: #c7d2fe;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: shimmer 2s infinite;
}

.progress-fill.complete {
  background: linear-gradient(90deg, #22c55e, #10b981);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* ============================================
   EXPANDABLE CONTENT
   ============================================ */

.expandable-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  opacity: 0;
}

.tarea-card-expandable[data-expanded="true"] .expandable-content {
  max-height: 2000px;
  opacity: 1;
  overflow: visible;
}

.expandable-content-inner {
  padding: 16px 31px;
  /* Aumentado 15px horizontal */
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 0;
  padding-top: 16px;
}

/* Description inside expandable */
.expandable-content .expandable-description {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
}

/* Meta Info */
.expandable-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #cbd5e1;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.meta-item .material-symbols-outlined {
  font-size: 16px;
  color: #94a3b8;
}

.meta-item.due-date {
  color: #fca5a5;
}

.meta-item.due-date .material-symbols-outlined {
  color: #ef4444;
}

/* Tags */
.expandable-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  font-size: 10px;
  color: #c7d2fe;
  font-weight: 500;
}

/* Contributors Section */
.expandable-contributors {
  padding: 8px 0;
  display: block !important;
  visibility: visible !important;
  width: 100%;
}

.expandable-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 10px 0;
}

.expandable-section-title .material-symbols-outlined {
  font-size: 18px;
  color: #a5b4fc;
}

.contributor-avatars {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.contributor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.9);
  margin-left: -6px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.contributor-avatar:first-child {
  margin-left: 0;
}

.contributor-avatar:hover {
  transform: scale(1.15) translateY(-3px);
  z-index: 10;
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35);
}

.contributor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.contributor-avatar.more {
  background: #475569;
  font-size: 11px;
}

/* Subtasks Section */
.expandable-subtasks {
  padding: 8px 0;
  display: block !important;
  visibility: visible !important;
  width: 100%;
}

.expandable-subtasks h4,
.expandable-subtasks .expandable-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 12px 0;
}

.subtask-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.subtask-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.subtask-title {
  font-size: 13px;
  color: #e2e8f0;
  flex: 1;
  margin-right: 8px;
}

.subtask-item.completed .subtask-title {
  color: #94a3b8;
  text-decoration: line-through;
}

.subtask-check {
  font-size: 20px;
  color: #22c55e;
  flex-shrink: 0;
}

.subtask-pending {
  font-size: 20px;
  color: #64748b;
  flex-shrink: 0;
}



/* ============================================
   CARD FOOTER (Always Visible - Before Expandable)
   ============================================ */

.expandable-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 29px;
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 16px 16px;
  margin-top: auto;
}

/* When expanded, footer loses bottom radius */
.tarea-card-expandable[data-expanded="true"] .expandable-card-footer {
  border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.last-updated {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.open-issues {
  font-size: 11px;
  color: #a5b4fc;
  font-weight: 500;
}

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

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

/* ============================================
   META ROW (Date, Stars, Issues)
   ============================================ */

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 27px 12px;
  position: relative;
  z-index: 2;
}

.card-meta-row .meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #cbd5e1;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.card-meta-row .meta-item .material-symbols-outlined {
  font-size: 16px;
  color: #94a3b8;
}

/* ============================================
   CONTRIBUTORS SECTION (Always Visible)
   ============================================ */

.card-contributors-section {
  padding: 8px 27px;
  position: relative;
  z-index: 2;
}

.card-contributors-section .expandable-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 10px 0;
}

.card-contributors-section .expandable-section-title .material-symbols-outlined {
  font-size: 18px;
  color: #a5b4fc;
}

.card-contributors-section .contributor-avatars {
  display: flex;
  align-items: center;
  gap: 0;
}

.card-contributors-section .contributor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(15, 23, 42, 0.9);
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.card-contributors-section .contributor-avatar:first-child {
  margin-left: 0;
}

.card-contributors-section .contributor-avatar:hover {
  transform: scale(1.15) translateY(-3px);
  z-index: 10;
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35);
}

.card-contributors-section .contributor-avatar.more {
  background: #475569;
  font-size: 11px;
}

/* ============================================
   SUBTASKS SECTION (Always Visible, Recent)
   ============================================ */

.card-subtasks-section {
  padding: 8px 27px;
  position: relative;
  z-index: 2;
}

.card-subtasks-section .expandable-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 10px 0;
}

.card-subtasks-section .expandable-section-title .material-symbols-outlined {
  font-size: 18px;
  color: #a5b4fc;
}

.card-subtasks-section .subtask-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.card-subtasks-section .subtask-item:last-child {
  border-bottom: none;
}

.card-subtasks-section .subtask-title {
  font-size: 13px;
  color: #e2e8f0;
  flex: 1;
  margin-right: 8px;
}

.card-subtasks-section .subtask-check {
  font-size: 20px;
  color: #22c55e;
  flex-shrink: 0;
}

/* ============================================
   VIEW DISCUSSION BUTTON
   ============================================ */

.card-discussion-wrapper {
  padding: 12px 27px;
  position: relative;
  z-index: 2;
}

.card-discussion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card-discussion-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.card-discussion-btn .material-symbols-outlined {
  font-size: 20px;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.kanban-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: #64748b;
}

.kanban-empty-state .material-symbols-outlined {
  font-size: 64px;
  color: #475569;
  margin-bottom: 16px;
  opacity: 0.5;
}

.kanban-empty-state p {
  font-size: 14px;
  margin-bottom: 8px;
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */

.light-mode .kanban-column-header {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(203, 213, 225, 0.6);
}

.light-mode .kanban-column-title {
  color: #1e293b;
}

.light-mode .kanban-column[data-column-id="todo"] .kanban-column-title,
.light-mode .kanban-column[data-column-id="in-progress"] .kanban-column-title {
  color: #0f172a !important;
  /* Slate 950 - Darker Gray requested by user */
}

.light-mode .kanban-cards {
  background: rgba(241, 245, 249, 0.5);
  border-color: rgba(203, 213, 225, 0.4);
}

.light-mode .tarea-card-expandable {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(203, 213, 225, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.light-mode .tarea-card-expandable:hover {
  background: white;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12);
}

.light-mode .expandable-title {
  color: #0f172a !important;
  /* Darker Gray requested by user */
  font-weight: 600;
  /* Re-adding some weight for visibility */
  text-shadow: none !important;
}

.light-mode .expandable-description {
  color: #64748b;
}

.light-mode .expand-toggle-btn {
  background: rgba(241, 245, 249, 0.8);
  border-color: rgba(203, 213, 225, 0.6);
  color: #64748b;
}

.light-mode .expand-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: #6366f1;
}

.light-mode .progress-track {
  background: rgba(203, 213, 225, 0.4);
}

.light-mode .meta-item {
  background: rgba(241, 245, 249, 0.8);
  border-color: rgba(203, 213, 225, 0.5);
  color: #475569;
}

.light-mode .expandable-card-footer {
  background: rgba(241, 245, 249, 0.5);
  border-top-color: rgba(203, 213, 225, 0.5);
}

.light-mode .last-updated {
  color: #94a3b8;
}

.light-mode .subtask-item {
  background: rgba(241, 245, 249, 0.6);
  border-color: rgba(203, 213, 225, 0.4);
}

.light-mode .subtask-title {
  color: #334155;
}

/* --- Card ::after overlay (ROOT CAUSE of dark cards in light mode) --- */
.light-mode .tarea-card-expandable::after {
  background: rgba(255, 255, 255, 0.95);
}

.light-mode .tarea-card-expandable::before {
  background: linear-gradient(#6366f1, #a78bfa);
}

/* --- Status Badges --- */
.light-mode .status-badge.status-todo {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.3);
}

.light-mode .status-badge.status-progress {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.3);
}

.light-mode .status-badge.status-review {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}

.light-mode .status-badge.status-done {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.3);
}

/* --- Column UI --- */
.light-mode .kanban-column-count {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.25);
}

.light-mode .kanban-add-btn {
  border-color: rgba(203, 213, 225, 0.6);
  color: #64748b;
}

.light-mode .kanban-add-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  color: #4f46e5;
}

/* --- Expand Toggle --- */
.light-mode .tarea-card-expandable[data-expanded="true"] .expand-toggle-btn {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #4f46e5;
}

/* --- Text & Labels --- */
.light-mode .expandable-section-title,
.light-mode .expandable-subtasks h4 {
  color: #94a3b8 !important;
  /* Matches .last-updated */
  font-weight: 600;
}

.light-mode .expandable-contributors,
.light-mode .expandable-tags {
  border-bottom: 1px solid rgba(203, 213, 225, 0.5);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

/* --- New Card Sections Light Mode --- */
.light-mode .card-meta-row .meta-item {
  background: rgba(241, 245, 249, 0.8);
  border-color: rgba(203, 213, 225, 0.5);
  color: #475569;
}

.light-mode .card-meta-row .meta-item .material-symbols-outlined {
  color: #64748b;
}

.light-mode .card-contributors-section .expandable-section-title,
.light-mode .card-subtasks-section .expandable-section-title {
  color: #475569;
}

.light-mode .card-contributors-section .expandable-section-title .material-symbols-outlined,
.light-mode .card-subtasks-section .expandable-section-title .material-symbols-outlined {
  color: #64748b;
}

.light-mode .card-contributors-section .contributor-avatar {
  border-color: rgba(255, 255, 255, 0.95);
}

.light-mode .card-subtasks-section .subtask-title {
  color: #334155;
}

.light-mode .card-subtasks-section .subtask-item {
  border-bottom-color: rgba(203, 213, 225, 0.4);
}

.light-mode .card-subtasks-section .subtask-check {
  color: #16a34a;
}

.light-mode .card-discussion-btn {
  background: rgba(241, 245, 249, 0.8);
  border-color: rgba(203, 213, 225, 0.6);
  color: #334155;
}

.light-mode .card-discussion-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  color: #4f46e5;
}

/* Ensure icons in titles match */
.light-mode .expandable-section-title .material-symbols-outlined {
  color: #94a3b8 !important;
}

.light-mode .progress-value {
  color: #4f46e5;
}

.light-mode .progress-label {
  color: #64748b;
}

.light-mode .open-issues {
  color: #4f46e5;
}

/* --- Tags --- */
.light-mode .tag-pill {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: #4338ca;
}

/* --- Contributor Avatars --- */
.light-mode .contributor-avatar {
  border-color: rgba(255, 255, 255, 0.95);
}

.light-mode .contributor-avatar.more {
  background: #cbd5e1;
  color: #334155;
}

/* --- Expandable Content Inner --- */
.light-mode .expandable-content-inner {
  border-top-color: rgba(203, 213, 225, 0.5);
}

/* --- Meta Item Icons --- */
.light-mode .meta-item .material-symbols-outlined {
  color: #64748b;
}

.light-mode .meta-item.due-date {
  color: #dc2626;
}

.light-mode .meta-item.due-date .material-symbols-outlined {
  color: #dc2626;
}

/* --- Kanban Board Scrollbar --- */
.light-mode .kanban-board::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.25);
}

.light-mode .kanban-board::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.4);
}

/* --- Search Bar (tareas) --- */
.light-mode #tareaSearchInput {
  background: rgba(255, 255, 255, 0.75) !important;
  border-color: rgba(203, 213, 225, 0.6) !important;
  color: #1e293b !important;
}

.light-mode #tareaSearchInput::placeholder {
  color: #94a3b8 !important;
}

.light-mode #tareaSearchInput:focus {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
}

/* --- Filter Bar Container --- */
.light-mode #tareasView .tarea-filter-btn {
  border-color: rgba(99, 102, 241, 0.25);
  background: rgba(255, 255, 255, 0.6);
  color: #334155;
}

.light-mode #tareasView .tarea-filter-btn .text {
  text-shadow: none;
  color: #334155;
}

.light-mode #tareasView .tarea-filter-btn.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  color: #4f46e5;
}

.light-mode #tareasView .tarea-filter-btn.active .text {
  color: #4f46e5;
}

.light-mode #tareasView .tarea-filter-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
}

.light-mode #tareasView .tarea-filter-btn .liquid {
  background: rgba(241, 245, 249, 0.9);
}

.light-mode #tareasView .tarea-filter-btn .liquid::before {
  background: rgba(226, 232, 240, 0.8);
}

.light-mode #tareasView .tarea-filter-btn .liquid::after {
  background: rgba(226, 232, 240, 0.4);
}

/* --- Kanban Cards Container --- */
.light-mode .kanban-cards::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.2);
}

.light-mode .kanban-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.35);
}

.light-mode .kanban-cards.drag-over {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}

/* --- Subtask Check/Pending Icons --- */
.light-mode .subtask-check {
  color: #16a34a;
}

.light-mode .subtask-pending {
  color: #94a3b8;
}

/* --- Empty State --- */
.light-mode .kanban-empty-state {
  color: #94a3b8;
}

.light-mode .kanban-empty-state .material-symbols-outlined {
  color: #cbd5e1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .kanban-board {
    padding: 16px;
    gap: 16px;
  }

  .kanban-column {
    min-width: 300px;
    max-width: 360px;
  }

  .tarea-card-expandable {
    border-radius: 12px;
  }

  .expandable-card-header {
    padding: 14px 14px 10px;
  }

  .expandable-title {
    font-size: 15px;
  }

  .expandable-description {
    font-size: 13px;
  }

  .contributor-avatar {
    width: 32px;
    height: 32px;
  }

  .meta-item {
    font-size: 11px;
    padding: 4px 8px;
  }

  .subtask-title {
    font-size: 12px;
  }
}

/* ============================================
   BACKWARDS COMPATIBILITY
   Support for old .tarea-card class
   ============================================ */

.tarea-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  cursor: grab;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tarea-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--priority-color, #6366f1), transparent);
  opacity: 0.8;
}

.tarea-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.tarea-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: rotate(2deg);
}