/* ════════════════════════════════════════════
   Neo-Brutalism To-Do  ·  styles.css
   ════════════════════════════════════════════ */

@font-face {
  font-family: 'ThmanyahSerif';
  src: url('fonts/thmanyahseriftext-Bold.woff2') format('woff2');
  font-weight: bold;
  font-style: normal;
}

:root {
  --bg:        #f4e9d8;   /* cream paper background          */
  --ink:       #111111;   /* hard black for borders & text   */
  --paper:     #ffffff;   /* card surface                    */

  --purple:    #b9a3ff;   /* list 1 accent block             */
  --purple-hi: #8a6dff;
  --pink:      #ff9ecb;   /* list 2 accent block             */
  --pink-hi:   #ff5fa6;
  --yellow:    #ffd23f;   /* primary action                  */
  --green:     #6fe09a;   /* save / success                  */
  --red:       #ff6b5e;   /* delete                          */
  --blue:      #6fb7ff;   /* restore                         */

  --bd:        3px solid var(--ink);
  --bd-thick:  4px solid var(--ink);
  --sh:        6px 6px 0 var(--ink);
  --sh-sm:     4px 4px 0 var(--ink);
  --sh-lg:     10px 10px 0 var(--ink);
  --radius:    14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
  font-family: 'ThmanyahSerif', 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--bg);
  /* faint dotted grid for that brutalist paper feel */
  background-image: radial-gradient(var(--ink) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  background-position: -13px -13px;
  min-height: 100dvh;
  padding: 48px 24px 72px;
  color: var(--ink);
  width: 100%;
  max-width: 100vw;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.lists-wrapper {
  display: flex;
  gap: 40px;
  width: 100%;
  max-width: 1000px;
  align-items: flex-start;
}

/* ── Container blocks ── */
.container {
  flex: 1;
  min-width: 0;
  width: 0;
  border: var(--bd-thick);
  border-radius: var(--radius);
  padding: 26px 22px 30px;
  box-shadow: var(--sh-lg);
}

.purple.container { background: var(--purple); }
.pink.container   { background: var(--pink); }

/* ── Header ── */
header { margin-bottom: 26px; }

header h1 {
  display: inline-block;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  background: var(--paper);
  border: var(--bd);
  border-radius: 10px;
  padding: 8px 16px;
  box-shadow: var(--sh-sm);
  transform: rotate(-1.5deg);
}

.pink header h1 { transform: rotate(1.5deg); }

/* ── Input ── */
.input-box {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.input-box input {
  flex: 1;
  padding: 14px 18px;
  border: var(--bd);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--sh-sm);
  transition: transform 0.1s, box-shadow 0.1s;
  direction: rtl;
}

.input-box input::placeholder { color: #8a8a8a; }

.input-box input:focus {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.input-box button {
  min-width: 56px;
  min-height: 56px;
  padding: 0 18px;
  color: var(--ink);
  border: var(--bd);
  border-radius: 12px;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  box-shadow: var(--sh-sm);
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: manipulation;
}

.input-box button { background: var(--yellow); }

.input-box button:hover  { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.input-box button:active { transform: translate(3px, 3px);   box-shadow: 1px 1px 0 var(--ink); }

/* ── Section titles ── */
.section-title {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--paper);
  border: var(--bd);
  border-radius: 8px;
  padding: 5px 12px;
  margin-bottom: 14px;
  box-shadow: 3px 3px 0 var(--ink);
}

/* ── Task card ── */
.task {
  background: var(--paper);
  border: var(--bd);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--sh-sm);
  transition: transform 0.12s, box-shadow 0.12s;
  animation: slideIn 0.22s ease;
}

.task:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

@keyframes slideIn {
  from { opacity: 0; transform: translate(0, 10px); }
  to   { opacity: 1; transform: translate(0, 0); }
}

/* ── Checkbox ── */
.check-btn {
  width: 42px;
  height: 42px;
  border: var(--bd);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
  touch-action: manipulation;
}

.purple .check-btn:hover { background: var(--purple-hi); color: #fff; }
.pink   .check-btn:hover { background: var(--pink-hi);   color: #fff; }
.check-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

/* ── Task text ── */
.task-text {
  flex: 1 1 130px;
  min-width: 120px;
  font-size: 0.98rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.task-text input {
  width: 100%;
  border: none;
  border-bottom: 2.5px solid var(--ink);
  outline: none;
  font-size: 16px;
  font-family: inherit;
  background: transparent;
  color: var(--ink);
  padding-bottom: 3px;
  direction: rtl;
}

/* ── Action buttons ── */
.task-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

.task-actions button {
  width: 42px;
  height: 42px;
  border: var(--bd);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: manipulation;
}

.task-actions button:hover  { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.task-actions button:active { transform: translate(2px, 2px);   box-shadow: 0 0 0 var(--ink); }

.btn-edit    { background: var(--yellow); }
.btn-save    { background: var(--green); }
.btn-delete  { background: var(--red); }
.btn-restore { background: var(--blue); }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 26px 14px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--paper);
  border: 3px dashed var(--ink);
  border-radius: 12px;
}

.empty span { display: block; font-size: 2.1rem; margin-bottom: 8px; }

/* ── Divider ── */
.divider {
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
  margin: 30px 0 22px;
}

/* ── History header ── */
.history-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.history-header .section-title { margin-bottom: 0; }

.history-actions { display: flex; gap: 8px; }

.toggle-history,
.clear-btn {
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 7px 12px;
  border: var(--bd);
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.08s, box-shadow 0.08s;
  touch-action: manipulation;
}

.toggle-history { background: var(--paper); color: var(--ink); }
.clear-btn      { background: var(--red);   color: var(--ink); }

.toggle-history:hover,
.clear-btn:hover  { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.toggle-history:active,
.clear-btn:active { transform: translate(2px, 2px);   box-shadow: 0 0 0 var(--ink); }

.history-list.hidden { display: none; }

/* ── Done task ── */
.task.done {
  background: var(--bg);
}

.task.done .task-text {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: #555;
}

.purple .task.done .check-btn { background: var(--purple-hi); color: #fff; }
.pink   .task.done .check-btn { background: var(--pink-hi);   color: #fff; }

.done-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 0 8px;
  min-width: 22px;
  height: 20px;
  margin-right: 8px;
}

.purple .badge { background: var(--purple-hi); color: #fff; }
.pink   .badge { background: var(--pink-hi);   color: #fff; }

/* ── Toast ── */
.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-140px) rotate(-2deg);
  padding: 14px 28px;
  border: var(--bd-thick);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--sh);
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0) rotate(-2deg);
  opacity: 1;
}

.toast.purple-toast { background: var(--purple); }
.toast.pink-toast   { background: var(--pink); }

.toast-icon {
  font-size: 1.5rem;
  animation: toastBounce 0.6s ease infinite alternate;
}

@keyframes toastBounce {
  from { transform: translateY(0)  rotate(-6deg); }
  to   { transform: translateY(-4px) rotate(6deg); }
}

/* ── Confetti particle ── */
.confetti-particle {
  position: fixed;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--ink);
  pointer-events: none;
  z-index: 9998;
  animation: confettiFall var(--dur) ease forwards;
}

@keyframes confettiFall {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.4); opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 760px) {
  body { padding: 20px 14px 48px; }
  .lists-wrapper { flex-direction: column; gap: 30px; }
  .container { width: 100%; padding: 22px 16px 26px; box-shadow: var(--sh); }
  header h1 { font-size: 1.55rem; }
}
