/**
 * ═══════════════════════════════════════════════════════════════════════════
 * TODO-LIST COLABORATIVO - Estilos Minimalistas & Animaciones
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═════════════════════════════════════════════════════════════════════════ */
/* ANIMACIONES GLOBALES                                                      */
/* ═════════════════════════════════════════════════════════════════════════ */

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

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

@keyframes slideOutToLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-24px);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* CLASE PARA ANIMACIÓN DE ENTRADA                                          */
/* ═════════════════════════════════════════════════════════════════════════ */

.todo-task-item {
  animation: fadeInUp 0.3s ease-out forwards;
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* SCROLLBAR PERSONALIZADO                                                  */
/* ═════════════════════════════════════════════════════════════════════════ */

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.5) rgba(100, 116, 139, 0.1);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(100, 116, 139, 0.05);
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.4);
  border-radius: 10px;
  transition: background 0.3s;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* TAREAS: ESTILOS ESPECÍFICOS                                              */
/* ═════════════════════════════════════════════════════════════════════════ */

/* Checkbox personalizado */
.todo-task-checkbox {
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.todo-task-checkbox:checked {
  background-color: #10b981;
  border-color: #10b981;
}

.todo-task-checkbox:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.todo-task-checkbox:hover:not(:checked) {
  border-color: rgb(96, 165, 250);
}

/* Tarea eliminándose */
.todo-task-item.deleting {
  animation: slideOutToLeft 0.3s ease-out forwards;
}

/* Tarea completándose */
.todo-task-item.completing {
  animation: scaleOut 0.3s ease-out forwards;
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* PANELES SELECTORES                                                       */
/* ═════════════════════════════════════════════════════════════════════════ */

.panel-selector {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.panel-selector:hover {
  transform: translateY(-2px);
}

.panel-selector.active {
  animation: fadeInUp 0.3s ease-out;
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* MODALES                                                                   */
/* ═════════════════════════════════════════════════════════════════════════ */

/* Animación de entrada modal */
.animate-in {
  animation: slideInFromBottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-in-95 {
  animation-name: zoomIn;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* AVATAR & FACEPILE                                                        */
/* ═════════════════════════════════════════════════════════════════════════ */

.todo-facepile .todo-avatar {
  transition: all 0.2s;
}

.todo-facepile .todo-avatar:hover {
  transform: scale(1.1) translateZ(0);
  z-index: 10;
}

.todo-facepile .todo-avatar:nth-child(2) {
  margin-left: -12px;
}

.todo-facepile .todo-avatar:nth-child(3) {
  margin-left: -12px;
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* BOTONES & INTERACTIVIDAD                                                 */
/* ═════════════════════════════════════════════════════════════════════════ */

/* Botones de acción en tareas */
.todo-task-item button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.todo-task-item button:active {
  transform: scale(0.95);
}

/* Estados de grab button */
#todo-record-btn:active {
  animation: pulse-glow 1s infinite;
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* INDICADORES & BADGES                                                     */
/* ═════════════════════════════════════════════════════════════════════════ */

#active-count-badge,
#completed-count-badge {
  transition: all 0.3s;
}

/* Bounce cuando se añade tarea */
.badge-bounce {
  animation: bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* INDICADOR DE GRABACIÓN                                                   */
/* ═════════════════════════════════════════════════════════════════════════ */

#todo-recording-state {
  animation: slideInFromBottom 0.3s ease-out;
}

#todo-recording-state .animate-bounce {
  animation: bounce 1s infinite;
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* TRANSICIONES SUAVES                                                      */
/* ═════════════════════════════════════════════════════════════════════════ */

/* Fade in/out general */
.animate-fade-in {
  animation: fadeInUp 0.3s ease-out;
}

.animate-fade-out {
  animation: slideOutToLeft 0.2s ease-in forwards;
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* FORMULARIOS & INPUTS                                                     */
/* ═════════════════════════════════════════════════════════════════════════ */

textarea:focus,
input:focus {
  outline: none;
}

/* Placeholder en mobile más visible */
@media (max-width: 640px) {
  textarea::placeholder,
  input::placeholder {
    color: rgb(148, 163, 184);
    font-weight: 500;
  }
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE & MOBILE                                                      */
/* ═════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  /* Modales en mobile: full-width con bordes redondeados solo arriba */
  .animate-in.slide-in-from-bottom-8 {
    border-radius: 24px 24px 0 0;
  }

  /* Botones táctiles: asegurar 44x44px mínimo */
  button, [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Input más grande en mobile */
  #todo-input {
    font-size: 16px; /* Evita zoom en algunos navegadores */
  }

  /* Menos padding en mobile */
  .max-w-4xl {
    padding: 0.75rem;
  }
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* THEME: DARK MODE SUPPORT (OPCIONAL)                                      */
/* ═════════════════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  #todo-container {
    background: linear-gradient(to bottom, rgb(15, 23, 42), rgb(30, 41, 59));
    color: rgb(226, 232, 240);
  }

  .bg-white {
    background-color: rgb(30, 41, 59);
  }

  .border-slate-100 {
    border-color: rgb(51, 65, 85);
  }

  .text-slate-700,
  .text-slate-800 {
    color: rgb(226, 232, 240);
  }

  .bg-slate-50 {
    background-color: rgb(51, 65, 85);
  }

  .text-slate-400 {
    color: rgb(148, 163, 184);
  }
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* ADAPTACIÓN SIDEBAR QUICK ACCESS                                          */
/* ═════════════════════════════════════════════════════════════════════════ */

#todo-quick-access-sidebar .w-8 {
    background-color: rgba(37, 99, 235, 0.1); /* blue-600 op 10% */
}

#todo-quick-access-sidebar:hover .w-8 {
    background-color: #2563eb; /* blue-600 */
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* REDISEÑO: PIZARRAS DINÁMICAS (HUB)                                       */
/* ═════════════════════════════════════════════════════════════════════════ */

.smart-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.smart-card:active {
    transform: scale(0.95);
}

.board-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

.board-card:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
    transform: translateY(-2px);
}

/* Ocultar elementos suavemente */
.hidden {
    display: none !important;
}

/* ═════════════════════════════════════════════════════════════════════════ */
/* UTILIDADES ESPECIALES                                                    */
/* ═════════════════════════════════════════════════════════════════════════ */

/* Para cuando se vacía la lista de tareas */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  opacity: 0.6;
}

/* Line clamp para descriptions */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Truncate text */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Smooth transitions */
* {
  transition-property: color, background-color, border-color, box-shadow;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

button, [role="button"], input, textarea, select {
  transition-duration: 200ms;
}
