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

:root {
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-hover: #2a2a2a;
  --border: #333;
  --primary: #bb86fc;
  --primary-hover: #d4aaff;
  --text: #e8e8e8;
  --text-muted: #9e9e9e;
  --completed: #616161;
  --danger: #cf6679;
  --danger-hover: #e57373;
  --radius: 8px;
  --radius-sm: 6px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --toast-bg: #1e1e1e;
  --toast-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --search-bg: rgba(30, 30, 30, 0.95);
}

[data-theme="light"] {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-hover: #e8eaed;
  --border: #d0d3d8;
  --primary: #7c4dff;
  --primary-hover: #9e7cff;
  --text: #1a1a1a;
  --text-muted: #5f6368;
  --completed: #9e9e9e;
  --danger: #d93025;
  --danger-hover: #ea4335;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --toast-bg: #ffffff;
  --toast-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  --search-bg: rgba(255, 255, 255, 0.98);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 90%;
  margin: 0 auto;
  padding: var(--spacing-lg);
  padding-bottom: 60px;
}

.header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
  padding: 4px;
  line-height: 1;
  z-index: 5;
}

.theme-toggle:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.counters {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.counter {
  font-size: 0.875rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s;
}

.counter:hover {
  background: var(--surface-hover);
}

.counter-pending {
  border-left: 3px solid #ff9800;
}

.counter-total {
  border-left: 3px solid #2196f3;
}

.counter-completed {
  border-left: 3px solid #4caf50;
}

.counter-none {
  border-left: 3px solid #9e9e9e;
  cursor: pointer;
}

.counter-none:hover {
  background: var(--surface-hover);
}

.counter-critical {
  border-left: 3px solid #ff4444;
  cursor: pointer;
}

.counter-high {
  border-left: 3px solid #ff9800;
  cursor: pointer;
}

.counter-medium {
  border-left: 3px solid #ffc107;
  cursor: pointer;
}

.counter-low {
  border-left: 3px solid #4caf50;
  cursor: pointer;
}

.counter-pending,
.counter-completed {
  cursor: pointer;
}

.btn-clear-filter {
  display: none;
  background: var(--danger);
  color: #fff;
  border: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: var(--spacing-sm);
}

.btn-clear-filter:hover {
  opacity: 0.8;
}

.task-input {
  width: 100%;
  padding: var(--spacing-md);
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.task-input::placeholder {
  color: var(--text-muted);
}

.task-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.15);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: background 0.15s, transform 0.15s;
}

.task-item:hover {
  background: var(--surface-hover);
}

.task-item.selected {
  border: 1px solid var(--primary);
}

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

@keyframes typing-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.task-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.task-placeholder::after {
  content: '|';
  animation: typing-cursor 1s step-end infinite;
  color: var(--primary);
  margin-left: 2px;
}

.task-checkbox {
  appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

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

.task-checkbox:checked::after {
  content: '✓';
  color: #121212;
  font-weight: bold;
  font-size: 14px;
}

.task-checkbox:hover {
  border-color: var(--primary);
}

.task-priority {
  display: flex;
  gap: var(--spacing-xs);
  margin-left: auto;
}

.task-priority-btn {
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.task-priority-btn:hover,
.task-priority-btn.active {
  opacity: 1;
}

.priority-critical {
  background: #ff4444;
  color: #fff;
}

.priority-high {
  background: #ff9800;
  color: #000;
}

.priority-medium {
  background: #ffc107;
  color: #000;
}

.priority-low {
  background: #4caf50;
  color: #fff;
}

.task-priority-btn.active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--text);
}

.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: var(--spacing-xs);
  opacity: 0.3;
  transition: opacity 0.15s;
  position: relative;
}

.drag-handle:hover {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.task-item:hover .drag-handle {
  opacity: 1;
}

.drag-handle::after {
  content: "↕ Arraste para reordenar entre tarefas de mesma prioridade";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  width: 260px;
  line-height: 1.5;
  opacity: 0;
  white-space: normal;
}

.drag-handle:hover::after {
  opacity: 1;
}

.task-item:hover .drag-handle {
  opacity: 1;
}

.drag-handle.hidden {
  display: inline-block;
  opacity: 0.15;
  cursor: not-allowed;
  pointer-events: auto;
  position: relative;
}

.drag-handle.hidden::after {
  content: "🔒 Tarefas com prioridade são ordenadas automaticamente. Remova a prioridade para reorganizar manualmente.";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 280px;
  line-height: 1.5;
  white-space: normal;
  width: 260px;
  opacity: 0;
}

.drag-handle.hidden:hover::after {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.task-item.dragging {
  opacity: 0.5;
  background: var(--surface-hover);
}

.task-item.drag-over {
  border-top: 2px solid var(--primary);
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 1rem;
  color: var(--text);
  word-break: break-word;
  cursor: text;
  line-height: 1.5;
}

.task-link {
  color: var(--primary);
  text-decoration: underline;
}

.task-link:hover {
  color: var(--primary-hover);
}

.task-text mark {
  background: var(--primary);
  color: #121212;
  padding: 0 2px;
  border-radius: 2px;
}

.task-text.is-placeholder {
  color: var(--text-muted);
  font-style: italic;
  position: relative;
}

@keyframes blink {
  0%, 49% { border-right: 2px solid var(--primary); }
  50%, 100% { border-right: 2px solid transparent; }
}

.task-text.is-placeholder {
  color: var(--text-muted);
  font-style: italic;
  border-right: 2px solid var(--primary);
  animation: blink 1s step-end infinite;
}

.task-text-input {
  width: 100%;
  font-size: 1rem;
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: var(--spacing-xs) var(--spacing-sm);
  outline: none;
  resize: vertical;
  min-height: 40px;
  font-family: inherit;
}

.task-actions {
  display: flex;
  gap: var(--spacing-xs);
  opacity: 0;
  transition: opacity 0.15s;
}

.task-item:hover .task-actions,
.task-item.selected .task-actions {
  opacity: 1;
}

.btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  transition: color 0.15s, background 0.15s;
}

.btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.btn-delete:hover {
  color: var(--danger-hover);
}

.btn-copy {
  font-size: 0.85rem;
  padding: var(--spacing-xs) 4px;
}

.btn-copy:hover {
  transform: scale(1.2);
}

.task-image {
  margin-top: var(--spacing-sm);
  border-radius: var(--radius-sm);
  max-width: 150px;
  max-height: 100px;
  cursor: pointer;
  object-fit: cover;
  border: 1px solid var(--border);
}

.task-image-wrapper {
  position: relative;
  display: inline-block;
  margin-top: var(--spacing-sm);
}

.btn-delete-image {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

[data-theme="light"] .toast-undo {
  background: var(--primary);
  color: #fff;
}

.btn-expand {
  background: none;
  border: none;
  color: var(--primary);
  font-size: inherit;
  cursor: pointer;
  padding: 0 2px;
  transition: opacity 0.15s;
  display: inline;
  vertical-align: baseline;
  white-space: nowrap;
}

.btn-expand:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.empty-state .hint {
  font-size: 0.875rem;
  margin-top: var(--spacing-sm);
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--spacing-md);
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 10;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.footer-logo {
  max-height: 20px;
  border-radius: 3px;
  margin-right: 6px;
  opacity: 0.65;
}

.btn-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-footer:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-footer.btn-danger {
  color: var(--danger);
}

.btn-footer.btn-danger:hover {
  background: rgba(207, 102, 121, 0.15);
}

.footer-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 6px;
}

.footer-keys {
  display: flex;
  align-items: center;
  justify-self: center;
}

.footer-utils {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}

.sound-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  transition: opacity 0.2s;
}

.sound-indicator:hover { opacity: 0.8; }
.sound-indicator.muted { opacity: 0.3; text-decoration: line-through; }

.footer-info {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.65;
  margin-right: 6px;
  white-space: nowrap;
  cursor: help;
  transition: opacity 0.15s;
  position: relative;
}

.footer-info:hover { opacity: 1; }

.footer-info::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
  z-index: 100;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.footer-info:hover::after {
  opacity: 1;
}



.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.modal.visible {
  display: flex;
}

.modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  padding: var(--spacing-sm);
  line-height: 1;
}

.modal-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.app.drag-over {
  outline: 3px dashed var(--primary);
  outline-offset: -10px;
}

.app.drag-over::before {
  content: 'Solte a imagem aqui';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--primary);
  color: #121212;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 600;
  z-index: 100;
  pointer-events: none;
}

.confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  align-items: center;
  justify-content: center;
}

.confirm-modal.visible {
  display: flex;
}

.confirm-content {
  background: var(--surface);
  padding: var(--spacing-lg);
  border-radius: var(--radius);
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
}

.confirm-message {
  font-size: 1rem;
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.confirm-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
}

.btn-confirm {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.btn-confirm:hover {
  opacity: 0.8;
}

.btn-cancel {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-delete-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-delete-confirm:disabled:hover {
  background: var(--danger);
}

.confirm-text {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: var(--spacing-sm);
}

.confirm-warning {
  font-size: 0.8rem;
  color: var(--danger);
  margin-bottom: var(--spacing-md);
  line-height: 1.4;
}

.confirm-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-md);
  outline: none;
  transition: border-color 0.2s;
}

.confirm-input:focus {
  border-color: var(--primary);
}

@media (max-width: 480px) {
  .app {
    padding: var(--spacing-md);
    max-width: 95%;
    padding-bottom: var(--spacing-lg);
  }

  .footer {
    display: none;
  }

  .title {
    font-size: 1.4rem;
    padding-right: 30px;
  }

  .title-wrapper {
    position: relative;
  }

  .theme-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
  }

  .counters {
    flex-wrap: wrap;
    gap: 6px;
  }

  .counter {
    font-size: 0.75rem;
    padding: 4px 6px;
  }

  .task-item {
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
  }

  .task-text {
    font-size: 0.95rem;
  }

  .task-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }

  .task-priority {
    margin-left: auto;
  }

  .task-priority-btn {
    padding: 2px 4px;
    font-size: 0.6rem;
  }

  .drag-handle {
    font-size: 0.9rem;
  }

  .task-actions {
    opacity: 1;
  }

  .task-image {
    max-width: 100px;
    max-height: 70px;
  }

  .footer {
    display: none;
  }

  .search-input {
    padding: 10px 38px 10px 36px;
    font-size: 0.9rem;
  }

  .task-input {
    padding: 12px;
    font-size: 0.95rem;
  }
}

  .title {
    font-size: 1.5rem;
  }

  .task-item {
    gap: var(--spacing-sm);
  }

.task-images-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  position: relative;
}

.btn-add-image {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  opacity: 0;
}

.task-item.selected .btn-add-image,
.task-images-container:hover .btn-add-image {
  opacity: 1;
}

.btn-add-image:hover {
  border-color: var(--primary);
  color: var(--primary);
}
  padding: 0;
  box-sizing: border-box;
  margin-left: 4px;
  flex-shrink: 0;
}

.added-img-btn:hover {
  border-color: #bb86fc !important;
  color: #bb86fc !important;
  background: rgba(187,134,252,0.15) !important;
  transform: scale(1.08);
}

.added-img-btn:active {
  transform: scale(0.95);
}

.task-actions {
    opacity: 1;
  }

  .task-image {
    max-width: 120px;
    max-height: 80px;
  }
}

.search-bar {
  display: none;
  width: 100%;
  margin-top: var(--spacing-sm);
}

.search-bar.visible {
  display: block !important;
}

@keyframes searchFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-count {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 48px 14px 44px;
  background: var(--search-bg);
  border: 1px solid var(--primary);
  border-radius: 24px;
  color: var(--text);
  font-size: 1rem;
  box-shadow: var(--shadow);
  outline: none;
}

[data-theme="light"] .search-input {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .search-input:focus {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(124, 77, 255, 0.15);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--primary-hover);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(187, 134, 252, 0.15);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}

.search-close:hover {
  color: var(--text);
}

.task-item.search-highlight {
  box-shadow: 0 0 0 2px var(--primary);
}

/* ==================== ANIMAÇÕES ==================== */

/* Transição global para tema */
body, .app, .task-item, .task-input, .counter, .footer, .task-text {
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Animação ao criar tarefa */
@keyframes taskSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.task-item-enter {
  animation: taskSlideIn 0.3s ease-out forwards;
}

/* Animação ao excluir tarefa - simples fade + scale */
@keyframes taskFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateX(20px);
  }
}

.task-item-exit {
  animation: taskFadeOut 0.3s ease-out forwards;
  pointer-events: none;
}

/* Bounce no checkbox */
@keyframes checkBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  75% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.task-checkbox:checked {
  animation: checkBounce 0.35s ease;
}

/* Glow pulsante no input */
@keyframes inputGlow {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.15);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.25), 0 0 20px rgba(187, 134, 252, 0.15);
  }
}

.task-input:focus {
  animation: inputGlow 2s ease-in-out infinite;
}

/* Pulse nos botões de prioridade */
@keyframes priorityPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.task-priority-btn.active {
  animation: priorityPulse 0.3s ease;
}

/* Flash nos contadores */
@keyframes counterFlash {
  0% { background: var(--primary); color: #fff; transform: scale(1.1); }
  100% { background: var(--surface); color: var(--text-muted); transform: scale(1); }
}

.counter.flash {
  animation: counterFlash 0.5s ease;
}

/* Modal com escala + fade */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal.visible,
.confirm-modal.visible {
  animation: modalFadeIn 0.25s ease forwards;
}

/* Shake para erros no toast */
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.toast.error {
  animation: shakeX 0.4s ease;
}

/* Bounce para toast success */
@keyframes bounceIn {
  0% { transform: translateX(calc(100% + 50px)); opacity: 0; }
  60% { transform: translateX(-10px); }
  80% { transform: translateX(5px); }
  100% { transform: translateX(0); opacity: 1; }
}

.toast.success {
  animation: bounceIn 0.4s ease forwards;
}

/* Drag and drop */
.task-item.dragging {
  opacity: 0.35;
  transform: scale(0.98) rotate(1deg);
  transition: opacity 0.2s, transform 0.2s;
}

.task-item.drag-over {
  border-top: 3px solid var(--primary);
  margin-top: 12px;
  transition: margin 0.2s ease, border-color 0.2s;
}

/* Completar tarefa - riscar com animação */
.task-item.completed .task-text {
  animation: strikeThrough 0.4s ease forwards;
}

@keyframes strikeThrough {
  0% { width: 0; }
  100% { width: 100%; }
}

/* Hover sutil nos itens */
.task-item {
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.task-item:hover {
  transform: translateX(2px);
}

/* Botões com hover suave */
.btn-footer:hover,
.btn-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-footer:active,
.btn-confirm:active {
  transform: translateY(0);
}

/* Imagem com hover zoom */
.task-image {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Search bar slide */
@keyframes searchSlideIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-bar.visible {
  animation: searchSlideIn 0.25s ease forwards;
}

/* Scrollbar estilizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Ripple effect nos botões */
.btn-footer, .btn-confirm {
  position: relative;
  overflow: hidden;
}

.btn-footer .ripple,
.btn-confirm .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Loading spinner para operações */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Skeleton loading para tarefas */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.task-skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hover) 50%, var(--surface) 100%);
  background-size: 200px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

.task-skeleton .skeleton-line {
  height: 16px;
  margin: 8px 0;
  border-radius: 4px;
}

.task-skeleton .skeleton-line:nth-child(1) { width: 80%; }
.task-skeleton .skeleton-line:nth-child(2) { width: 60%; }

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
  position: relative;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  margin-top: var(--spacing-sm);
  overflow: visible;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0%;
}

.progress-text {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==================== SAVE INDICATOR ==================== */
.save-indicator {
  font-size: 0.65rem;
  color: #4caf50;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 30px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.save-indicator.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== TOAST WITH UNDO ==================== */
.toast {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  position: fixed;
  top: var(--spacing-md);
  right: var(--spacing-md);
  transform: translateX(calc(100% + 50px));
  background: var(--toast-bg);
  color: var(--text);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius);
  font-size: 0.875rem;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
  border-left: 3px solid var(--primary);
  box-shadow: var(--toast-shadow);
}

.toast.success { border-left-color: #4caf50; }
.toast.info { border-left-color: #2196f3; }
.toast.warning { border-left-color: #ff9800; }
.toast.error { border-left-color: #f44336; }

.toast-text { flex: 1; }

.toast-undo {
  display: none;
  background: var(--primary);
  color: #121212;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.toast.undo-visible .toast-undo { display: inline-block; }

.toast-undo:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

/* ==================== EMPTY STATE SVG ==================== */
.empty-state {
  display: none;
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.empty-state.visible {
  display: flex;
}

.empty-svg {
  opacity: 0.3;
  margin-bottom: var(--spacing-sm);
}

.empty-svg svg {
  color: var(--text);
  width: 80px;
  height: 80px;
}

.empty-title {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
}

/* ==================== SEÇÕES COLAPSÁVEIS ==================== */
.task-section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--spacing-sm);
  transition: opacity 0.2s;
}

.task-section-header:hover {
  opacity: 0.8;
}

.section-arrow {
  transition: transform 0.25s ease;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.section-arrow.collapsed {
  transform: rotate(-90deg);
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 10px;
}

.task-section.collapsed .task-items {
  display: none;
}

/* ==================== FILTRO ATIVO ==================== */
.counter.filter-active {
  border-bottom: 2px solid var(--primary);
  background: rgba(187, 134, 252, 0.1);
  color: var(--primary);
}

/* ==================== COUNTDOWN ==================== */
.confirm-countdown {
  display: none;
  text-align: center;
  margin-bottom: var(--spacing-sm);
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 600;
}

.confirm-countdown.visible {
  display: block;
  animation: pulseCountdown 1s ease infinite;
}

@keyframes pulseCountdown {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==================== SWIPE TO DELETE ==================== */
.task-item.swiping {
  transition: transform 0.05s linear;
}

.task-item.swiped {
  animation: swipeOut 0.3s ease-out forwards;
}

@keyframes swipeOut {
  to {
    transform: translateX(-120%);
    opacity: 0;
  }
}

/* Help Modal */
.help-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.help-modal.visible { display: flex; animation: modalFadeIn 0.2s ease forwards; }

.help-content {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 900px;
  width: 96%;
  height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
  padding-left: 1rem;
}

.help-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
  z-index: 1;
}

.help-close:hover { color: var(--text); }

.help-title {
  text-align: center;
  padding: var(--spacing-sm) var(--spacing-sm) 2rem;
  font-size: 1.1rem;
  color: var(--text);
}

.help-body {
  padding: 0 var(--spacing-sm) var(--spacing-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  max-width: 800px;
  margin: 0 auto;
  align-items: start;
}

.help-col {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.help-row {
  max-width: 950px;
  margin: 0 auto 1rem auto;
}

.help-section-full {
  background: transparent;
  border-radius: 0;
  padding: 0 0 2rem 0;
}

.shortcuts-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  text-align: center;
  margin-top: var(--spacing-sm);
}

.help-section-full h3 {
  text-align: center;
  padding-bottom: 2rem !important;
}

.shortcuts-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  text-align: center;
}

.shortcuts-grid ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shortcuts-grid ul li::before {
  content: none;
}

.help-section {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: var(--text);
}

.help-section li {
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 1px 0;
  line-height: 1.45;
}

.help-section kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0px 4px;
  font-family: inherit;
  font-size: 0.7rem;
}

.help-close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-sm);
  line-height: 1;
  transition: color 0.15s;
  z-index: 1;
}

.help-close:hover { color: var(--text); }

.help-title {
  text-align: center;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
  font-size: 1.2rem;
  color: var(--text);
}

.help-body {
  padding: 0 var(--spacing-md) var(--spacing-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
}

.help-section {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 0.88rem;
  margin-bottom: var(--spacing-xs);
  color: var(--text);
}

.help-section li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 2px 0;
  line-height: 1.5;
}

.help-section {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 0.95rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text);
}

.help-section ul {
  list-style: none;
  padding: 0;
}

.help-section li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 3px 0;
  line-height: 1.5;
}

.help-section li::before {
  content: "•";
  margin-right: var(--spacing-sm);
  color: var(--primary);
}

.help-section kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 0.75rem;
}

/* ==================== SECTION INFO ICON ==================== */
.section-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: help;
  margin-left: auto;
  position: relative;
  transition: background 0.15s;
}

.section-info:hover { background: var(--surface-hover); }

.section-info::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  line-height: 1.5;
  max-width: 300px;
  white-space: normal;
}

.section-info:hover::after { opacity: 1; }

/* ==================== PROJECT TABS ==================== */
.project-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: var(--spacing-sm) 0 0;
}

.project-tabs::-webkit-scrollbar { display: none; }

.project-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
}

.project-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.project-tab.active {
  background: var(--surface);
  border-bottom-color: var(--primary);
  color: var(--text);
  font-weight: 500;
}

.project-tab .tab-count {
  font-size: 0.65rem;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 8px;
  color: var(--text-muted);
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}

.project-tab.active .tab-count {
  background: var(--primary);
  color: #121212;
}

.btn-add-project {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  margin-left: 4px;
  align-self: center;
  margin-bottom: 6px;
}

.btn-add-project:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(90deg);
}

/* ==================== PROJECT MODAL ==================== */
.project-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.project-modal.visible {
  display: flex;
  animation: modalFadeIn 0.25s ease forwards;
}

.project-modal-content {
  background: var(--surface);
  padding: var(--spacing-lg);
  border-radius: var(--radius);
  width: 90%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.project-modal-content h3 {
  color: var(--text);
  text-align: center;
  margin-bottom: var(--spacing-md);
  font-size: 1.1rem;
}

.project-name-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.project-name-input:focus {
  border-color: var(--primary);
}

.picker-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: var(--spacing-sm) 0 var(--spacing-xs);
}

.color-picker, .icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.15s;
}

.color-option:hover { transform: scale(1.2); }
.color-option.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg);
}

.icon-option {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.2rem;
  background: var(--bg);
  border: 2px solid transparent;
  transition: all 0.15s;
}

.icon-option:hover { background: var(--surface-hover); transform: scale(1.1); }
.icon-option.selected { border-color: var(--primary); }

.project-modal-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  margin-top: var(--spacing-md);
}

/* ==================== PROJECT CONTEXT MENU ==================== */
.project-menu {
  display: none;
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1002;
  overflow: hidden;
  min-width: 160px;
}

.project-menu.visible { display: block; }

.project-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.project-menu button:hover { background: var(--surface-hover); }
.project-menu button.danger { color: var(--danger); }
.project-menu button.danger:hover { background: rgba(207, 102, 121, 0.15); }