/* ===== FlowState — Productivity Dashboard ===== */

:root {
  --glass-bg: rgba(30, 41, 59, 0.55);
  --glass-border: rgba(148, 163, 184, 0.14);
  --ring-circumference: 552.9; /* 2π × 88 */
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #0b1120;
  overflow-x: hidden;
}

/* ---------- Animated ambient background ---------- */
.bg-orb {
  position: fixed;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: drift 22s ease-in-out infinite alternate;
}
.bg-orb-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #4f46e5, transparent 70%);
  top: -120px; left: -100px;
}
.bg-orb-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  bottom: -140px; right: -80px;
  animation-delay: -7s;
  animation-duration: 26s;
}
.bg-orb-3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #0ea5e9, transparent 70%);
  top: 40%; left: 55%;
  opacity: 0.22;
  animation-delay: -14s;
  animation-duration: 30s;
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, -40px) scale(1.12); }
  100% { transform: translate(-40px, 50px) scale(0.95); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148,163,184,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 75%);
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(2, 6, 23, 0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}

.glass-inner {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.glass-btn {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--glass-border);
  color: #cbd5e1;
  transition: all 0.25s ease;
}
.glass-btn:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(129, 140, 248, 0.4);
  transform: translateY(-1px);
}

/* ---------- Timer ring ---------- */
.ring-transition {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
#timerDisplay.low-time { color: #fda4af; }

/* Pulse animation on running state */
body.timer-running #startBtn {
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.45), 0 12px 32px rgba(79,70,229,0.4); }
  50%      { box-shadow: 0 0 0 14px rgba(99,102,241,0), 0 12px 32px rgba(79,70,229,0.4); }
}

/* ---------- Mode buttons ---------- */
.mode-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99,102,241,0.35);
}
.mode-btn:not(.active) { color: #94a3b8; }
.mode-btn:not(.active):hover { color: #e2e8f0; }

/* ---------- Sound mixer cards ---------- */
.sound-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148,163,184,0.12);
  border-radius: 1.25rem;
  padding: 1rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.sound-card.is-on {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(30, 27, 75, 0.35);
}
.sound-toggle {
  width: 42px; height: 24px;
  border-radius: 9999px;
  background: rgba(51, 65, 85, 0.8);
  position: relative;
  transition: background 0.3s ease;
  flex-shrink: 0;
}
.sound-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 9999px;
  background: #94a3b8;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s ease;
}
.sound-card.is-on .sound-toggle { background: rgba(99,102,241,0.7); }
.sound-card.is-on .sound-toggle::after {
  transform: translateX(18px);
  background: #fff;
}

/* Equalizer bars (visualizer when playing) */
.eq-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq-bars span {
  width: 3px; border-radius: 2px;
  background: #818cf8;
  height: 4px;
  transition: height 0.3s ease;
}
.sound-card.is-on .eq-bars span { animation: eq 1.1s ease-in-out infinite; }
.sound-card.is-on .eq-bars span:nth-child(2) { animation-delay: 0.15s; }
.sound-card.is-on .eq-bars span:nth-child(3) { animation-delay: 0.3s; }
.sound-card.is-on .eq-bars span:nth-child(4) { animation-delay: 0.45s; }
@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

/* ---------- Volume slider ---------- */
input[type="range"].vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: rgba(100, 116, 139, 0.4);
  outline: none;
  cursor: pointer;
}
input[type="range"].vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 9999px;
  background: #a5b4fc;
  border: 2px solid #312e81;
  box-shadow: 0 0 8px rgba(129,140,248,0.6);
  transition: transform 0.15s ease;
}
input[type="range"].vol-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }
input[type="range"].vol-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 9999px;
  background: #a5b4fc;
  border: 2px solid #312e81;
}

/* ---------- Todo list ---------- */
.todo-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148,163,184,0.1);
  transition: border-color 0.25s ease, opacity 0.25s ease;
  animation: slideIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
.todo-item:hover { border-color: rgba(129,140,248,0.35); }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.todo-check {
  width: 22px; height: 22px;
  border-radius: 9999px;
  border: 2px solid rgba(148,163,184,0.4);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
  cursor: pointer;
}
.todo-item.done .todo-check {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
}
.todo-check svg { opacity: 0; transform: scale(0.5); transition: all 0.2s ease; }
.todo-item.done .todo-check svg { opacity: 1; transform: scale(1); }
.todo-text { flex: 1; font-size: 0.875rem; color: #e2e8f0; word-break: break-word; }
.todo-item.done .todo-text { color: #64748b; text-decoration: line-through; }
.todo-del {
  color: #475569;
  padding: 0.25rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  opacity: 0;
}
.todo-item:hover .todo-del { opacity: 1; }
.todo-del:hover { color: #fb7185; background: rgba(244,63,94,0.12); }

/* Scrollbar */
#todoList::-webkit-scrollbar { width: 6px; }
#todoList::-webkit-scrollbar-track { background: transparent; }
#todoList::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.4); border-radius: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  aside:first-of-type .glass { min-height: 180px; }
}
