/* =========================================
   1. RESET & BASE STYLES
   ========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
  /* Vibrant, energetic gradient background */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f77062 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 16px;
}

/* =========================================
   2. MAIN CONTAINER CARD
   ========================================= */
.container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 650px;
  border-radius: 24px;
  padding: 36px 28px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: fadeIn 0.5s ease-out;
}

/* Smooth fade-in animation when page loads */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   3. HEADER & GRADIENT TITLE
   ========================================= */
.app-header {
  text-align: center;
  margin-bottom: 28px;
}

.app-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  /* Multi-color gradient text */
  background: linear-gradient(90deg, #4f46e5, #9333ea, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin-top: 6px;
}

/* =========================================
   4. FORM & INPUTS
   ========================================= */
.task-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #f8fafc;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
}

/* Make task name take full width */
.task-form .input-group:first-child {
  grid-column: span 2;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.95rem;
  color: #1e293b;
  background-color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

/* Glowing border effect on focus */
.input-group input:focus,
.input-group select:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

/* Colorful "Add Task" button */
#add-btn {
  grid-column: span 2;
  margin-top: 4px;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #ec4899);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
  transition: all 0.25s ease;
}

#add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.45);
}

#add-btn:active {
  transform: translateY(0);
}

/* =========================================
   5. TASK LIST SECTION
   ========================================= */
.task-section {
  margin-top: 32px;
}

.task-section h2 {
  font-size: 1.25rem;
  color: #1e293b;
  font-weight: 700;
  margin-bottom: 16px;
}

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Empty placeholder message */
.empty-state {
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
  padding: 30px;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}

/* =========================================
   6. INDIVIDUAL TASK ITEM CARD
   ========================================= */
.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 16px 18px;
  border-radius: 14px;
  border-left: 6px solid #4f46e5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.task-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.task-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #64748b;
  flex-wrap: wrap;
}

/* =========================================
   7. COLORFUL SUBJECT BADGES
   ========================================= */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Distinct color for each subject */
.badge-AIML {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-Mathematics {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-Programming {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-Other {
  background: #fce7f3;
  color: #be185d;
  border: 1px solid #fbcfe8;
}
.badge-Physics {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* =========================================
   8. COMPLETED TASK STATE
   ========================================= */
.task-item.completed {
  background: #f1f5f9;
  border-left-color: #10b981;
  opacity: 0.65;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: #64748b;
}

/* =========================================
   9. ACTION BUTTONS (DONE / DELETE)
   ========================================= */
.task-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-calendar {
  background: #e0e7ff;
  color: #4338ca;
}

.btn-calendar:hover {
  background: #6366f1;
  color: #ffffff;
}

.btn-complete {
  background: #dcfce7;
  color: #15803d;
}

.btn-complete:hover {
  background: #10b981;
  color: #ffffff;
}

.btn-delete {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-delete:hover {
  background: #ef4444;
  color: #ffffff;
}

/* =========================================
   10. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 580px) {
  .task-form {
    grid-template-columns: 1fr;
  }
  
  .task-form .input-group:first-child,
  #add-btn {
    grid-column: span 1;
  }

  .task-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .task-actions {
    width: 100%;
    justify-content: flex-end;
  }
}