/* Archivo: css/inicio/tareas.css */

/* === TASKS SECTION === */
.tareas-section {
  margin-top: 16px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  padding: 24px 28px;
}

/* --- Tabs --- */
.tareas-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 2px;
}

.tareas-tab-btn {
  padding: 10px 18px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: #64748b;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tareas-tab-btn:hover {
  color: #334155;
}

.tareas-tab-btn.active {
  color: #0ea5e9;
  border-bottom-color: #0ea5e9;
}

.tareas-tab-badge {
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  transition: all 0.2s;
}

.tareas-tab-btn.active .tareas-tab-badge {
  background: #e0f2fe;
  color: #0369a1;
}

/* --- Carousel --- */
.tareas-carousel-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.tareas-carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  width: 100%;
  padding: 10px 4px;
  scroll-snap-type: x mandatory;
}

/* Nav arrows */
.tareas-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: #475569;
  transition: all 0.2s;
  font-size: 0.8rem;
}

.tareas-nav-arrow:hover {
  background: #f8fafc;
  color: #0ea5e9;
  border-color: #cbd5e1;
}

.tareas-nav-arrow:disabled,
.tareas-nav-arrow.hidden-arrow {
  opacity: 0;
  pointer-events: none;
}

.tareas-arrow-left  { left: -20px; }
.tareas-arrow-right { right: -20px; }

/* --- Task Cards --- */
.tareas-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 0 calc(33.333% - 14px);
  min-width: calc(33.333% - 14px);
  scroll-snap-align: start;
}

.tareas-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  transform: translateY(-3px);
  border-color: #cbd5e1;
}

.tareas-card.card-pending   { border-top: 4px solid #cbd5e1; }
.tareas-card.card-progress  { border-top: 4px solid #3b82f6; }
.tareas-card.card-completed { border-top: 4px solid #10b981; opacity: 0.85; }

/* Card meta (tag + time) */
.tareas-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.tareas-card-tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.73rem;
}

.tareas-card-time {
  color: #94a3b8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Card title */
.tareas-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  min-height: 44px;
}

.tareas-card.card-completed .tareas-card-title {
  text-decoration: line-through;
  color: #94a3b8;
}

/* Action buttons */
.tareas-action-btn {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  width: 100%;
}

.tareas-btn-start {
  background: #f0f9ff;
  color: #0ea5e9;
  border: 1px solid #bae6fd;
}
.tareas-btn-start:hover {
  background: #e0f2fe;
}

.tareas-btn-complete {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.tareas-btn-complete:hover {
  background: #dcfce7;
}

.tareas-completed-label {
  text-align: center;
  color: #10b981;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Empty state */
.tareas-empty {
  width: 100%;
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tareas-empty span.material-symbols-outlined {
  font-size: 36px;
  color: #cbd5e1;
}

/* --- Tabs header con botón agregar --- */
.tareas-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 2px;
}

.tareas-tabs-header .tareas-tabs {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tareas-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #0ea5e9;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tareas-add-btn:hover {
  background: #0284c7;
}

/* Botón móvil: oculto en desktop */
.tareas-add-btn-mobile {
  display: none;
}

/* Quitar highlight azul al tocar en móvil */
.tareas-tab-btn,
.tareas-nav-arrow,
.tareas-action-btn,
.tareas-add-btn,
.tareas-add-btn-mobile {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .tareas-card {
    flex: 0 0 calc(50% - 10px);
    min-width: calc(50% - 10px);
  }
}

@media (max-width: 768px) {
  /* Sección */
  .tareas-section {
    padding: 16px 14px 20px;
    border-radius: 16px;
  }

  /* Header: solo tabs, sin botón */
  .tareas-tabs-header {
    flex-direction: row;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
    padding-bottom: 2px;
  }

  /* Ocultar botón del header en móvil */
  .tareas-tabs-header .tareas-add-btn {
    display: none;
  }

  /* Tabs: fila compacta */
  .tareas-tabs-header .tareas-tabs {
    display: flex;
    justify-content: flex-start;
    border-bottom: none;
    padding-bottom: 0;
    width: 100%;
  }

  .tareas-tab-btn {
    flex: 1;
    justify-content: center;
    padding: 7px 4px;
    font-size: 0.72rem;
    gap: 4px;
  }

  .tareas-tab-btn .material-symbols-outlined {
    font-size: 14px !important;
  }

  .tareas-tab-badge {
    padding: 1px 5px;
    font-size: 0.65rem;
  }

  .tareas-add-btn-text {
    display: inline;
  }

  /* Mostrar botón móvil debajo del carrusel */
  .tareas-add-btn-mobile {
    display: flex;
  }

  /* Botón debajo del carrusel */
  .tareas-add-btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    margin: 14px auto 0;
    padding: 9px 28px;
    background: #0ea5e9;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
  }

  .tareas-add-btn-mobile:hover {
    background: #0284c7;
  }

  /* Carrusel: una tarjeta centrada a la vez */
  .tareas-carousel-wrapper {
    padding: 0 28px;
  }

  .tareas-carousel-track {
    gap: 0;
    padding: 6px 0;
    scroll-snap-type: x mandatory;
    overflow-x: auto;           /* permite deslizar con el dedo */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;      /* oculta scrollbar en Firefox */
  }

  .tareas-carousel-track::-webkit-scrollbar {
    display: none;              /* oculta scrollbar en Chrome/Safari */
  }

  .tareas-card {
    flex: 0 0 100%;
    min-width: 100%;
    padding: 14px 14px;
    gap: 10px;
    border-radius: 12px;
    scroll-snap-align: center;
    margin: 0;
    min-height: auto;
  }

  .tareas-card-title {
    font-size: 0.9rem;
    min-height: auto;
    line-height: 1.35;
  }

  .tareas-card-meta {
    font-size: 0.74rem;
  }

  .tareas-card-tag {
    font-size: 0.68rem;
    padding: 3px 8px;
  }

  .tareas-action-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  /* Flechas dentro del padding lateral */
  .tareas-nav-arrow {
    width: 28px;
    height: 28px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }

  .tareas-arrow-left  { left: 0px; }
  .tareas-arrow-right { right: 0px; }
}