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

:root {
  /* Dark theme (default) */
  --primary: #8a2be2;        /* Vibrant purple */
  --primary-light: #9b4dff;  /* Lighter purple */
  --primary-dark: #6a1b9a;   /* Darker purple */
  --success: #00e676;        /* Bright green */
  --danger: #ff4081;         /* Pink */
  --warning: #ffab00;        /* Bright yellow */
  --text: #e0e0e0;           /* Light gray for text */
  --text-light: #b0b0b0;     /* Lighter gray */
  --background: #121212;     /* Dark background */
  --card: #1e1e1e;           /* Dark card background */
  --shadow: rgba(0, 0, 0, 0.3);
  --accent: #00bcd4;         /* Cyan accent */
  --task-bg: #252525;        /* Task item background */
  --task-done-bg: #2a2a2a;   /* Completed task background */
  --input-bg: #252525;       /* Input background */
  --border-color: rgba(255, 255, 255, 0.05);
  --footer-bg: #1a1a1a;      /* Footer background */
  --footer-border: rgba(255, 255, 255, 0.05);
  --select-bg: #252525;      /* Select dropdown background */
  --select-border: #333;     /* Select dropdown border */
}

.light-theme {
  --primary: #8a2be2;        /* Keep the purple */
  --primary-light: #b088ff;  /* Adjusted lighter purple */
  --primary-dark: #6a1b9a;   /* Keep darker purple */
  --success: #00c853;        /* Adjusted green */
  --danger: #f50057;         /* Adjusted pink */
  --warning: #ff9100;        /* Adjusted yellow */
  --text: #212121;           /* Dark text for light theme */
  --text-light: #616161;     /* Medium gray for light theme */
  --background: #f5f5f5;     /* Light background */
  --card: #ffffff;           /* White card background */
  --shadow: rgba(0, 0, 0, 0.1);
  --accent: #00acc1;         /* Adjusted cyan accent */
  --task-bg: #f9f9f9;        /* Light task item background */
  --task-done-bg: #eeeeee;   /* Light completed task background */
  --input-bg: #ffffff;       /* Light input background */
  --border-color: rgba(0, 0, 0, 0.1);
  --footer-bg: #f0f0f0;      /* Light footer background */
  --footer-border: rgba(0, 0, 0, 0.05);
  --select-bg: #ffffff;      /* Light select dropdown background */
  --select-border: #e0e0e0;  /* Light select dropdown border */
}

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

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, var(--background) 0%, var(--background) 100%);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  perspective: 1000px;
  padding: 1rem;
  transition: background 0.3s ease;
}

.container {
  background: var(--card);
  box-shadow: 
    0 10px 30px var(--shadow),
    0 1px 8px rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  padding: 2rem;
  max-width: 1000px;
  width: 100%;
  text-align: center;
  transform-style: preserve-3d;
  transform: rotateX(5deg);
  transition: transform 0.5s ease, background 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.container:hover {
  transform: rotateX(0deg);
}

header {
  margin-bottom: 1.5rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content {
  text-align: left;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  text-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

header p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  font-weight: 400;
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch {
  display: inline-block;
  height: 28px;
  position: relative;
  width: 50px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: #444;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 28px;
}

.slider:before {
  background-color: #fff;
  bottom: 4px;
  content: "";
  height: 20px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 20px;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider-icons {
  color: var(--text);
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  align-items: center;
  font-size: 14px;
}

.category-filter {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  perspective: 600px;
  flex-wrap: wrap;
}

.category-btn {
  background: transparent;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-light);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  transform-style: preserve-3d;
  border: 1px solid var(--border-color);
}

.category-btn:hover {
  color: var(--primary-light);
  transform: translateZ(5px);
  border-color: rgba(138, 43, 226, 0.3);
}

.category-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.5);
  transform: translateZ(10px);
  border: none;
}

.todo-input {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.5rem;
  margin-bottom: 1rem;
  position: relative;
  transform-style: preserve-3d;
}

#task-input {
  grid-column: 1 / -1;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--select-border);
  outline: none;
  font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
  transform: translateZ(5px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background-color: var(--input-bg);
  color: var(--text);
}

#task-input:focus {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
  transform: translateZ(10px);
}

.input-options {
  display: flex;
  gap: 0.5rem;
}

#category-select, #priority-select {
  padding: 0.5rem;
  border-radius: 12px;
  border: 2px solid var(--select-border);
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  background-color: var(--select-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateZ(5px);
}

#category-select:focus, #priority-select:focus {
  border-color: var(--primary);
  transform: translateZ(10px);
}

#add-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 12px;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateZ(8px);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

#add-btn:hover {
  transform: translateZ(12px) scale(1.05);
  box-shadow: 0 8px 16px rgba(138, 43, 226, 0.7);
}

#task-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  perspective: 1000px;
}

.task-item {
  background: var(--task-bg);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 4px 12px var(--shadow);
  transform-style: preserve-3d;
  transform: translateZ(5px) rotateX(0deg);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.task-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.task-item.priority-high::before {
  background: linear-gradient(to bottom, var(--danger), #ff6b6b);
}

.task-item.priority-medium::before {
  background: linear-gradient(to bottom, var(--warning), #ffca28);
}

.task-item.priority-low::before {
  background: linear-gradient(to bottom, var(--success), #69f0ae);
}

.task-item:hover {
  transform: translateZ(15px) rotateX(5deg);
  box-shadow: 0 12px 24px var(--shadow);
}

.task-item.done {
  opacity: 0.7;
  text-decoration: line-through;
  background: var(--task-done-bg);
  transform: translateZ(0px) rotateX(-2deg);
  color: var(--text-light);
}

.task-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1;
}

.task-text {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.task-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.task-category {
  background-color: #333;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.task-category.work {
  background-color: rgba(30, 136, 229, 0.2);
  color: #4fc3f7;
}

.task-category.personal {
  background-color: rgba(233, 30, 99, 0.2);
  color: #f06292;
}

.task-category.shopping {
  background-color: rgba(76, 175, 80, 0.2);
  color: #81c784;
}

.task-category.other {
  background-color: rgba(158, 158, 158, 0.2);
  color: #bdbdbd;
}

.light-theme .task-category.work {
  background-color: rgba(30, 136, 229, 0.1);
  color: #0277bd;
}

.light-theme .task-category.personal {
  background-color: rgba(233, 30, 99, 0.1);
  color: #c2185b;
}

.light-theme .task-category.shopping {
  background-color: rgba(76, 175, 80, 0.1);
  color: #388e3c;
}

.light-theme .task-category.other {
  background-color: rgba(158, 158, 158, 0.1);
  color: #616161;
}

.task-actions {
  display: flex;
  gap: 0.5rem;
}

.task-actions button {
  background: none;
  border: none;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  transform: translateZ(10px);
  background-color: rgba(255, 255, 255, 0.05);
}

.light-theme .task-actions button {
  background-color: rgba(0, 0, 0, 0.05);
}

.task-actions .done-btn {
  color: var(--success);
}

.task-actions .done-btn:hover {
  background-color: rgba(0, 230, 118, 0.2);
  transform: translateZ(15px);
}

.task-actions .delete-btn {
  color: var(--danger);
}

.task-actions .delete-btn:hover {
  background-color: rgba(255, 64, 129, 0.2);
  transform: translateZ(15px);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--select-border);
  border-radius: 4px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

footer {
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--text-light);
  position: relative;
  transform: translateZ(5px);
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.empty-icon {
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.7;
  animation: float 3s ease-in-out infinite;
  text-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.empty-text {
  margin-top: 1rem;
  color: var(--text-light);
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateZ(-50px) rotateX(20deg);
  }
  to {
    opacity: 1;
    transform: translateZ(5px) rotateX(0deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.task-item {
  animation: slideIn 0.5s forwards;
}

.container {
  animation: fadeIn 0.8s forwards;
}

/* Glow effects for interactive elements */
.category-btn.active,
#add-btn,
.task-item:hover {
  filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.5));
}

/* Media Queries */
@media (max-width: 576px) {
  body {
    padding: 0.5rem;
  }
  
  .container {
    border-radius: 12px;
    padding: 1rem;
    transform: rotateX(0);
  }
  
  header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .header-content {
    text-align: center;
  }
  
  header h1 {
    font-size: 1.75rem;
  }
  
  header p {
    font-size: 0.8rem;
  }
  
  .todo-input {
    grid-template-columns: 1fr 1fr auto;
  }
  
  #task-input {
    grid-column: 1 / -1;
  }
  
  .input-options {
    grid-column: 1 / 3;
    width: 100%;
    justify-content: space-between;
  }
  
  #category-select, #priority-select {
    flex: 1;
    font-size: 0.75rem;
  }
  
  #add-btn {
    grid-column: 3;
    grid-row: 2;
    width: 2.25rem;
    height: 2.25rem;
  }
  
  .task-text {
    font-size: 0.9rem;
  }
  
  .task-meta {
    font-size: 0.7rem;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 0.75rem;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .category-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}
.footer-columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  background-color: var(--footer-bg);
  padding: 2rem;
  color: var(--text-light);
  border-top: 1px solid var(--footer-border);
  font-size: 0.875rem;
  margin-top: 2rem;
  transition: background-color 0.3s ease;
}

.footer-col {
  flex: 1 1 200px;
  margin: 1rem;
}

.footer-col h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col a:hover {
  color: var(--accent);
}

/* Responsive footer layout for small devices */
@media (max-width: 600px) {
  .footer-columns {
    flex-direction: column;
    text-align: center;
  }

  .footer-col {
    margin: 1rem 0;
  }
}
.task-toggle-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.toggle-btn {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s;
}
.download-btn-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}
.task-item.done .task-text {
  text-decoration: line-through;
  opacity: 0.7;
}

.toggle-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
}

.task-section {
  margin-top: 2rem;
  text-align: left;
}

.task-section h3 {
  color: var(--accent);
  margin-bottom: 1rem;
}
.author-credit {
  text-align: center;
  padding: 1rem 0;
  background-color: var(--footer-bg);
  color: var(--text-light);
  border-top: 1px solid var(--footer-border);
  font-size: 0.9rem;
  letter-spacing: 1px;
  font-weight: 500;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0px 0px 5px rgba(138, 43, 226, 0.3);
  transition: background-color 0.3s ease;
}