/* website/static/css/components/checklist.css */

/* ------------------------------------------------------------
   📝 CHECKLIST — Luxury Glass System Styling
   ------------------------------------------------------------ */

/* ---------- Layout Containers ---------- */
.checklist-shell,
.history-shell {
  max-width: 900px;
  margin: 0 auto;
}

/* ---------- Add Card ---------- */
.add-card {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Inputs inside add-row */
#task-input,
#deadline-input,
#checklist-tag-input {
  flex: 1;
  min-width: 200px;
}

/* ------------------------------------------------------------
   TAG INPUT (clean override, no unnecessary hacks)
   ------------------------------------------------------------ */

#checklist-tag-input {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;

  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 12px;

  border: none;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);

  color: #222;
  font-size: 1rem;
  text-align: right;
  box-sizing: border-box;
}

#checklist-tag-input::placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #666;
}

/* ------------------------------------------------------------
   FIX FOR THE WHITE PIPE (REAL FIX)
   ------------------------------------------------------------ */

/* When suggestions list is empty → hide it completely */
#checklist-tag-suggestions:empty {
  display: none;
  border: none;
  padding: 0;
  height: 0;
}

/* Suggestions box when visible */
#checklist-tag-suggestions {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  padding: 6px 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  max-height: 180px;
  overflow-y: auto;
}

/* Suggestions items */
#checklist-tag-suggestions li {
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#checklist-tag-suggestions li:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Chips */
#checklist-tag-chips {
  margin-top: 6px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips .chip {
  background: rgba(0, 0, 0, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-remove {
  cursor: pointer;
  font-weight: bold;
  opacity: 0.7;
}

.chip-remove:hover {
  opacity: 1;
}

/* ------------------------------------------------------------
   Checklist Items
   ------------------------------------------------------------ */

.beautiful-list {
  margin-top: 20px;
}

.checklist-item {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  transition: transform 0.15s ease, background 0.2s ease;
}

.checklist-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.45);
}

.checklist-item.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

/* Details */
.item-details {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.deadline {
  font-size: 0.9rem;
  color: #444;
}

.remaining {
  font-size: 0.85rem;
  color: #666;
}

/* Actions */
.checklist-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.checklist-actions button {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
}

/* Tags inside items */
.tags {
  font-size: 0.85rem;
  color: #555;
}

/* ------------------------------------------------------------
   Empty State
   ------------------------------------------------------------ */

.empty-state {
  text-align: center;
  padding: 20px;
  font-size: 1rem;
  opacity: 0.7;
}

/* ------------------------------------------------------------
   History Box
   ------------------------------------------------------------ */

.history-box {
  margin-top: 30px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.small-history-item {
  font-size: 0.9rem;
}

/* ------------------------------------------------------------
   Animations
   ------------------------------------------------------------ */

.animate-fade-in {
  animation: fadeIn 0.35s ease forwards;
}

.fade-out {
  animation: fadeOut 0.35s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

/* ------------------------------------------------------------
   RESPONSIVE — Multi‑Breakpoint
   ------------------------------------------------------------ */

/* Ultra‑wide desktops (≥1600px) */
@media (min-width: 1600px) {
  .checklist-shell {
    max-width: 1200px;
  }

  .add-row {
    gap: 20px;
  }

  #task-input,
  #deadline-input,
  #checklist-tag-input {
    font-size: 1.1rem;
    padding: 14px 18px;
  }

  .checklist-item {
    padding: 20px 24px;
    font-size: 1.05rem;
  }
}

/* Large desktops (≥1400px) */
@media (min-width: 1400px) and (max-width: 1599px) {
  .checklist-shell {
    max-width: 1100px;
  }

  .checklist-item {
    padding: 18px 20px;
  }
}

/* Desktops (≥1200px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .checklist-shell {
    max-width: 1000px;
  }

  .add-row {
    gap: 16px;
  }
}

/* Laptops (≥992px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .checklist-shell {
    max-width: 900px;
  }

  .add-row {
    gap: 14px;
  }

  #task-input,
  #deadline-input {
    min-width: 260px;
  }
}

/* Tablets (≥768px) */
@media (min-width: 768px) and (max-width: 991px) {
  .add-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  #task-input,
  #deadline-input {
    min-width: 48%;
  }

  #checklist-tag-input {
    min-width: 100%;
  }

  .checklist-item {
    padding: 14px 16px;
  }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
  .add-row {
    flex-direction: column;
    gap: 10px;
  }

  #task-input,
  #deadline-input,
  #checklist-tag-input {
    width: 100%;
    min-width: 0;
  }

  .checklist-item {
    padding: 12px;
  }

  .checklist-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .chips {
    gap: 4px;
  }
}

/* Small mobile (≤400px) */
@media (max-width: 400px) {
  .checklist-item {
    padding: 10px;
  }

  .checklist-label {
    font-size: 1rem;
  }

  .deadline,
  .remaining {
    font-size: 0.8rem;
  }

  .checklist-actions button {
    font-size: 0.75rem;
    padding: 3px 8px;
  }

  #checklist-tag-input {
    font-size: 0.9rem;
  }
}
