/* Modern TO-DO List Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
  --primary-color: #7c5dfa;
  --primary-light: #9277ff;
  --secondary-color: #1e2139;
  --background: #f8f7ff;
  --card-bg: #ffffff;
  --text-main: #0c0e16;
  --text-secondary: #7e88c3;
  --delete-color: #ec5757;
  --delete-hover: #ff9797;
  --box-shadow: rgba(72, 84, 159, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s ease;
}

body {
  background-color: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-main);
}

nav {
  background: var(--primary-color);
  color: white;
  padding: 1.2rem 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav h3 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}

nav h3::before {
  content: '✓';
  margin-right: 10px;
  font-size: 1.6rem;
  color: white;
}

.maincontainer {
  max-width: 800px;
  width: 90%;
  margin: 2rem auto;
  padding: 0 1rem;
}

.itemcontainer {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.itemcontainer h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 500;
  border-bottom: 2px dashed var(--primary-light);
  padding-bottom: 0.5rem;
}

.items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.items p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #f9f9fb;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  font-size: 1rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.items p:nth-child(odd) {
  border-left: 4px solid var(--primary-light);
}

.items p:hover {
  background-color: #f0f0f7;
  transform: translateX(5px);
}

.items button {
  background-color: var(--delete-color);
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
}

.items button:hover {
  background-color: var(--delete-hover);
  transform: scale(1.05);
}

.additem {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}

.additem input {
  flex: 1;
  padding: 0.8rem 1.2rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

.additem input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(124, 93, 250, 0.2);
}

.additem input::placeholder {
  color: var(--text-secondary);
}

.additem button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.additem button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent
  );
  transition: 0.5s;
}

.additem button:hover::before {
  left: 100%;
}

.additem button:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 600px) {
  .maincontainer {
    width: 95%;
    padding: 0 0.5rem;
  }
  
  .itemcontainer {
    padding: 1rem;
  }
  
  .additem {
    flex-direction: column;
  }
  
  .additem button {
    padding: 0.8rem;
    width: 100%;
  }
  
  nav h3 {
    font-size: 1.2rem;
  }
}

/* Empty state */
.items:empty::after {
  content: 'No tasks yet. Add one below!';
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem 0;
}