/* @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap"); */

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

:root {
  --bg-main: #0b1120;
  --bg-card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);

  --primary: #6366f1;
  --primary-soft: rgba(99, 239, 241, 0.2);

  --danger: #f87171;

  --text: #e5e7eb;
  --muted: #94a3b8;

  --radius: 1.4rem;
}

html {
  font-size: 62.5%;
}

body {
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  display: grid;
  place-items: center;

  padding: clamp(1.5rem, 4vw, 3rem);

  background:
    radial-gradient(circle at top, #1e293b, transparent 60%),
    linear-gradient(135deg, #020617, #0b1120);

  color: var(--text);
}

.app {
  width: 100%;
  max-width: 46rem;

  padding: clamp(2rem, 4vw, 3rem);
  border-radius: var(--radius);

  background: var(--bg-card);
  backdrop-filter: blur(20px);

  border: 1px solid var(--border);

  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.6),
    inset 0 0 0.5px rgba(255, 255, 255, 0.1);

  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 3vw, 2.2rem);
}

.header h1 {
  font-size: clamp(2.6rem, 4vw, 3.2rem);
}

.header p {
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  color: var(--muted);
}

/* INPUT */
.input-section {
  display: flex;
  gap: 1rem;
}

input {
  flex: 1;
  padding: clamp(1.1rem, 2.5vw, 1.3rem);
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: clamp(1.3rem, 2vw, 1.5rem);
  transition: 0.25s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* BUTTON */
button {
  min-width: clamp(4rem, 10vw, 4.5rem);
  border-radius: var(--radius);
  border: none;
  background: var(--primary);
  color: white;
  font-size: clamp(1.6rem, 3vw, 2rem);
  cursor: pointer;
  transition: 0.25s;
  /* padding: 1rem; */
}

#addButton {
  padding: 1rem;
}

button:hover {
  transform: scale(1.08);
}

/* TODO */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-transform: capitalize;
}

.todo {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: clamp(1rem, 2.5vw, 1.4rem);
  border-radius: var(--radius);

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);

  transition: 0.25s;
}

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

/* TEXT */
.todo-text {
  font-size: clamp(1.3rem, 2vw, 1.5rem);
  cursor: pointer;
  position: relative;
}

/* ✅ COMPLETED STRIKE ANIMATION */
.completed {
  opacity: 0.6;
  color: var(--muted);
}

.completed::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  background: var(--muted);
  transform: scaleX(1);
  transform-origin: left;
}

/* DELETE */
.deleteButton {
  background: transparent;
  color: var(--danger);
  font-size: 1.5rem;
}

.deleteButton:hover {
  transform: scale(1.1);
}

/* MOBILE */
@media (max-width: 480px) {
  .input-section {
    flex-direction: column;
  }
}

.todo {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
}

.edit-input {
  flex: 1;
  padding: 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid #6366f1;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-size: 1.4rem;
}

.error {
  border-color: red !important;
}
