/* ==========================================================================
   AETHERFLOW — COSMIC THEME STYLESHEET
   ========================================================================== */

/* --- TOKENS & VARIABLES --- */
:root {
  --bg: #050508;
  --surface: rgba(14, 12, 22, 0.80);
  --surface-hover: rgba(20, 18, 32, 0.90);
  --border: rgba(255, 255, 255, 0.09);
  --border-focus: rgba(168, 85, 247, 0.55);
  --text: #f0eefb;
  --text-muted: #8a8aac;
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.30);
  --accent-text: #ffffff;
  --high: #ef4444;
  --medium: #a855f7;
  --low: #3b82f6;
  --success: #10b981;
  --blur: blur(20px);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.60);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
/* --- LIGHT MODE THEME --- */
body.light {
  --bg: #f0eef8;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-hover: rgba(245, 243, 255, 0.95);
  --border: rgba(0, 0, 0, 0.09);
  --border-focus: rgba(168, 85, 247, 0.45);
  --text: #1a1630;
  --text-muted: #6b6b8a;
  --accent-glow: rgba(168, 85, 247, 0.15);
  --blur: blur(20px);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}
body.light {
  background: linear-gradient(135deg, #f0eef8 0%, #e8e4f8 100%);
}
body.light .top-bar {
  background: rgba(245, 242, 255, 0.97) !important;
  border-bottom-color: rgba(0,0,0,0.08) !important;
}
body.light .bottom-nav {
  background: rgba(245, 242, 255, 0.97) !important;
  border-top-color: rgba(0,0,0,0.08) !important;
}
body.light .input-field {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.12);
  color: var(--text);
}
body.light .input-field:focus {
  background: rgba(168,85,247,0.05);
}
body.light .select-field option {
  background: #f5f3ff;
  color: #1a1630;
}
body.light .drawer-panel {
  background: #f5f3ff;
}
body.light .task-card {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
body.light #particles-canvas { opacity: 0.4; }


*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}
h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
ul { list-style: none; }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.35); border-radius: 4px; }

/* --- CANVAS --- */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  pointer-events: none;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-page {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 60%, rgba(168,85,247,0.15) 0%, transparent 65%),
              linear-gradient(180deg, #050508 0%, #0a0812 100%);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.landing-page.slide-up-out {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}
.landing-content {
  text-align: center;
  padding: 40px 28px;
  max-width: 380px;
  width: 100%;
}
.landing-icon {
  font-size: 3.5rem;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  animation: pulse-icon 2.5s ease-in-out infinite;
}
@keyframes pulse-icon {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(168,85,247,0.5)); }
  50% { filter: drop-shadow(0 0 24px rgba(236,72,153,0.6)); }
}
.landing-title {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #c084fc, #e879f9, #f0abfc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}
.landing-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}
.landing-pills {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.landing-pills span {
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 30px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 6px;
}
.landing-btn {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: white;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(168,85,247,0.4);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.landing-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(168,85,247,0.5);
}
.landing-btn:active { transform: scale(0.97); }

/* ============================================================
   APP SHELL — 3-ROW GRID (top-bar | content | bottom-nav)
   ============================================================ */
.app-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: calc(56px + env(safe-area-inset-top)) 1fr 64px;
  grid-template-columns: 1fr;
  overflow: hidden;
  z-index: 10;
}
.app-shell.hidden {
  display: none;
}

/* --- TOP BAR --- */
.top-bar {
  grid-row: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 18px 10px 18px;
  padding-top: calc(env(safe-area-inset-top) + 8px);
  background: rgba(8, 6, 14, 0.95);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-icon {
  font-size: 1.1rem;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: var(--transition);
}
.icon-btn:hover, .icon-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* --- MAIN CONTENT SCROLL AREA --- */
.main-content {
  grid-row: 2;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 20px 16px;
  position: relative;
}

/* --- BOTTOM NAV --- */
.bottom-nav {
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(8, 6, 14, 0.97);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.nav-btn {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  transition: var(--transition);
  padding: 8px 0;
}
.nav-btn i {
  font-size: 1.15rem;
  transition: var(--transition);
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active {
  color: var(--accent);
}
.nav-btn.active i {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 6px var(--accent));
}

/* ============================================================
   TAB PANELS
   ============================================================ */
.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: tab-in 0.25s ease;
}
.tab-panel.hidden { display: none; }

@keyframes tab-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: var(--accent); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.input-field {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.input-field:focus {
  border-color: var(--accent);
  background: rgba(168,85,247,0.06);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}
.input-field::placeholder { color: var(--text-muted); }
.select-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8aac' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.select-field option { background: #0e0c16; color: var(--text); }
.textarea-field { resize: vertical; min-height: 64px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ec4899);
  color: white;
  box-shadow: 0 4px 18px rgba(168,85,247,0.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(168,85,247,0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-danger {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.3);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.15);
  border-color: #ef4444;
}
.btn-full { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 0.8rem; }

/* ============================================================
   QUICK ADD CARD
   ============================================================ */
.quick-add-card { }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.search-wrap {
  position: relative;
}
.search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 16px 10px 36px;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input::placeholder { color: var(--text-muted); }

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.filter-pills::-webkit-scrollbar { display: none; }
.pill {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: var(--transition);
  cursor: pointer;
}
.pill:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.pill.active {
  background: var(--accent);
  border-color: transparent;
  color: white;
  box-shadow: 0 3px 12px var(--accent-glow);
}

/* ============================================================
   CATEGORY SCROLL
   ============================================================ */
.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.cat-tab {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}
.cat-tab:hover { color: var(--text); }
.cat-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(168,85,247,0.08);
}

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-chip {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.stat-chip strong, .stat-chip span {
  color: var(--text);
  font-weight: 600;
}
.progress-chip { flex: 1; }
.mini-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}
.mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ec4899);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ============================================================
   TASKS LIST
   ============================================================ */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Task Card */
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.task-card.priority-high::before { background: var(--high); box-shadow: 0 0 12px rgba(239,68,68,0.5); }
.task-card.priority-medium::before { background: var(--medium); box-shadow: 0 0 12px rgba(168,85,247,0.5); }
.task-card.priority-low::before { background: var(--low); box-shadow: 0 0 12px rgba(59,130,246,0.4); }
.task-card:hover {
  border-color: rgba(168,85,247,0.3);
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.task-card.completed {
  opacity: 0.5;
}
.task-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Checkbox */
.task-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: var(--transition);
  cursor: pointer;
}
.task-check.checked {
  background: linear-gradient(135deg, var(--accent), #ec4899);
  border-color: transparent;
}
.task-check.checked::after {
  content: '✓';
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Task Body */
.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
  word-break: break-word;
}
.task-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  word-break: break-word;
}
.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 500;
}
.tag-category { background: rgba(168,85,247,0.12); color: #c084fc; }
.tag-due { background: rgba(6,182,212,0.10); color: #67e8f9; }
.tag-due.overdue { background: rgba(239,68,68,0.12); color: #fca5a5; }
.tag-repeat { background: rgba(16,185,129,0.10); color: #6ee7b7; }

/* Subtasks inside card */
.task-subtasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.subtask-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.subtask-check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.subtask-check.checked {
  background: var(--success);
  border-color: transparent;
}
.subtask-check.checked::after { content: '✓'; color: white; font-size: 0.55rem; }
.subtask-text.done { text-decoration: line-through; opacity: 0.5; }

/* Task Actions */
.task-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.task-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: var(--transition);
  cursor: pointer;
}
.task-action-btn:hover { color: var(--accent); border-color: var(--accent); }
.task-action-btn.focus-active { color: #ec4899; border-color: #ec4899; }
.task-action-btn.btn-delete:hover { color: var(--high); border-color: var(--high); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state i { font-size: 2.5rem; opacity: 0.3; }
.empty-state.hidden { display: none; }

/* ============================================================
   POMODORO WIDGET
   ============================================================ */
.pomo-card { }
.pomo-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 20px;
}
.pomo-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.pomo-track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 8;
}
.pomo-progress {
  fill: none;
  stroke: #ec4899;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s linear;
  filter: drop-shadow(0 0 6px #ec4899);
}
/* Waveform rings */
.wave-ring {
  fill: none;
  stroke: rgba(236,72,153,0.2);
  stroke-width: 1;
  transform-origin: 60px 60px;
  opacity: 0;
  transition: opacity 0.3s;
}
.pomo-ring-svg.playing .wave-ring-1 {
  opacity: 1;
  animation: wave-pulse 2s ease-in-out infinite;
}
.pomo-ring-svg.playing .wave-ring-2 {
  opacity: 1;
  animation: wave-pulse 2s ease-in-out 0.7s infinite;
}
@keyframes wave-pulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0; }
}
.pomo-time-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.pomo-time {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.pomo-mode-label {
  font-size: 0.75rem;
  color: #ec4899;
  font-weight: 500;
  margin-top: 2px;
}
.pomo-modes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.pomo-mode-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: var(--transition);
  cursor: pointer;
}
.pomo-mode-btn.active, .pomo-mode-btn:hover {
  border-color: #ec4899;
  color: #ec4899;
  background: rgba(236,72,153,0.08);
}
.pomo-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.pomo-task-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.pomo-task-label { font-size: 0.72rem; color: var(--text-muted); }
.pomo-task-name {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sound-controls { }
.sound-label { font-size: 0.78rem; color: var(--text-muted); display: block; margin-bottom: 8px; }
.sound-btns {
  display: flex;
  gap: 8px;
}
.sound-btn {
  flex: 1;
  padding: 9px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: var(--transition);
  cursor: pointer;
}
.sound-btn:hover { color: #ec4899; border-color: #ec4899; background: rgba(236,72,153,0.08); }
.sound-btn.active { color: #ec4899; border-color: #ec4899; background: rgba(236,72,153,0.12); }
.stop-sound-btn:hover { color: var(--high); border-color: var(--high); }

/* ============================================================
   ACTIVITIES TAB
   ============================================================ */
.progress-overview {
  display: flex;
  gap: 16px;
  align-items: center;
}
.ring-metric {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}
.ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 7;
}
.ring-fill {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.accent-stroke { stroke: var(--accent); filter: drop-shadow(0 0 5px var(--accent)); }
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-label span { font-size: 1rem; font-weight: 700; color: var(--text); }
.ring-label small { font-size: 0.62rem; color: var(--text-muted); }
.metric-cards {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.metric-chip {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.metric-chip i { font-size: 1rem; color: var(--accent); }
.metric-chip strong { display: block; font-size: 1rem; font-weight: 700; }
.metric-chip small { font-size: 0.68rem; color: var(--text-muted); }

/* Category Breakdown */
.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cat-breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}
.cat-breakdown-name { flex: 1; color: var(--text); }
.cat-breakdown-bar-wrap {
  flex: 2;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.cat-breakdown-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ec4899);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.cat-breakdown-count { color: var(--text-muted); font-size: 0.75rem; min-width: 24px; text-align: right; }

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.achievement-card {
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.achievement-card.locked {
  background: rgba(255,255,255,0.02);
  opacity: 0.45;
  filter: grayscale(1);
}
.achievement-card.unlocked {
  background: rgba(168,85,247,0.10);
  border-color: rgba(168,85,247,0.35);
  box-shadow: 0 0 18px rgba(168,85,247,0.15);
  animation: ach-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ach-pop {
  0% { transform: scale(0.85); }
  100% { transform: scale(1); }
}
.ach-icon { font-size: 1.8rem; margin-bottom: 6px; }
.achievement-card h4 { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.achievement-card p { font-size: 0.7rem; color: var(--text-muted); }

/* Activity Log */
.activity-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.activity-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  gap: 10px;
}
.activity-log-item span { color: var(--text); flex: 1; }
.activity-log-item .time { color: var(--text-muted); font-size: 0.72rem; flex-shrink: 0; }
.activity-log-empty { color: var(--text-muted); font-size: 0.82rem; text-align: center; padding: 20px; }

/* ============================================================
   SETTINGS TAB
   ============================================================ */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(168,85,247,0.4);
}
.profile-info { flex: 1; }
.profile-name-input {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 6px 0 !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
.profile-name-input:focus {
  border-bottom-color: var(--accent) !important;
  box-shadow: none !important;
  background: transparent !important;
}
.profile-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Accent Dots */
.accent-dots {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.accent-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  outline: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}
.accent-dot:hover { transform: scale(1.15); }
.accent-dot.active {
  outline: 2px solid white;
  outline-offset: 2px;
  box-shadow: 0 0 14px currentColor;
}

/* Sliders */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.slider-row label { min-width: 90px; }
.slider-row input[type=range] {
  flex: 1;
  accent-color: var(--accent);
  height: 3px;
  cursor: pointer;
}
.slider-row span { min-width: 36px; text-align: right; color: var(--text); }

/* Data Buttons */
.data-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* About Card */
.about-card {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}
.about-icon { font-size: 2rem; margin-bottom: 10px; background: linear-gradient(135deg, #a855f7, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; display: block; }
.about-card p { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.about-card small { font-size: 0.78rem; }

/* ============================================================
   TASK DRAWER
   ============================================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(4px);
}
.drawer-overlay.hidden { display: none; }
.drawer-panel {
  background: #0d0b18;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 20px 36px;
  animation: drawer-up 0.3s cubic-bezier(0.34, 1.1, 0.64, 1);
}
@keyframes drawer-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.drawer-header h3 { font-size: 1.1rem; font-weight: 700; }
.drawer-form { display: flex; flex-direction: column; gap: 12px; }
.subtasks-section { display: flex; flex-direction: column; gap: 8px; }
.sub-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.subtask-input-row { display: flex; gap: 8px; }
.subtasks-list { display: flex; flex-direction: column; gap: 6px; }
.drawer-subtask-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  gap: 8px;
}
.drawer-subtask-item .left { display: flex; align-items: center; gap: 8px; flex: 1; }
.drawer-subtask-del { color: var(--text-muted); font-size: 0.8rem; padding: 4px; }
.drawer-subtask-del:hover { color: var(--high); }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   4-BUTTON BOTTOM NAV ADJUSTMENT
   ============================================================ */
.nav-btn {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 500;
  transition: var(--transition);
  padding: 6px 0;
}
.nav-btn i { font-size: 1.05rem; transition: var(--transition); }

/* ============================================================
   DRAG & DROP
   ============================================================ */
.task-card {
  position: relative;
}
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: grab;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.2s;
  margin-top: 2px;
  user-select: none;
  -webkit-user-select: none;
}
.drag-handle:hover { opacity: 1; color: var(--accent); }
.task-card.dragging {
  opacity: 0.4;
  transform: scale(0.98);
  border-color: var(--accent) !important;
}
.task-card.drag-over {
  border-color: var(--accent) !important;
  background: rgba(168,85,247,0.06) !important;
  transform: translateY(-2px);
}

/* ============================================================
   RICH TEXT EDITOR
   ============================================================ */
.richtext-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.richtext-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  flex-wrap: wrap;
}
.rt-btn {
  width: 30px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}
.rt-btn:hover {
  background: rgba(168,85,247,0.12);
  color: var(--accent);
  border-color: rgba(168,85,247,0.25);
}
.rt-btn.active {
  background: rgba(168,85,247,0.15);
  color: var(--accent);
  border-color: var(--accent);
}
.rt-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 3px;
}
.rt-clear:hover { color: var(--high) !important; }
.richtext-content {
  min-height: 80px;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s;
}
.richtext-content:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.richtext-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.richtext-content ul, .richtext-content ol {
  padding-left: 20px;
}
.richtext-content b, .richtext-content strong { color: var(--text); }
/* Rendered rich text in task cards */
.task-rich-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  word-break: break-word;
  line-height: 1.5;
}
.task-rich-desc ul, .task-rich-desc ol { padding-left: 16px; }
body.light .richtext-toolbar { background: rgba(0,0,0,0.03); }
body.light .richtext-content { background: rgba(0,0,0,0.03); }

/* ============================================================
   PLANNER TAB
   ============================================================ */
.planner-subnav {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.planner-sub-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.planner-sub-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.planner-sub-btn.active {
  background: rgba(168,85,247,0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.planner-view { display: flex; flex-direction: column; gap: 14px; }
.planner-view.hidden { display: none; }

/* Today header */
.today-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.today-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.today-header-icon {
  font-size: 1.6rem;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.today-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.today-date-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.today-progress-chip {
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* Time Slot Cards */
.time-slot-card { }
.slot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.slot-emoji { font-size: 1.4rem; flex-shrink: 0; }
.slot-info { flex: 1; }
.slot-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.slot-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.slot-tasks {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.slot-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.slot-task-item:hover {
  border-color: rgba(168,85,247,0.3);
  background: rgba(168,85,247,0.05);
}
.slot-task-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.slot-task-check.checked {
  background: linear-gradient(135deg, var(--accent), #ec4899);
  border-color: transparent;
}
.slot-task-check.checked::after { content: '✓'; color: white; font-size: 0.6rem; font-weight: 700; }
.slot-task-title {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-task-title.done { text-decoration: line-through; opacity: 0.5; }
.slot-task-time-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.slot-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
  opacity: 0.7;
}

/* ============================================================
   CALENDAR VIEW
   ============================================================ */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  padding: 2px;
  gap: 2px;
  border: 1px solid transparent;
}
.cal-day:hover {
  background: rgba(168,85,247,0.08);
  color: var(--text);
}
.cal-day.today {
  background: rgba(168,85,247,0.12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.cal-day.selected {
  background: var(--accent);
  color: white;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 3px 12px var(--accent-glow);
}
.cal-day.empty { cursor: default; }
.cal-day.empty:hover { background: none; }
.cal-task-dots {
  display: flex;
  gap: 2px;
  justify-content: center;
}
.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}
.cal-dot.done { background: var(--success); }

