@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  /* Light Theme Colors */
  --primary-bg: linear-gradient(135deg, #667eea, #764ba2);
  --container-bg: rgba(255, 255, 255, 0.15);
  --text-color: #fff;
  --input-bg: rgba(255, 255, 255, 0.2);
  --task-bg: rgba(255, 255, 255, 0.2);
  --task-hover: rgba(255, 255, 255, 0.3);
  --border-color: rgba(255, 255, 255, 0.3);
  --shadow: 0 8px 25px rgba(0,0,0,0.2);
  --accent-color: #00ffcc;
  --danger-color: #ff6b6b;
  --success-color: #4ade80;
  --warning-color: #fbbf24;
  
  /* Priority Colors */
  --priority-low: #4ade80;
  --priority-medium: #fbbf24;
  --priority-high: #ef4444;
  
  /* Category Colors */
  --category-general: #8b5cf6;
  --category-work: #3b82f6;
  --category-personal: #10b981;
  --category-shopping: #f59e0b;
  --category-health: #ef4444;
}

[data-theme="dark"] {
  --primary-bg: linear-gradient(135deg, #1a1a2e, #16213e);
  --container-bg: rgba(255, 255, 255, 0.1);
  --text-color: #e2e8f0;
  --input-bg: rgba(255, 255, 255, 0.1);
  --task-bg: rgba(255, 255, 255, 0.1);
  --task-hover: rgba(255, 255, 255, 0.2);
  --border-color: rgba(255, 255, 255, 0.2);
  --shadow: 0 8px 25px rgba(0,0,0,0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  min-height: 100vh;
  background: var(--primary-bg);
  padding: 0;
  margin: 0;
  transition: all 0.3s ease;
}

/* Mobile-first approach */
.wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

/* Glassmorphism container */
.taskify-container {
  background: var(--container-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
  padding: 30px;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  margin: 0 auto;
}

/* Header Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.app-title {
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-controls {
  display: flex;
  gap: 10px;
}

.theme-toggle, .stats-toggle {
  background: var(--input-bg);
  border: none;
  color: var(--text-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover, .stats-toggle:hover {
  background: var(--task-hover);
  transform: scale(1.1);
}

/* Task Statistics */
.task-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
  padding: 20px;
  background: var(--input-bg);
  border-radius: 15px;
  transition: all 0.3s ease;
}

.task-stats.hidden {
  display: none;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-label {
  font-size: 0.8rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Task Input Section */
.task-input-section {
  margin-bottom: 25px;
}

.task-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  background: var(--input-bg);
  border-radius: 12px;
  padding: 5px 10px;
  border: 1px solid var(--border-color);
}

.task-input input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-size: 16px;
  padding: 12px;
  outline: none;
}

.task-input input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.add-btn {
  background: var(--accent-color);
  border: none;
  color: #333;
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn:hover {
  background: #fff;
  transform: rotate(90deg) scale(1.1);
}

/* Task Options */
.task-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.category-select, .priority-select, .due-date {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
  min-height: 44px; /* Touch-friendly minimum height */
}

.category-select:focus, .priority-select:focus, .due-date:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.2);
}

.category-select option, .priority-select option {
  background: #333;
  color: #fff;
}

/* Custom date input styling */
.due-date {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
  min-height: 44px;
  cursor: pointer;
  position: relative;
}

.due-date:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.2);
}

.due-date::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Mobile-specific date input */
@media (max-width: 768px) {
  .due-date {
    font-size: 16px;
    padding: 12px;
    min-height: 48px;
    background: var(--input-bg);
    color: var(--text-color);
  }
  
  .due-date:focus {
    background: var(--input-bg);
    color: var(--text-color);
  }
}

/* Filter and Search Section */
.filter-section {
  margin-bottom: 25px;
}

.search-box {
  position: relative;
  margin-bottom: 15px;
}

.search-box input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-color);
  padding: 12px 45px 12px 15px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.2);
}

.search-box i {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent-color);
  color: #333;
  border-color: var(--accent-color);
}

/* Task list styling */
.task-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
  margin-bottom: 20px;
}

.task-list::-webkit-scrollbar {
  width: 6px;
}

.task-list::-webkit-scrollbar-track {
  background: transparent;
}

.task-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.task-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Task item */
.task {
  background: var(--task-bg);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: slideIn 0.4s ease;
  border: 1px solid var(--border-color);
  position: relative;
}

.task:hover {
  background: var(--task-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.task.completed {
  text-decoration: line-through;
  opacity: 0.6;
  background: rgba(76, 222, 128, 0.1);
}

.task.completed:hover {
  background: rgba(76, 222, 128, 0.2);
}

/* Task Priority Indicators */
.task.priority-high {
  border-left: 4px solid var(--priority-high);
}

.task.priority-medium {
  border-left: 4px solid var(--priority-medium);
}

.task.priority-low {
  border-left: 4px solid var(--priority-low);
}

/* Task Content */
.task-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.task-text {
  font-weight: 500;
}

.task-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  opacity: 0.8;
}

.task-category {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.task-category.general { background: var(--category-general); }
.task-category.work { background: var(--category-work); }
.task-category.personal { background: var(--category-personal); }
.task-category.shopping { background: var(--category-shopping); }
.task-category.health { background: var(--category-health); }

.task-due-date {
  color: var(--warning-color);
}

.task-due-date.overdue {
  color: var(--danger-color);
  font-weight: 600;
}

/* Task Actions */
.task-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.edit-btn, .delete-btn {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.edit-btn:hover {
  background: var(--accent-color);
  color: #333;
  opacity: 1;
}

.delete-btn:hover {
  background: var(--danger-color);
  color: #fff;
  opacity: 1;
}

.task-actions i {
  font-size: 14px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  opacity: 0.7;
}

.empty-state.hidden {
  display: none;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: 10px;
  font-weight: 600;
}

.empty-state p {
  font-size: 14px;
  opacity: 0.8;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.action-btn {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn:hover {
  background: var(--accent-color);
  color: #333;
  border-color: var(--accent-color);
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--container-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 30px;
  width: 90%;
  max-width: 400px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  color: var(--text-color);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: var(--danger-color);
  color: #fff;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-body input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-color);
  padding: 12px 15px;
  font-size: 16px;
  outline: none;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.modal-body input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.2);
}

.modal-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.save-btn, .cancel-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.save-btn {
  background: var(--accent-color);
  color: #333;
}

.save-btn:hover {
  background: #fff;
  transform: translateY(-2px);
}

.cancel-btn {
  background: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.cancel-btn:hover {
  background: var(--task-hover);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.task.completed {
  animation: pulse 0.6s ease;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* ========================================
   SIMPLE RESPONSIVE DESIGN
======================================== */

/* Mobile devices - default styles */
@media (max-width: 768px) {
  .wrapper {
    padding: 5px;
    align-items: flex-start;
    padding-top: 10px;
  }
  
  .taskify-container {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    margin: 0;
    border-radius: 10px;
  }
  
  .app-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .app-title {
    font-size: 1.3rem;
  }
  
  .header-controls {
    justify-content: center;
  }
  
  .theme-toggle, .stats-toggle {
    width: 40px;
    height: 40px;
  }
  
  .task-stats {
    grid-template-columns: 1fr;
    padding: 15px;
  }
  
  .task-options {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .category-select, .priority-select, .due-date {
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 48px; /* Larger touch target */
  }
  
  /* Ensure date input is fully functional on mobile */
  .due-date {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
  }
  
  .due-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    height: 20px;
    width: 20px;
  }
  
  .task-input input {
    font-size: 16px;
    padding: 12px 8px;
  }
  
  .search-box input {
    font-size: 16px;
    padding: 12px 40px 12px 12px;
  }
  
  .filter-buttons {
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .filter-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .task {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }
  
  .task-content {
    width: 100%;
  }
  
  .task-text {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .task-meta {
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .task-category {
    font-size: 10px;
    padding: 3px 6px;
  }
  
  .task-due-date {
    font-size: 11px;
  }
  
  .task-actions {
    align-self: flex-end;
  }
  
  .quick-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .action-btn {
    padding: 12px 16px;
    font-size: 13px;
    justify-content: center;
  }
  
  .modal-content {
    width: 95%;
    padding: 20px;
    margin: 10px;
  }
  
  .modal-options {
    grid-template-columns: 1fr;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .save-btn, .cancel-btn {
    width: 100%;
    padding: 12px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .taskify-container {
    padding: 12px;
  }
  
  .app-title {
    font-size: 1.2rem;
  }
  
  .task {
    padding: 10px;
  }
  
  .task-text {
    font-size: 13px;
  }
  
  .category-select, .priority-select, .due-date {
    padding: 10px;
    font-size: 16px;
    min-height: 44px;
  }
  
  .task-category {
    font-size: 9px;
    padding: 2px 5px;
  }
  
  .task-due-date {
    font-size: 10px;
  }
  
  .filter-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .action-btn {
    padding: 10px 15px;
    font-size: 12px;
  }
  
  .modal-content {
    width: 98%;
    padding: 15px;
    margin: 5px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .taskify-container {
    padding: 10px;
  }
  
  .app-title {
    font-size: 1.1rem;
  }
  
  .task {
    padding: 8px;
  }
  
  .task-text {
    font-size: 12px;
  }
  
  .task-category {
    font-size: 8px;
    padding: 1px 4px;
  }
  
  .task-due-date {
    font-size: 9px;
  }
  
  .filter-btn {
    padding: 5px 8px;
    font-size: 10px;
  }
  
  .action-btn {
    padding: 8px 12px;
    font-size: 11px;
  }
}

/* Desktop and tablet */
@media (min-width: 769px) {
  .wrapper {
    align-items: center;
  }
  
  .taskify-container {
    max-width: 500px;
    padding: 30px;
  }
  
  .app-header {
    flex-direction: row;
    text-align: left;
  }
  
  .task-options {
    grid-template-columns: 1fr 1fr 1fr;
  }
  
  .quick-actions {
    flex-direction: row;
  }
  
  .modal-content {
    max-width: 400px;
  }
  
  .modal-options {
    grid-template-columns: 1fr 1fr 1fr;
  }
  
  .modal-footer {
    flex-direction: row;
  }
  
  .save-btn, .cancel-btn {
    width: auto;
  }
}
