/* ==========================================================================
   TaskFlow — Modern To-Do Application Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. COLOR PALETTE & DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --primary-hue: 245;
  --primary: hsl(var(--primary-hue), 82%, 63%);
  --primary-hover: hsl(var(--primary-hue), 82%, 55%);
  --primary-light: hsla(var(--primary-hue), 82%, 63%, 0.15);
  --primary-glow: hsla(var(--primary-hue), 82%, 63%, 0.35);

  /* Vendramini Brand Palette */
  --primary-cyan: #00d2ff;
  --primary-green: #10b981;
  --vendramini-gradient: linear-gradient(135deg, var(--primary-cyan), var(--primary-green));

  /* Status Colors */
  --priority-high: #ef4444;
  --priority-high-bg: rgba(239, 68, 68, 0.12);
  --priority-med: #f59e0b;
  --priority-med-bg: rgba(245, 158, 11, 0.12);
  --priority-low: #10b981;
  --priority-low-bg: rgba(16, 185, 129, 0.12);

  --danger: #f43f5e;
  --danger-hover: #e11d48;
  --success: #10b981;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Theme Variables (Default) */
[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-surface: #151c2c;
  --bg-surface-elevated: #1e293b;
  --bg-input: #0f172a;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.6);
  
  --card-glass: rgba(21, 28, 44, 0.75);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-input: #f1f5f9;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 30px -10px rgba(15, 23, 42, 0.12);

  --card-glass: rgba(255, 255, 255, 0.85);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESETS & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

/* --------------------------------------------------------------------------
   3. LAYOUT & CONTAINERS
   -------------------------------------------------------------------------- */
.app-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --------------------------------------------------------------------------
   4. HEADER & BRANDING
   -------------------------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-glow);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   5. BUTTONS & INPUT CONTROLS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
  opacity: 0.95;
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-text {
  background: transparent;
  padding: 6px 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all var(--transition-fast);
}
.icon-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
}

.icon-btn-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}
.icon-btn-sm:hover {
  background: var(--border-color);
  color: var(--text-main);
}

/* Theme Icon Switch */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Dropdown menu */
.dropdown {
  position: relative;
}
.dropdown-content {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 230px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(12px);
}
.dropdown-content button,
.dropdown-content label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}
.dropdown-content button:hover,
.dropdown-content label:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}
.danger-text {
  color: var(--danger) !important;
}
.danger-text:hover {
  background: rgba(244, 63, 94, 0.12) !important;
}

/* --------------------------------------------------------------------------
   6. STATS DASHBOARD CARD
   -------------------------------------------------------------------------- */
.stats-card {
  background: var(--card-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stats-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stats-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stats-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

#progressPercentText {
  color: var(--primary);
}
#progressRatioText {
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #10b981);
  border-radius: var(--radius-full);
  transition: width 0.5s ease-in-out;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform var(--transition-fast);
}
.stat-box:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-icon.total { background: var(--primary-light); color: var(--primary); }
.stat-icon.pending { background: var(--priority-med-bg); color: var(--priority-med); }
.stat-icon.completed { background: var(--priority-low-bg); color: var(--priority-low); }
.stat-icon.high-priority { background: var(--priority-high-bg); color: var(--priority-high); }

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   7. QUICK ADD SECTION
   -------------------------------------------------------------------------- */
.quick-add-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  box-shadow: var(--shadow-sm);
}

.quick-add-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  transition: border-color var(--transition-fast);
}
.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-icon {
  color: var(--text-subtle);
}

.input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
}

.quick-select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}
.quick-select:focus {
  border-color: var(--primary);
}

/* --------------------------------------------------------------------------
   8. CONTROLS BAR: SEARCH, FILTERS, SORTING
   -------------------------------------------------------------------------- */
.controls-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
  color: var(--text-subtle);
  font-size: 1rem;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.status-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 2px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.tab-btn:hover {
  color: var(--text-main);
}
.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.filter-dropdowns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.85rem;
}

.select-icon {
  color: var(--text-subtle);
  font-size: 0.85rem;
}

.select-wrapper select {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   9. TASKS LIST & TASK CARD ITEM
   -------------------------------------------------------------------------- */
.tasks-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.list-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.count-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.tasks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
}
.task-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-md);
}

.task-card.completed {
  opacity: 0.72;
  background: var(--bg-surface-elevated);
}

/* Drag Handle */
.drag-handle {
  color: var(--text-subtle);
  cursor: grab;
  padding-top: 4px;
  font-size: 0.9rem;
}
.drag-handle:active {
  cursor: grabbing;
}

/* Custom Checkbox */
.checkbox-container {
  display: inline-block;
  position: relative;
  padding-left: 24px;
  cursor: pointer;
  font-size: 1.1rem;
  user-select: none;
  padding-top: 2px;
}
.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
.checkmark {
  position: absolute;
  top: 2px;
  left: 0;
  height: 22px;
  width: 22px;
  background-color: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  transition: all var(--transition-fast);
}
.checkbox-container:hover input ~ .checkmark {
  border-color: var(--primary);
}
.checkbox-container input:checked ~ .checkmark {
  background-color: var(--success);
  border-color: var(--success);
}
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}
.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}
.checkbox-container .checkmark:after {
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Task Content */
.task-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
  transition: color var(--transition-fast);
}
.task-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta Badges */
.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.75rem;
}

.badge-priority.high { background: var(--priority-high-bg); color: var(--priority-high); }
.badge-priority.med { background: var(--priority-med-bg); color: var(--priority-med); }
.badge-priority.low { background: var(--priority-low-bg); color: var(--priority-low); }

.badge-category {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-date {
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
}
.badge-date.overdue {
  color: var(--danger);
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
}

/* Subtasks inline preview */
.subtasks-preview {
  margin-top: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.subtasks-progress-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.subtasks-inline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subtask-inline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-main);
  cursor: pointer;
}
.subtask-inline-item.done {
  text-decoration: line-through;
  color: var(--text-subtle);
}

/* Task Card Actions */
.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   10. EMPTY STATE
   -------------------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: var(--bg-surface);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  gap: 12px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.empty-state h4 {
  font-size: 1.15rem;
  font-weight: 700;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 380px;
}

/* --------------------------------------------------------------------------
   11. MODALS & OVERLAYS
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card-sm {
  max-width: 420px;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.required {
  color: var(--danger);
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
  display: flex;
  gap: 12px;
}
.col-4 {
  flex: 1;
}

/* Subtasks in Modal */
.subtasks-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.subtask-input-group {
  display: flex;
  gap: 8px;
}
.subtask-input-group input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-main);
}

.subtasks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.subtask-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   12. TOAST NOTIFICATIONS & FOOTER
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--priority-med); }

.toast-icon { font-size: 1.1rem; }
.toast.success .toast-icon { color: var(--success); }
.toast.danger .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--priority-med); }

.toast-content {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
}

.toast-undo {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.app-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  padding: 24px 0 16px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  text-align: center;
}

.footer-copyright {
  font-weight: 500;
  color: var(--text-muted);
}

#footerCompanyName {
  font-weight: 700;
  color: var(--text-main);
}

.footer-separator {
  color: var(--text-subtle);
  opacity: 0.5;
}

.footer-developer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dev-label {
  color: var(--text-subtle);
}

.vendramini-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  background: rgba(0, 210, 255, 0.05);
  border: 1px solid rgba(0, 210, 255, 0.18);
}

.vendramini-link:hover {
  background: rgba(0, 210, 255, 0.12);
  border-color: rgba(0, 210, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.25);
  transform: translateY(-1px);
}

.vendramini-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  transition: transform var(--transition-bounce);
}

.vendramini-link:hover .vendramini-logo {
  transform: scale(1.15) rotate(5deg);
}

.vendramini-brand {
  font-weight: 700;
  background: var(--vendramini-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  .footer-container {
    flex-direction: column;
    gap: 8px;
  }
  .footer-separator {
    display: none;
  }
}

/* Utility Helpers */
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   13. ANIMATIONS & ADVANCED MOBILE RESPONSIVENESS
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpBottom {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Tablet & Mobile Layout Enhancements */
@media (max-width: 768px) {
  .app-container {
    padding: 16px 14px 40px 14px;
    gap: 18px;
  }

  /* Header */
  .logo-text h1 {
    font-size: 1.35rem;
  }

  .header-right {
    gap: 8px;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.85rem;
    min-height: 42px;
  }

  /* Stats Dashboard */
  .stats-card {
    padding: 18px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-box {
    padding: 10px 12px;
    gap: 10px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .stat-number {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  /* Quick Add Bar */
  .quick-add-form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .input-wrapper {
    padding: 10px 14px;
    min-height: 44px;
  }

  .quick-select {
    width: 100%;
    min-height: 42px;
  }

  .quick-add-form .btn {
    width: 100%;
  }

  /* Controls Section */
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .status-tabs {
    width: 100%;
    display: flex;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .filter-dropdowns {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .select-wrapper {
    width: 100%;
    justify-content: space-between;
    padding: 8px 12px;
    min-height: 42px;
  }

  .select-wrapper select {
    flex: 1;
    text-align: right;
  }

  /* Task Cards on Mobile */
  .task-card {
    padding: 14px;
    gap: 12px;
  }

  .drag-handle {
    display: none; /* Simplify on touch screens */
  }

  .checkbox-container {
    padding-left: 26px;
  }

  .checkmark {
    height: 24px;
    width: 24px;
    top: 0;
  }

  .checkbox-container .checkmark:after {
    left: 8px;
    top: 4px;
  }

  .task-title {
    font-size: 0.92rem;
  }

  .task-desc {
    font-size: 0.82rem;
  }

  .task-actions {
    flex-direction: column;
    gap: 6px;
  }

  .icon-btn-sm {
    width: 36px;
    height: 36px;
  }

  /* Modals as Bottom Sheet on Mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    border-radius: 24px 24px 0 0;
    max-height: 88vh;
    animation: slideUpBottom 0.3s cubic-bezier(0.32, 1.2, 0.64, 1);
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-body {
    padding: 18px 20px;
    gap: 14px;
  }

  /* Prevent iOS zoom on input focus */
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 1rem;
    padding: 12px 14px;
  }

  .modal-footer {
    padding: 14px 20px 24px 20px;
  }

  /* Toast Notifications on Mobile */
  .toast-container {
    left: 14px;
    right: 14px;
    bottom: 16px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }

  /* Footer on Mobile */
  .footer-container {
    flex-direction: column;
    gap: 8px;
  }

  .footer-separator {
    display: none;
  }
}

/* Small Smartphone Screen Improvements (< 480px) */
@media (max-width: 480px) {
  .app-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-left {
    width: 100%;
    justify-content: space-between;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .header-right .btn-primary {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-header h2 {
    font-size: 1rem;
  }
}

