/* =============================================
   TASKFLOW — CSS
   Aesthetic: Editorial Brutalist / Bold Minimal
   ============================================= */

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

:root {
  --bg:        #f5f2ec;
  --surface:   #ffffff;
  --ink:       #111111;
  --muted:     #888888;
  --accent:    #ff4d00;
  --accent2:   #1a1a2e;
  --border:    #e0dbd2;
  --done-bg:   #f0ede8;
  --radius:    14px;
  --shadow:    0 4px 24px rgba(0,0,0,0.08);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background-color: var(--bg);
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 80px;
}

/* ---- WRAPPER ---- */
.app-wrapper {
  width: 100%;
  max-width: 560px;
}

/* ---- HEADER ---- */
.app-header {
  margin-bottom: 32px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.logo-chip {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.18em;
  background: var(--ink);
  color: #fff;
  padding: 6px 12px;
  border-radius: 100px;
}

.task-counter {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.main-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(40px, 10vw, 64px);
  font-weight: 800;
  line-height: 1.0;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.accent-word {
  color: var(--accent);
}

/* ---- INPUT SECTION ---- */
.input-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1.5px solid var(--border);
}

.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.task-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.task-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,17,17,0.07);
}

.task-input::placeholder {
  color: var(--muted);
}

.add-btn {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(255,77,0,0.3);
}

.add-btn:hover {
  background: #e04400;
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(255,77,0,0.35);
}

.add-btn:active {
  transform: scale(0.96);
}

.plus-icon {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  margin-top: -2px;
}

/* ---- FILTER BAR ---- */
.filter-bar {
  display: flex;
  gap: 6px;
}

.filter-btn {
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ---- TASK LIST ---- */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- TASK ITEM ---- */
.task-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  animation: slideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition), opacity var(--transition);
}

.task-item:hover {
  box-shadow: var(--shadow);
  border-color: #ccc;
}

.task-item.completed {
  background: var(--done-bg);
  border-color: #ddd;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--muted);
}

.task-item.removing {
  animation: slideOut 0.25s ease forwards;
}

/* Custom Checkbox */
.custom-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: transparent;
}

.custom-checkbox:hover {
  border-color: var(--accent);
}

.custom-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.custom-checkbox.checked::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

/* Task Text */
.task-text {
  flex: 1;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.45;
  transition: color var(--transition);
}

/* Delete Button */
.delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
  opacity: 0;
}

.task-item:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  background: #ffe5de;
  color: var(--accent);
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  color: #ddd;
  animation: pulse 2.5s ease-in-out infinite;
}

.empty-state p {
  font-size: 15px;
}

/* ---- FOOTER ---- */
.app-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.app-footer span {
  font-size: 13px;
  color: var(--muted);
}

.clear-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.clear-btn:hover {
  color: #e04400;
}

/* ---- ANIMATIONS ---- */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 80px;
    margin-bottom: 10px;
  }
  to {
    opacity: 0;
    transform: translateX(30px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.15); }
}

/* ---- PROGRESS BAR ---- */
.progress-section {
  margin-top: 24px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.progress-percent {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff8c5a);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.complete {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.progress-sub {
  font-size: 12px;
  color: var(--muted);
}

/* ---- PRIORITY SELECTOR ---- */
.priority-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.priority-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.priority-options {
  display: flex;
  gap: 6px;
}

.priority-opt {
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
}

.priority-opt:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.priority-opt.active[data-priority="low"] {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}

.priority-opt.active[data-priority="medium"] {
  background: #fef9c3;
  border-color: #eab308;
  color: #854d0e;
}

.priority-opt.active[data-priority="high"] {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

/* ---- PRIORITY TAG ON TASK ---- */
.priority-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 100px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.priority-tag.low {
  background: #dcfce7;
  color: #15803d;
}

.priority-tag.medium {
  background: #fef9c3;
  color: #854d0e;
}

.priority-tag.high {
  background: #fee2e2;
  color: #991b1b;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  body { padding: 32px 12px 60px; }
  .delete-btn { opacity: 1; }
}

