:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --bg-gradient-1: #8ec5fc;
  --bg-gradient-2: #e0c3fc;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.8);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Dark mode variables */
[data-theme="dark"] {
  --primary-color: #818cf8;
  --primary-hover: #6366f1;
  --bg-gradient-1: #1e293b;
  --bg-gradient-2: #0f172a;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(51, 65, 85, 0.8);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --danger: #f87171;
  --success: #4ade80;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  overflow-x: hidden;
  color: var(--text-primary);
  transition:
    background 0.5s ease,
    color 0.3s ease;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.theme-toggle-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
  background: rgba(99, 102, 241, 0.2);
}

.theme-toggle-btn .fa-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle-btn .fa-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle-btn .fa-moon {
  display: none;
}

/* Background animated shapes */
.background-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.shape {
  position: absolute;
  filter: blur(50px);
  border-radius: 50%;
  opacity: 0.6;
  animation: float 20s infinite alternate;
}

.shape-1 {
  top: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: linear-gradient(to bottom right, #a18cd1, #fbc2eb);
}

.shape-2 {
  bottom: -10%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: linear-gradient(to top right, #84fab0, #8fd3f4);
  animation-delay: -5s;
}

.shape-3 {
  top: 40%;
  left: 40%;
  width: 300px;
  height: 300px;
  background: linear-gradient(to top left, #fccb90, #d57eeb);
  animation-delay: -10s;
}

[data-theme="dark"] .shape-1 {
  background: linear-gradient(to bottom right, #4f46e5, #7c3aed);
}

[data-theme="dark"] .shape-2 {
  background: linear-gradient(to top right, #0ea5e9, #3b82f6);
}

[data-theme="dark"] .shape-3 {
  background: linear-gradient(to top left, #f59e0b, #d946ef);
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  100% {
    transform: translate(30px, 50px) rotate(10deg);
  }
}

/* Main Container */
.container {
  width: 90%;
  max-width: 500px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition:
    transform 0.3s ease,
    background 0.5s ease,
    border-color 0.5s ease;
}

.container:hover {
  transform: translateY(-5px);
}

header {
  margin-bottom: 2rem;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, #1e293b, #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] header h1 {
  background: linear-gradient(45deg, #f1f5f9, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#date-display {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

/* Input Area */
.input-group {
  display: flex;
  position: relative;
  margin-bottom: 1.5rem;
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition:
    box-shadow 0.3s ease,
    background 0.3s ease;
}

[data-theme="dark"] .input-group {
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.input-group:focus-within {
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
}

input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  background: transparent;
  border-radius: 15px 0 0 15px;
  color: var(--text-primary);
}

input::placeholder {
  color: #94a3b8;
}

#add-btn {
  border: none;
  background: var(--primary-color);
  color: white;
  width: 60px;
  border-radius: 0 15px 15px 0;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.1s;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
}

#add-btn:hover {
  background: var(--primary-hover);
}

#add-btn:active {
  transform: scale(0.95);
}

/* Filters */
.filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

/* Todo List */
.todo-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Scrollbar aesthetic */
.todo-list::-webkit-scrollbar {
  width: 6px;
}

.todo-list::-webkit-scrollbar-track {
  background: transparent;
}

.todo-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

[data-theme="dark"] .todo-list::-webkit-scrollbar-thumb {
  background: #475569;
}

.todo-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideIn 0.3s ease forwards;
}

[data-theme="dark"] .todo-item {
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.todo-item.completed {
  background: #f8fafc;
  opacity: 0.8;
}

[data-theme="dark"] .todo-item.completed {
  background: rgba(30, 41, 59, 0.5);
}

.todo-item.completed span {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.checkbox {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  margin-right: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

[data-theme="dark"] .checkbox {
  border-color: #475569;
}

.checkbox:checked {
  background-color: var(--success);
  border-color: var(--success);
}

.checkbox:checked::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: white;
  font-size: 14px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.todo-text {
  flex: 1;
  font-size: 1.05rem;
  word-break: break-all;
}

.timer-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-right: 1rem;
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 8px;
  font-family: "Monaco", "Consolas", monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

[data-theme="dark"] .timer-container {
  background: rgba(30, 41, 59, 0.7);
}

.timer-display {
  min-width: 65px;
  text-align: center;
}

.timer-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.timer-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

.todo-item.timer-active {
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.todo-item.timer-active .timer-btn {
  color: var(--primary-color);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

.delete-btn {
  border: none;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 1rem;
  padding: 5px;
  transition: color 0.2s;
  opacity: 0;
}

[data-theme="dark"] .delete-btn {
  color: #64748b;
}

.todo-item:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  color: var(--danger);
  transform: scale(1.1);
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

[data-theme="dark"] .status-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#clear-completed {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

#clear-completed:hover {
  color: var(--danger);
}

/* Animations for removing */
.fall {
  transform: translateX(10rem) rotateZ(20deg);
  opacity: 0;
}

@media (max-width: 480px) {
  .container {
    width: 95%;
    padding: 1.5rem;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
  }

  .theme-toggle-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}
