/* Breath overlay styles - full-screen opaque overlay with central animated circle
   Include this stylesheet (link rel="stylesheet" href="/css/breath-overlay.css") */

#breath-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2147483645; /* very high but below some critical UI if needed */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  transition: background 400ms ease;
  /* solid background color will be set inline by JS */
}

/* Hidden state */
#breath-overlay.hidden {
  display: none;
}

/* Circle */
.breath-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 500ms cubic-bezier(.2,.9,.2,1), box-shadow 300ms ease;
  will-change: transform;
  margin-bottom: 20px;
}

/* Circle inner subtle styling */
.breath-circle::after {
  content: "";
  display: block;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  transition: transform 500ms cubic-bezier(.2,.9,.2,1);
  will-change: transform;
}

/* Phase classes driving animations via transform: scale() */
.breath-circle.phase-inhale {
  transform: scale(1.18);
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}
.breath-circle.phase-inhale::after {
  transform: scale(1.05);
}

.breath-circle.phase-exhale {
  transform: scale(0.88);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.breath-circle.phase-exhale::after {
  transform: scale(0.96);
}

/* Hold: subtle pulsing */
.breath-circle.phase-hold {
  transform: scale(1.02);
  animation: breathe-pulse 1200ms ease-in-out infinite;
}
.breath-circle.phase-hold::after {
  transform: scale(1.01);
  animation: breathe-pulse-inner 1200ms ease-in-out infinite;
}

@keyframes breathe-pulse {
  0% { transform: scale(1.02); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1.02); }
}
@keyframes breathe-pulse-inner {
  0% { transform: scale(1.01); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.9; }
  100% { transform: scale(1.01); opacity: 1; }
}

/* Phase title */
.breath-phase {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin-top: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
  user-select: none;
}

/* Countdown */
.breath-countdown {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 8px;
  text-align: center;
  user-select: none;
}

/* Responsiveness */
@media (max-width: 520px) {
  .breath-circle { width: 120px; height: 120px; }
  .breath-phase { font-size: 1.25rem; }
  .breath-countdown { font-size: 1rem; }
}
