/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #d4edda 100%);
  min-height: 100vh;
  color: #333;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background-color: #ffffff00;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Header styles */
.app-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 25px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo i {
  font-size: 2.5rem;
}

.logo h1 {
  font-size: 2rem;
  font-weight: 700;
}

.tagline {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-left: 10px;
}

.stats {
  display: flex;
  gap: 25px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Main content styles */
.app-main {
  padding: 30px;
}

.input-section {
  background-color: #f8f9fa;
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.input-group {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

#task-input {
  flex-grow: 1;
  padding: 15px 20px;
  border: 2px solid #e1e5eb;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s;
}

#task-input:focus {
  border-color: #6a11cb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #6a11cb 0%, #00ffff 100%);
  color: white;
  border: none;
  padding: 15px 25px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 14px rgba(106, 17, 203, 0.2);
}

.task-options {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.priority-selector,
.category-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.priority-selector span,
.category-selector span {
  font-weight: 500;
}

select {
  padding: 8px 15px;
  border-radius: 8px;
  border: 2px solid #e1e5eb;
  background-color: white;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Controls section */
.controls-section {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.filter-controls,
.view-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 20px;
  background-color: #f1f3f5;
  border: 2px solid #e1e5eb;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn.active {
  background: linear-gradient(90deg, #6a11cb, #00ffff);
  color: white;
  border: none;
}

.filter-btn:hover:not(.active) {
  background-color: #e9ecef;
}

.view-btn {
  padding: 10px 20px;
  background-color: white;
  border: 2px solid #e1e5eb;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.view-btn:hover {
  background-color: #f8f9fa;
}

/* Tasks section */
.tasks-section {
  background-color: #f8f9fa;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.tasks-header h2 {
  font-size: 1.5rem;
  color: #333;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: white;
  border: 2px solid #e1e5eb;
  border-radius: 10px;
  padding: 10px 15px;
  width: 300px;
  max-width: 100%;
}

.search-box i {
  color: #dc3545;
  margin-right: 10px;
}

#task-search {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
}

.tasks-list {
  min-height: 300px;
  margin-bottom: 25px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #6c757d;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  color: #f8d7da;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

/* Task item styles - UPDATED FOR BETTER CHECKBOX */
.task-item {
  display: flex;
  align-items: center;
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border-left: 5px solid #6a11cb;
  position: relative;
}

.task-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
  opacity: 0.8;
  border-left-color: #28a745;
  background-color: #f8f9fa;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: #6c757d;
}

/* FIXED CHECKBOX STYLING */
.task-checkbox {
  position: relative;
  width: 28px;
  height: 28px;
  margin-right: 20px;
  cursor: pointer;
}

.task-status {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.custom-checkbox {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  border: 2px solid #adb5bd;
  border-radius: 6px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-status:checked + .custom-checkbox {
  background-color: #28a745;
  border-color: #28a745;
}

.task-status:checked + .custom-checkbox::after {
  content: '';
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.task-content {
  flex-grow: 1;
}

.task-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 5px;
  word-break: break-word;
  transition: color 0.3s;
}

.task-meta {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: #6c757d;
}

.task-category {
  background-color: #e9ecef;
  padding: 3px 10px;
  border-radius: 20px;
}

.task-priority {
  margin: 0 20px;
}

.priority-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-low {
  background-color: #d4edda;
  color: #155724;
}

.priority-medium {
  background-color: #fff3cd;
  color: #856404;
}

.priority-high {
  background-color: #f8d7da;
  color: #721c24;
}

.task-actions {
  display: flex;
  gap: 10px;
}

.task-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background-color: #f8f9fa;
  color: #6c757d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.task-btn:hover {
  background-color: #e9ecef;
}

.edit-btn:hover {
  color: #ffc107;
}

.delete-btn:hover {
  color: #dc3545;
}

/* Tasks footer */
.tasks-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 20px;
  border-top: 2px solid #e9ecef;
}

.progress-container {
  flex-grow: 1;
  max-width: 400px;
}

.progress-label {
  font-weight: 500;
  margin-bottom: 8px;
}

.progress-bar {
  height: 10px;
  background-color: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6a11cb, #00ffff);
  border-radius: 5px;
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  font-weight: 600;
  color: #6a11cb;
}

.btn-secondary {
  padding: 12px 25px;
  background-color: #f8f9fa;
  border: 2px solid #dc3545;
  color: #dc3545;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background-color: #dc3545;
  color: white;
}

/* Footer styles */
.app-footer {
  background-color: #f8f9fa;
  padding: 20px 30px;
  text-align: center;
  color: #6c757d;
  border-top: 2px solid #e9ecef;
}

.footer-note {
  font-size: 0.85rem;
  margin-top: 5px;
  opacity: 0.8;
}

/* Notification styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 10px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease;
}

.notification-success {
  background: linear-gradient(90deg, #6a11cb, #00ffff);
}

.notification-error {
  background-color: #dc3545;
}

.notification-info {
  background-color: #6c757d;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .stats {
    width: 100%;
    justify-content: space-around;
  }

  .input-group {
    flex-direction: column;
  }

  .controls-section {
    flex-direction: column;
  }

  .tasks-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .task-item {
    flex-wrap: wrap;
  }

  .task-priority {
    margin: 10px 0;
    order: 3;
    width: 100%;
  }

  .task-actions {
    order: 4;
  }
}

@media (max-width: 576px) {
  .container {
    border-radius: 0;
  }

  body {
    padding: 0;
  }

  .app-main {
    padding: 20px;
  }

  .task-options {
    flex-direction: column;
    gap: 15px;
  }
}
