:root {
  --primary: hsl(250, 100%, 75%);
  --secondary: hsl(320, 100%, 70%);
  --accent: hsl(180, 100%, 70%);
  --bg-dark: hsl(240, 20%, 10%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: hsl(0, 0%, 95%);
  --text-muted: hsl(240, 10%, 60%);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

  --font-main: "Outfit", sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* For blobs */
  position: relative;
}

/* Background Blobs */
.background-blobs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s infinite alternate;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 300px;
  height: 300px;
  background: var(--secondary);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

.blob-3 {
  width: 200px;
  height: 200px;
  background: var(--accent);
  top: 40%;
  left: 40%;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(50px, 50px) rotate(20deg);
  }
}

/* App Container */
.app-container {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  width: 90%;
  max-width: 450px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 80vh; /* Fixed height for scrollable list */
}

/* Header */
.app-header h1 {
  font-size: 2rem;
  font-weight: 700;
    background: linear-gradient(135deg, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.date-display {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
  margin-top: 0.25rem;
}

/* Input Section */
.input-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 0.5rem;
}

.text-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    min-width: 100%; /* Force to new line if needed, or at least take full width */
    order: 3; /* Ensure it's at the bottom if we want selectors on top */
}

/* Make selectors share the top row */
#categorySelect, #prioritySelect, #dateInput {
    flex-grow: 1; /* Distribute space */
    max-width: 32%; /* Rough 3 columns */
}

#categorySelect, #prioritySelect {
    padding: 0 0.5rem;
    height: 45px; /* Slightly smaller height for better proportion */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px; /* Slightly smaller radius */
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    width: auto; /* Let flex handle width */
}

#prioritySelect {
    /* Specific styles if needed, else handled by shared block */
}

#categorySelect:focus, #prioritySelect:focus {
    outline: none;
    border-color: var(--primary);
}
#dateInput {
    padding: 0 0.5rem;
    height: 45px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-main);
    cursor: pointer;
    position: relative;
    width: auto;
}

#dateInput:focus {
    outline: none;
    border-color: var(--primary);
    color: var(--text-main);
}

/* Make date picker icon white */
::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

#taskInput {
    flex-grow: 1;

.task-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
    height: 45px; /* Match new height */
    padding: 0 3.5rem 0 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#taskInput:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(120, 116, 242, 0.2);
}

#addBtn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#addBtn:hover {
  background: var(--secondary);
  transform: translateY(-50%) scale(1.05);
}

#addBtn:active {
  transform: translateY(-50%) scale(0.95);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  gap: 0.5rem;
}

.tabs-group {
    display: flex;
    gap: 0.5rem;
}

#sortSelect {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: right;
    padding-right: 0.5rem;
}

#sortSelect:focus {
    outline: none;
    color: var(--text-main);
}

#sortSelect option {
    background: var(--bg-dark); /* Ensure dropdown options are readable */
    color: var(--text-main);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Task List */
.task-list {
  list-style: none;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Scrollbar */
.task-list::-webkit-scrollbar {
  width: 4px;
}

.task-list::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}

.task-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideIn 0.3s ease forwards;
  flex-wrap: wrap; /* To handle badge wrapping if text is long, though usually separate */
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.05);
}

.task-item.completed {
  opacity: 0.6;
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.task-checkbox:checked {
  background: var(--primary);
}

.task-checkbox:checked::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: white;
  font-size: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.task-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.category-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    width: fit-content;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.category-personal {
    background: rgba(100, 255, 218, 0.15);
    color: #64ffda;
}

.category-family {
    background: rgba(255, 171, 0, 0.15);
    color: #ffab00;
}

.category-work {
    background: rgba(213, 128, 255, 0.15);
    color: #d580ff;
}

.priority-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    width: fit-content;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.priority-low {
    background: rgba(100, 255, 218, 0.15); /* Similar to Personal (Greenish) but maybe distinct? Let's use blue */
    background: rgba(66, 165, 245, 0.15);
    color: #42a5f5;
}

.priority-medium {
    background: rgba(255, 171, 0, 0.15); /* Similar to Family (Orange) */
    background: rgba(255, 202, 40, 0.15);
    color: #ffca28;
}

.priority-high {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
}

.task-text {
  flex-grow: 1;
  font-size: 1rem;
  word-break: break-word;
}

.delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  padding: 4px;
}

.task-item:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  color: #ff5555;
  transform: scale(1.1);
}

/* Empty State */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  height: 100%;
  gap: 1rem;
  padding-bottom: 2rem;
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.3;
}

.task-list:empty + .empty-state {
  display: flex;
}

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

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}
