/* ===== Breathing Circle Animation ===== */

.breath-circle {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(16, 185, 129, 0.4) 0%,
    rgba(16, 185, 129, 0.2) 50%,
    rgba(16, 185, 129, 0.05) 100%);
  box-shadow:
    0 0 60px rgba(16, 185, 129, 0.3),
    0 0 120px rgba(16, 185, 129, 0.1),
    inset 0 0 30px rgba(255, 255, 255, 0.1);
  transition: transform 0.1s ease-out, opacity 0.3s ease;
}

.breath-circle-inner {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(16, 185, 129, 0.4) 100%);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  transition: transform 0.1s ease-out, opacity 0.3s ease;
}

/* Inhale - expanding (green) */
.breath-circle.inhale {
  background: radial-gradient(circle at 30% 30%,
    rgba(16, 185, 129, 0.5) 0%,
    rgba(16, 185, 129, 0.3) 50%,
    rgba(16, 185, 129, 0.1) 100%);
  box-shadow:
    0 0 80px rgba(16, 185, 129, 0.4),
    0 0 160px rgba(16, 185, 129, 0.2),
    inset 0 0 40px rgba(255, 255, 255, 0.15);
}

.breath-circle-inner.inhale {
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(16, 185, 129, 0.5) 100%);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

/* Exhale - contracting (red) */
.breath-circle.exhale {
  background: radial-gradient(circle at 30% 30%,
    rgba(239, 68, 68, 0.4) 0%,
    rgba(239, 68, 68, 0.2) 50%,
    rgba(239, 68, 68, 0.05) 100%);
  box-shadow:
    0 0 60px rgba(239, 68, 68, 0.3),
    0 0 120px rgba(239, 68, 68, 0.1),
    inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.breath-circle-inner.exhale {
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(239, 68, 68, 0.4) 100%);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Hold - pulsing amber */
.breath-circle.hold {
  background: radial-gradient(circle at 30% 30%,
    rgba(245, 158, 11, 0.35) 0%,
    rgba(245, 158, 11, 0.15) 50%,
    rgba(245, 158, 11, 0.05) 100%);
  box-shadow:
    0 0 60px rgba(245, 158, 11, 0.25),
    0 0 120px rgba(245, 158, 11, 0.1),
    inset 0 0 30px rgba(255, 255, 255, 0.08);
  animation: holdPulse 2s ease-in-out infinite;
}

.breath-circle-inner.hold {
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(245, 158, 11, 0.35) 100%);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
  animation: holdPulseInner 2s ease-in-out infinite;
}

@keyframes holdPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes holdPulseInner {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

/* ===== Phase Pills ===== */

.phase-idle {
  background: rgba(113, 113, 122, 0.14);
  color: rgb(161, 161, 170);
}

.phase-inhale {
  background: rgba(99, 102, 241, 0.14);
  color: rgb(199, 210, 254);
}

.phase-exhale {
  background: rgba(16, 185, 129, 0.14);
  color: rgb(167, 243, 208);
}

.phase-hold {
  background: rgba(245, 158, 11, 0.14);
  color: rgb(253, 230, 138);
}

/* ===== Countdown digit animation (roll-down tick) ===== */

.digit {
  display: inline-block;
  width: 0.62em;
  text-align: center;
  will-change: transform, opacity;
}

.digit-colon {
  display: inline-block;
  width: 0.35em;
  text-align: center;
  opacity: 0.9;
}

@keyframes tickDown {
  0%   { transform: translateY(-12px); opacity: 0; }
  100% { transform: translateY(0);     opacity: 1; }
}

.digit.animate {
  animation: tickDown 160ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* ===== Settings Sliders ===== */

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(113, 113, 122, 0.3);
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgb(99, 102, 241);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.slider::-webkit-slider-thumb:active {
  transform: scale(0.95);
}

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgb(99, 102, 241);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* ===== Haptic button feedback ===== */

.haptic {
  position: relative;
  transform: translateZ(0);
  transition:
    transform 120ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 120ms cubic-bezier(0.2, 0.9, 0.2, 1),
    filter 120ms cubic-bezier(0.2, 0.9, 0.2, 1);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.haptic:active {
  transform: scale(0.985) translateY(1px);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.35),
    0 0 0 rgba(255, 255, 255, 0) inset;
  filter: brightness(1.04);
}

.haptic:active::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  pointer-events: none;
}

.haptic:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

/* ===== Reduced motion ===== */

@media (prefers-reduced-motion: reduce) {
  .digit.animate { animation: none; }
  .breath-circle,
  .breath-circle-inner {
    transition: none;
  }
  .breath-circle.hold,
  .breath-circle-inner.hold {
    animation: none;
  }
  .haptic {
    transition: none;
  }
  .haptic:active::after {
    display: none;
  }
  .slider::-webkit-slider-thumb {
    transition: none;
  }
}
