:root {
  --primary-color: #1c8fd0;
  --background-color: #f0f0f0;
  --text-color: #333;
  --hover-color: #1a7db0;
  --input-color: #ffffff;
  --input-text-color: #000000;
  --hover-color: #1a7db0;
}

:root[data-theme="dark"] {
  --primary-color: #1c8fd0;
  --background-color: #333;
  --text-color: #f0f0f0;
  --hover-color: #1a7db0;
  --input-color: #333333;
  --hover-color: #555;
  --input-text-color: #ffffff;
}

body {
  font-family: "Rajdhani", Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 600px;
  margin: auto;
}

header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-size: 2rem;
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: var(--hover-color);
}

main {
  margin-top: 20px;
}

form {
  display: flex;
  flex-direction: column;
}

input,
textarea {
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  background-color: var(--input-color);
  color: var(--input-text-color);
  border-radius: 4px;
  transition: border-color 0.3s ease;
}

input:focus,
textarea:focus {
  border-color: var(--primary-color);
}

.tasks {
  margin-top: 20px;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  transition: box-shadow 0.3s ease;
}

li:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
  header {
    flex-direction: row;
    align-items: flex-start;
  }
  header button {
    width: 50%;
    margin-top: 3.75%;
  }
  button {
    width: 100%;
    margin-top: 10px;
  }
}

/* Task display styles */
.task-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.task-card {
  background-color: var(--background-color);
  color: var(--text-color);
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.45s, color 0.3s;
  display: flex;
  flex-direction: column;
}

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

.task-title {
  font-size: 1.25em;
  margin: 0 0 10px;
}

.task-description {
  font-size: 1em;
  margin: 0;
}

.task-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.task-btn {
  padding: 10px 15px;
  font-size: 0.9em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.mark-complete-btn {
  background-color: #4caf50;
}

.mark-complete-btn:hover {
  background-color: #45a049;
}

.delete-btn {
  background-color: #f44336;
  color: white;
}

.delete-btn:hover {
  background-color: #e53935;
}

/* Adding responsiveness */
@media (max-width: 600px) {
  .task-container {
    padding: 10px;
  }

  .task-card {
    padding: 10px;
  }
}

@media (min-width: 601px) {
  .task-container {
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
  }

  .task-card {
    width: calc(33.333% - 20px);
  }
}

.no-tasks {
  font-size: 1.2rem;
  color: var(--text-color);
  text-align: center;
  padding: 20px;
  background-color: var(--background-color);
  border-radius: 8px;
  margin: 20px auto;
  width: 80%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
  animation: fadeIn 1s ease-in-out;
}

.no-tasks::before {
  content: "⚠️";
  font-size: 3rem;
  display: block;
  margin-bottom: 15px;
  animation: flash 1.5s infinite;
  text-align: center;
}

@keyframes flash {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.no-tasks:hover {
  background-color: var(--hover-color);
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: none;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: hidden;
}

.visible {
  display: block;
}
