/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
  transition: all 0.3s ease;
}

/* Header Styles */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #333;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

#themeToggle {
  padding: 8px 16px;
  font-size: 0.9rem;
  border: none;
  border-radius: 25px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

#themeToggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#clock {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 500;
  backdrop-filter: blur(5px);
}

/* Add Task Form */
.add-task {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 20px auto;
  justify-content: center;
  max-width: 1000px;
  padding: 0 20px;
}

.add-task input,
.add-task select,
.add-task button {
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 10px;
  border: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.add-task input,
.add-task select {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-width: 150px;
}

.add-task input:focus,
.add-task select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
}

.add-task button {
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  color: white;
  cursor: pointer;
  font-weight: 600;
  padding: 12px 24px;
}

.add-task button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Main Layout */
main {
  display: flex;
  padding: 20px;
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.left-column {
  flex: 1;
  min-width: 300px;
}

.right-column {
  width: 350px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Controls */
.controls {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.control-label {
  font-weight: 600;
  color: #555;
  margin-right: 10px;
}

.filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.filter-btn:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

.filter-btn.active {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
}

.sort select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1.2rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
}

.empty-state small {
  color: #999;
}

.task-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.task-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.task-item.high-priority {
  border-left-color: #e74c3c;
}

.task-item.medium-priority {
  border-left-color: #f39c12;
}

.task-item.low-priority {
  border-left-color: #27ae60;
}

.task-item.completed {
  opacity: 0.7;
  background: rgba(200, 255, 200, 0.3);
}

.task-content {
  flex: 1;
}

.task-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.task-item.completed .task-name {
  text-decoration: line-through;
  color: #888;
}

.task-meta {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  color: #666;
  flex-wrap: wrap;
}

.task-category {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.task-priority {
  font-weight: 600;
}

.task-priority.high {
  color: #e74c3c;
}

.task-priority.medium {
  color: #f39c12;
}

.task-priority.low {
  color: #27ae60;
}

.task-actions {
  display: flex;
  gap: 8px;
}

.task-actions button {
  padding: 8px 12px;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.task-actions .complete {
  background: #27ae60;
  color: white;
}

.task-actions .complete:hover {
  background: #229954;
  transform: scale(1.05);
}

.task-actions .delete {
  background: #e74c3c;
  color: white;
}

.task-actions .delete:hover {
  background: #c0392b;
  transform: scale(1.05);
}

/* Right Column Cards */
.summary-card,
.pomodoro-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.summary-card h2,
.pomodoro-card h2 {
  margin-bottom: 20px;
  color: #333;
  font-size: 1.3rem;
}

#taskChart {
  max-width: 250px !important;
  max-height: 250px !important;
  margin: 0 auto 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-item:nth-child(1) .stat-number {
  color: #f39c12;
}

.stat-item:nth-child(2) .stat-number {
  color: #e74c3c;
}

.stat-item:nth-child(3) .stat-number {
  color: #27ae60;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

/* Pomodoro Timer */
#timer {
  font-size: 3rem;
  font-weight: 700;
  margin: 20px 0;
  color: #667eea;
  font-family: 'Courier New', monospace;
}

.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.timer-controls button {
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.timer-controls button:first-child {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
}

.timer-controls button:last-child {
  background: #f0f0f0;
  color: #333;
}

.timer-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Confetti Animation */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ff6b6b;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Dark Mode */
body.dark-mode {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #ecf0f1;
}

body.dark-mode header {
  background: rgba(44, 62, 80, 0.95);
  color: #ecf0f1;
}

body.dark-mode h1 {
  background: linear-gradient(45deg, #3498db, #9b59b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-mode #themeToggle {
  background: linear-gradient(45deg, #3498db, #9b59b6);
}

body.dark-mode #clock {
  background: rgba(255, 255, 255, 0.1);
  color: #ecf0f1;
}

body.dark-mode .add-task input,
body.dark-mode .add-task select {
  background: rgba(44, 62, 80, 0.95);
  color: #ecf0f1;
  border: 1px solid #555;
}

body.dark-mode .controls,
body.dark-mode .task-item,
body.dark-mode .summary-card,
body.dark-mode .pomodoro-card,
body.dark-mode .empty-state {
  background: rgba(44, 62, 80, 0.95);
  color: #ecf0f1;
}

body.dark-mode .task-name {
  color: #ecf0f1;
}

body.dark-mode .filter-btn {
  background: #555;
  color: #ecf0f1;
}

body.dark-mode .filter-btn:hover {
  background: #666;
}

body.dark-mode .sort select {
  background: #555;
  color: #ecf0f1;
  border-color: #666;
}

body.dark-mode .timer-controls button:last-child {
  background: #555;
  color: #ecf0f1;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    flex-direction: column;
    padding: 15px;
  }
  
  .right-column {
    width: 100%;
  }
  
  .add-task {
    flex-direction: column;
    align-items: center;
  }
  
  .add-task input,
  .add-task select,
  .add-task button {
    width: 100%;
    max-width: 300px;
  }
  
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter {
    justify-content: center;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .task-item {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .task-actions {
    justify-content: center;
  }
}