/* Lista de pendientes (todo)
   (archivo: css/components/todo.css) */
/* ============================================================
   TODO FAB
   ============================================================ */
#todo-fab {
  position: fixed;
  bottom: 62px;
  right: 18px;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #111;
  border: 1px solid #2e2e2e;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, opacity .2s, border-color .2s;
  font-family: 'Fredoka One', cursive;
  animation: fabAppear .35s cubic-bezier(.34,1.56,.64,1) both;
  opacity: 0.45;
}
#todo-fab:hover {
  opacity: 1;
  transform: scale(1.12);
  border-color: #444;
  box-shadow: 0 0 14px rgba(57,255,20,0.2), 0 4px 12px rgba(0,0,0,0.6);
}
#todo-fab:active { transform: scale(0.93); }
#todo-fab.hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }
.todo-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--green-done);
  color: #000;
  font-family: 'Fredoka One', cursive;
  font-size: 0.6rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   TODO BACKDROP
   ============================================================ */
#todo-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 450;
  background: rgba(0,0,0,0.78);
  animation: fadeInDetail .2s ease;
}
#todo-backdrop.open { display: block; }

/* ============================================================
   TODO PANEL
   ============================================================ */
#todo-panel {
  position: fixed;
  top: 0;
  right: -600px;
  width: 560px;
  max-width: 95vw;
  height: 100vh;
  z-index: 460;
  background: #0d0d0d;
  border-left: 3px solid var(--yellow-bright);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.8);
  transition: right .32s cubic-bezier(.4,0,.2,1);
}
#todo-panel.open { right: 0; }

#todo-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(90deg, #111000 0%, #1a1800 100%);
  border-bottom: 2px solid #2a2400;
  flex-shrink: 0;
}
#todo-panel-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: var(--yellow-bright);
  text-shadow: 0 0 14px rgba(255,215,0,0.35);
  letter-spacing: 1.5px;
}
#btn-close-todo {
  background: #1a0404;
  color: var(--red-close);
  border: 2px solid #3d0a0a;
  border-radius: 10px;
  width: 34px; height: 34px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  transition: filter .15s, transform .1s;
  display: flex; align-items: center; justify-content: center;
}
#btn-close-todo:hover  { background: #2a0606; filter: brightness(1.2); }
#btn-close-todo:active { transform: scale(0.91); }

#todo-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 6px;
  scrollbar-width: thin;
  scrollbar-color: #3a2e00 transparent;
  min-height: 0;
}
#todo-panel-body::-webkit-scrollbar { width: 5px; }
#todo-panel-body::-webkit-scrollbar-thumb { background: #3a2e00; border-radius: 3px; }

#todo-panel-footer {
  padding: 12px 14px;
  background: #0a0a0a;
  border-top: 2px solid #1c1c00;
  flex-shrink: 0;
}
#btn-todo-add {
  width: 100%;
  background: #111800;
  border: 2px solid #2a3500;
  border-radius: 10px;
  color: var(--yellow-bright);
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  padding: 10px 0;
  cursor: pointer;
  letter-spacing: .5px;
  transition: background .18s, border-color .18s, filter .15s, transform .1s;
  box-shadow: 0 2px 0 #000;
}
#btn-todo-add:hover {
  background: #1e2800;
  border-color: var(--yellow-bright);
  filter: brightness(1.12);
}
#btn-todo-add:active { transform: scale(0.97); }

/* ── Empty state ── */
#todo-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  gap: 8px;
  text-align: center;
}
.todo-empty-icon { font-size: 3rem; }
.todo-empty-text {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  color: var(--text-muted);
}
.todo-empty-sub {
  font-size: 0.82rem;
  color: #444;
  font-family: 'Fredoka', sans-serif;
}

/* ============================================================
   TODO LIST ITEMS (draggable)
   ============================================================ */
#todo-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 2px solid #222;
  border-radius: 10px;
  padding: 7px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: border-color .2s, box-shadow .2s, opacity .2s, transform .18s;
  animation: missionSlide .25s ease both;
  cursor: default;
  user-select: none;
}
.todo-item.dragging {
  opacity: 0.55;
  border-color: var(--yellow-bright);
  box-shadow: 0 0 14px rgba(255,215,0,0.3), 0 4px 14px rgba(0,0,0,0.6);
  transform: scale(1.02);
}
.todo-item.drag-over {
  border-color: var(--yellow-mid);
  box-shadow: 0 0 10px rgba(255,215,0,0.2);
}
.todo-item.removing {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity .25s ease, transform .25s ease;
}

/* Position number */
.todo-pos {
  font-family: 'Fredoka One', cursive;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Drag handle — 3 horizontal lines */
.todo-drag-handle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: grab;
  padding: 4px 5px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity .15s;
}
.todo-drag-handle:hover { opacity: 1; }
.todo-drag-handle:active { cursor: grabbing; }
.todo-drag-handle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #888;
  border-radius: 2px;
}

/* Banner thumbnail */
.todo-glove-img {
  width: 90px;
  height: 58px;
  object-fit: cover;
  border-radius: 7px;
  border: 2px solid #222;
  background: #111;
  flex-shrink: 0;
}

/* Item name + progress */
.todo-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.todo-item-name {
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.todo-item-prog {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Fredoka', sans-serif;
}

/* Ver más button */
.todo-btn-open {
  background: var(--yellow-bright);
  color: #111;
  border: 2px solid #000;
  border-radius: 6px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.72rem;
  padding: 5px 8px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 0 #000;
  transition: filter .15s, transform .1s;
  white-space: nowrap;
}
.todo-btn-open:hover  { filter: brightness(1.2); }
.todo-btn-open:active { transform: scale(0.93); }

/* Complete button */
.todo-btn-complete {
  background: #0b1f0b;
  color: var(--green-done);
  border: 2px solid #1a3a1a;
  border-radius: 6px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.85rem;
  padding: 5px 7px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 0 #000;
  transition: filter .15s, transform .1s, background .18s, border-color .18s;
}
.todo-btn-complete:hover {
  background: #0f2a0f;
  border-color: var(--green-done);
  filter: brightness(1.2);
}
.todo-btn-complete:active { transform: scale(0.9); }

/* ============================================================
   TODO SELECTION MODE
   ============================================================ */
#todo-select-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 470;
  pointer-events: none;
}
#todo-select-overlay.active { display: block; }

/* Top banner */
#todo-select-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 471;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #0a1200, #1a2100);
  border-bottom: 3px solid var(--yellow-bright);
  padding: 12px 20px;
  pointer-events: all;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  animation: slideDown .25s ease both;
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
#todo-select-info {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  color: var(--text-light);
}
#todo-select-info strong {
  font-family: 'Fredoka One', cursive;
  color: var(--yellow-bright);
  font-size: 1.1rem;
}
#btn-todo-cancel-select {
  background: #1a0404;
  color: var(--red-close);
  border: 2px solid #3d0a0a;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: 'Fredoka One', cursive;
  font-size: 0.85rem;
  cursor: pointer;
  pointer-events: all;
  transition: filter .15s, transform .1s;
}
#btn-todo-cancel-select:hover  { filter: brightness(1.2); }
#btn-todo-cancel-select:active { transform: scale(0.92); }

/* Confirm add button — fixed bottom center */
#btn-todo-confirm {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 472;
  background: #0b2e0b;
  color: var(--green-done);
  border: 3px solid var(--green-done);
  border-radius: 14px;
  padding: 13px 36px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  pointer-events: all;
  box-shadow: var(--shadow-green), 0 6px 18px rgba(0,0,0,0.6);
  box-shadow: 0 0 18px rgba(57,255,20,0.4), 0 6px 18px rgba(0,0,0,0.6);
  transition: filter .15s, transform .12s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  letter-spacing: .5px;
  animation: fabAppear .3s ease both;
}
#btn-todo-confirm:hover {
  filter: brightness(1.2);
  transform: translateX(-50%) scale(1.06);
  box-shadow: 0 0 28px rgba(57,255,20,0.6), 0 8px 22px rgba(0,0,0,0.7);
}
#btn-todo-confirm:active { transform: translateX(-50%) scale(0.95); }

/* Card selection highlight */
.mastery-card.todo-selectable {
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, border-color .2s;
}
.mastery-card.todo-selectable:hover {
  transform: translateY(-4px) scale(1.018);
  border-color: #555;
}
.mastery-card.todo-selected {
  border-color: var(--yellow-bright) !important;
  box-shadow: 0 0 18px rgba(255,215,0,0.5), var(--shadow-card) !important;
  transform: scale(1.02) !important;
}
.mastery-card.todo-selected .card-footer::after {
  content: '✓ SELECCIONADA';
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Fredoka One', cursive;
  font-size: 0.8rem;
  color: var(--yellow-bright);
  letter-spacing: 1px;
  padding: 4px 0 2px;
  border-top: 2px solid #2a2000;
  margin-top: 6px;
}
/* Push grid down to make room for the top banner */
body.todo-selecting #grid-view { padding-top: 72px; }

