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

:root {
  /* Dark theme gradients */
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  /* Color palette */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Column-specific colors */
  --todo-color: #ef4444;
  --todo-glow: rgba(239, 68, 68, 0.3);
  --progress-color: #3b82f6;
  --progress-glow: rgba(59, 130, 246, 0.3);
  --review-color: #f59e0b;
  --review-glow: rgba(245, 158, 11, 0.3);
  --done-color: #10b981;
  --done-glow: rgba(16, 185, 129, 0.3);

  /* UI colors */
  --card-bg: rgba(30, 41, 59, 0.6);
  --card-border: rgba(148, 163, 184, 0.1);
  --hover-bg: rgba(51, 65, 85, 0.8);

  /* Sizes */
  --task-size: 56px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
}

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  overflow-x: hidden;
}

/* Animated background particles */
body::before {
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  33% {
    transform: translate(30px, -30px);
  }

  66% {
    transform: translate(-20px, 20px);
  }
}

h1 {
  margin: 2.5rem 0 2rem;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f1f5f9 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  animation: slideDown 0.6s ease-out;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

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

.container {
  width: min(1400px, 95%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

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

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

.column {
  flex: 1;
  display: grid;
  grid-template-rows: var(--task-size) 1fr;
  gap: 1rem;
  animation: fadeInUp 0.6s ease-out backwards;
}

.column:nth-child(1) {
  animation-delay: 0.1s;
}

.column:nth-child(2) {
  animation-delay: 0.2s;
}

.column:nth-child(3) {
  animation-delay: 0.3s;
}

.column:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.column-title {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}

/* Column-specific styling */
.column:nth-child(1) .column-title {
  border-bottom: 2px solid var(--todo-color);
  box-shadow: 0 4px 20px var(--todo-glow);
}

.column:nth-child(2) .column-title {
  border-bottom: 2px solid var(--progress-color);
  box-shadow: 0 4px 20px var(--progress-glow);
}

.column:nth-child(3) .column-title {
  border-bottom: 2px solid var(--review-color);
  box-shadow: 0 4px 20px var(--review-glow);
}

.column:nth-child(4) .column-title {
  border-bottom: 2px solid var(--done-color);
  box-shadow: 0 4px 20px var(--done-glow);
}

.column-title h3 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}

.column-title h3::after {
  content: attr(data-tasks);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: 0.5rem;
  border-radius: 6px;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.column:nth-child(1) .column-title h3::after {
  background: linear-gradient(135deg, var(--todo-color), #dc2626);
  color: white;
  box-shadow: 0 2px 8px var(--todo-glow);
}

.column:nth-child(2) .column-title h3::after {
  background: linear-gradient(135deg, var(--progress-color), #2563eb);
  color: white;
  box-shadow: 0 2px 8px var(--progress-glow);
}

.column:nth-child(3) .column-title h3::after {
  background: linear-gradient(135deg, var(--review-color), #d97706);
  color: white;
  box-shadow: 0 2px 8px var(--review-glow);
}

.column:nth-child(4) .column-title h3::after {
  background: linear-gradient(135deg, var(--done-color), #059669);
  color: white;
  box-shadow: 0 2px 8px var(--done-glow);
}

.column-title button {
  margin-left: auto;
  font-size: 1.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-primary);
}

.column-title button:hover {
  background: rgba(148, 163, 184, 0.1);
}

.tasks {
  min-height: 200px;
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.2);
  border-radius: var(--border-radius);
  border: 2px dashed var(--card-border);
  transition: all 0.3s ease;
}

.tasks:has(.task) {
  border-style: solid;
}

.tasks>* {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  min-height: var(--task-size);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: taskAppear 0.4s ease-out;
}

@keyframes taskAppear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.task {
  cursor: move;
  color: var(--text-primary);
  line-height: 1.6;
}

.task::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--border-radius) 0 0 var(--border-radius);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.column:nth-child(1) .task::before {
  background: linear-gradient(135deg, var(--todo-color), #dc2626);
}

.column:nth-child(2) .task::before {
  background: linear-gradient(135deg, var(--progress-color), #2563eb);
}

.column:nth-child(3) .task::before {
  background: linear-gradient(135deg, var(--review-color), #d97706);
}

.column:nth-child(4) .task::before {
  background: linear-gradient(135deg, var(--done-color), #059669);
}

.task.dragging {
  cursor: grabbing;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  background: rgba(51, 65, 85, 0.9);
  opacity: 0.8;
  transform: rotate(3deg) scale(1.05);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.task.dragging * {
  visibility: hidden;
}

.task:not(.dragging):hover {
  background: var(--hover-bg);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.task:not(.dragging):hover::before {
  opacity: 1;
}

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

.task button {
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.task button:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.3);
}

.task button[data-delete]:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.task button[data-edit]:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.task-input {
  outline: none;
  overflow-wrap: anywhere;
  padding-left: 2.5rem;
  color: var(--text-primary);
  background: rgba(51, 65, 85, 0.5) !important;
  border: 2px solid rgba(99, 102, 241, 0.4) !important;
  animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
  from {
    border-color: var(--card-border);
  }

  to {
    border-color: rgba(99, 102, 241, 0.4);
  }
}

.task-input::before {
  content: "\F392";
  font-family: "bootstrap-icons";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
  color: #6366f1;
  font-size: 1.2rem;
}

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

/* Modal Styles */
.confirm-modal {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(50px) scale(0.9);
  left: 50%;
  top: 50%;
  border: none;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 400px;
}

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

.confirm-modal[open]::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.confirm-modal::backdrop {
  background: rgba(0, 0, 0, 0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.confirm-modal form {
  padding: 2rem;
  color: var(--text-primary);
  text-align: center;
}

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

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 50%;
  border: 2px solid rgba(245, 158, 11, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

.modal-icon i {
  font-size: 2rem;
  color: #f59e0b;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
  }
}

.confirm-modal h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.confirm-modal p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.confirm-modal div.preview {
  font-size: 0.9rem;
  padding: 1rem;
  padding-left: 1rem;
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.1);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  opacity: 0.9;
  color: var(--text-secondary);
  text-align: left;
}

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

.confirm-modal button {
  opacity: 1;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.confirm-modal button i {
  font-size: 1.1rem;
}

.confirm-modal button#cancel {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-primary);
}

.confirm-modal button#cancel:hover {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.confirm-modal button#confirm {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  color: #fff;
}

.confirm-modal button#confirm:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* Responsive improvements */
@media (max-width: 767px) {
  h1 {
    font-size: 2rem;
    margin: 1.5rem 0 1rem;
  }

  .confirm-modal {
    min-width: 90%;
  }

  .column-title h3 {
    font-size: 0.8rem;
  }
}