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

:root {
  --bg-color: aliceblue;
  --text-color: #404040;
  --primary-color: #475569;
  --secondary-color: #cbd5e1;
  --task-color: #f6f6f6;
  --cancel-color: #e5e7eb;
  --confirm-color: #dc2626;
  --confirm-hover-color: #b91c1c;
  --task-size: 48px;
}

* {
  font-family: Mulish, sans-serif;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

h1 {
  margin: 2rem 0;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  outline-color: var(--secondary-color);
  color: var(--primary-color);
  transition: 0.3s;
  opacity: 0.5;
}

button:is(:active, :hover) {
  opacity: 1;
}

.container {
  width: min(1200px, 90%);
  margin: 0 auto;
}

.columns {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .columns {
    flex-direction: row;
  }
}

.column {
  flex: 1;
  display: grid;
  grid-template-rows: var(--task-size) 1fr;
  gap: 0.5rem;
}

.column-title {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--secondary-color);
  color: var(--primary-color);
}

.column-title h3 {
  font-size: 1rem;
  text-transform: uppercase;
}

.column-title h3::after {
  content: attr(data-tasks);
  background: rgb(202, 188, 247);
  margin-left: 0.25rem;
  border-radius: 0.25rem;
  padding: 0 0.25rem;
}

.column-title button {
  margin-left: auto;
  font-size: 2rem;
}

.tasks {
  min-height: var(--task-size);
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.tasks > * {
  background: #fff;
  border-radius: 0.25rem;
  padding: 0.875rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  min-height: var(--task-size);
}

.task {
  cursor: move;
  transition: 0.3s;
}

#name {
  font-size: 1.2rem;
  padding-bottom: 1rem;
}

.task.dragging {
  cursor: default;
  box-shadow: none;
  background: var(--secondary-color);
  opacity: 0.5;
}

.task.dragging * {
  visibility: hidden;
}

.task:not(.dragging):hover {
  background: var(--task-color);
}

.task menu {
  margin-top: 0.875rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.task button {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.25rem;
}

.task-input {
  outline: none;
  overflow-wrap: anywhere;
  padding: 0.5rem 0.5rem 0.5rem; /* Unified padding for better structure */
  border: 1px solid black; /* Explicit border style */
  border-radius: 4px; /* Slightly more rounded corners */
  background-color: #f9f9f9; /* Light background for readability */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
  transition:
    border-color 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out; /* Smooth transition effects */
  margin-bottom: 0.5rem;
}

.task-input:focus {
  border-color: #007bff; /* Highlight border on focus */
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25); /* Enhanced shadow on focus */
}

.task-input:empty::after {
  content: attr(data-placeholder);
  opacity: 0.5;
}

.confirm-modal[open] {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

.confirm-modal {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(50px);
  left: 50%;
  top: 50%;
  border: none;
  border-radius: 0.25rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s allow-discrete;
}

.confirm-modal[open]::backdrop {
  background: rgba(0, 0, 0, 0.25);
}

.confirm-modal::backdrop {
  background: rgba(0, 0, 0, 0);
  transition: all 0.3s allow-discrete;
}

@starting-style {
  .confirm-modal[open] {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(50px);
  }

  .confirm-modal[open]::backdrop {
    background: rgba(0, 0, 0, 0);
  }
}

.confirm-modal form {
  padding: 2rem;
}

.confirm-modal form > *:not(:last-child) {
  margin-bottom: 1rem;
}

.confirm-modal h3 {
  font-size: 1.5rem;
}

.confirm-modal div.preview {
  font-size: 0.875rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--secondary-color);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  opacity: 0.75;
}

.confirm-modal menu {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.confirm-modal button {
  opacity: 1;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.confirm-modal button#cancel {
  border-color: var(--cancel-color);
}

.confirm-modal button#confirm {
  border-color: var(--confirm-color);
  background: var(--confirm-color);
  color: #fff;
}

.confirm-modal button#confirm:hover {
  border-color: var(--confirm-hover-color);
  background: var(--confirm-hover-color);
}

#createButton {
  background-color: green;
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
}

#titleContainer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

#shopButton {
  margin: 2rem 0;
  padding: 10px;
  background-color: gold;
  color: black;
  text-align: center;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}
#ownedButton {
  margin: 2rem 0;
  padding: 10px;
  background-color: green;
  color: white;
  text-align: center;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-right: 2rem;
}

#shopButton:hover {
  background-color: #0056b3;
}

#ownedButton:hover {
  background-color: #0056b3;
}
