/**
 * Task Manager PWA Styles
 * ADHD-friendly design - minimal, clear, focused
 */

/* ============================================================================
   Layout
   ============================================================================ */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #f5f5f5);
}

.header {
  background: var(--primary, #2563eb);
  color: white;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  margin: 0 0 0.75rem 0;
  font-size: 1.25rem;
}

.main {
  flex: 1;
  padding: 1rem;
  padding-bottom: 5rem; /* Space for stats bar */
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ============================================================================
   View Selector
   ============================================================================ */

.view-selector {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.view-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn.active {
  background: white;
  color: var(--primary, #2563eb);
  font-weight: 600;
}

/* ============================================================================
   Focus View - Single task, maximum clarity
   ============================================================================ */

.focus-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.focus-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.focus-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.focus-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.focus-time {
  color: var(--text-light, #6b7280);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.focus-mantra {
  color: var(--text-light, #6b7280);
  font-style: italic;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.focus-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.focus-secondary {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.empty-focus {
  padding: 2rem;
}

.empty-focus .emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-focus h2 {
  margin: 0 0 0.5rem 0;
}

.empty-focus p {
  color: var(--text-light, #6b7280);
  margin-bottom: 1.5rem;
}

/* ============================================================================
   Today View
   ============================================================================ */

.today-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================================================
   Energy View
   ============================================================================ */

.energy-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.energy-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  background: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.energy-btn.active {
  border-color: var(--primary, #2563eb);
  background: var(--primary, #2563eb);
  color: white;
}

.energy-btn[data-energy="low"] { border-color: #10b981; }
.energy-btn[data-energy="low"].active { background: #10b981; }

.energy-btn[data-energy="high"] { border-color: #ef4444; }
.energy-btn[data-energy="high"].active { background: #ef4444; }

.energy-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================================================
   Triage View
   ============================================================================ */

.triage-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.triage-progress {
  text-align: center;
  color: var(--text-light, #6b7280);
  font-size: 0.875rem;
}

.triage-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.triage-emoji {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.triage-title {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
}

.triage-time {
  color: var(--text-light, #6b7280);
  font-size: 0.875rem;
}

.triage-notes {
  color: var(--text-light, #6b7280);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.triage-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.action-btn {
  padding: 0.75rem 0.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn.today { background: var(--primary, #2563eb); color: white; }
.action-btn.week { background: var(--secondary, #10b981); color: white; }
.action-btn.someday { background: #8b5cf6; color: white; }
.action-btn.delete { background: var(--danger, #ef4444); color: white; }
.action-btn.breakdown { background: var(--warning, #f59e0b); color: white; grid-column: span 3; }

.empty-triage {
  text-align: center;
}

.empty-triage .emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ============================================================================
   Task List & Items
   ============================================================================ */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg, #f5f5f5);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.task-item:hover {
  background: var(--border, #e5e7eb);
}

.task-item.quick-win {
  background: rgba(16, 185, 129, 0.1);
}

.task-item.recovery {
  opacity: 0.7;
}

.task-number {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, #2563eb);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

.task-emoji {
  font-size: 1.25rem;
}

.task-text {
  flex: 1;
  font-size: 0.875rem;
}

.task-time {
  color: var(--text-light, #6b7280);
  font-size: 0.75rem;
}

.task-done-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.task-done-btn:hover {
  opacity: 1;
}

/* ============================================================================
   Cards
   ============================================================================ */

.card {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--text, #1f2937);
}

/* ============================================================================
   Stats Bar
   ============================================================================ */

.stats-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 0.75rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary, #2563eb);
}

.stat-label {
  font-size: 0.625rem;
  color: var(--text-light, #6b7280);
  text-transform: uppercase;
}

/* ============================================================================
   FAB (Floating Action Button)
   ============================================================================ */

.fab {
  position: fixed;
  bottom: 5rem;
  right: 1rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--primary, #2563eb);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  z-index: 99;
  transition: transform 0.2s;
}

.fab:hover {
  transform: scale(1.1);
}

/* ============================================================================
   Modals
   ============================================================================ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin: 0 0 1rem 0;
}

.modal-content textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 1rem;
}

.modal-content textarea:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Breakdown list */
.breakdown-list {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.breakdown-list li {
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.breakdown-list li.start-here {
  background: rgba(37, 99, 235, 0.1);
  margin-left: -0.5rem;
  padding-left: 0.5rem;
  border-radius: 0.25rem;
}

.step-time {
  color: var(--text-light, #6b7280);
  font-size: 0.75rem;
}

.breakdown-total {
  font-weight: 600;
  color: var(--primary, #2563eb);
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  background: var(--primary, #2563eb);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark, #1e40af);
}

.btn.secondary {
  background: var(--bg, #f5f5f5);
  color: var(--text, #1f2937);
}

.btn.text {
  background: none;
  color: var(--text-light, #6b7280);
  padding: 0.5rem;
}

.btn.text:hover {
  color: var(--text, #1f2937);
}

.btn.large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* ============================================================================
   Toast Notifications
   ============================================================================ */

.toast {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text, #1f2937);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================================================
   Loading & Empty States
   ============================================================================ */

.loading {
  opacity: 0.5;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border, #e5e7eb);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  color: var(--text-light, #6b7280);
  padding: 1rem;
  font-size: 0.875rem;
}

.error {
  color: var(--danger, #ef4444);
  text-align: center;
  padding: 1rem;
}

/* ============================================================================
   Responsive
   ============================================================================ */

@media (min-width: 768px) {
  .main {
    max-width: 600px;
    margin: 0 auto;
  }

  .triage-actions {
    grid-template-columns: repeat(5, 1fr);
  }

  .action-btn.breakdown {
    grid-column: auto;
  }
}
