/* === Base Styles === */
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh; /* Full viewport height */
  overflow: hidden; /* Prevent scrollbars */
}

/* The card-style container */
.container {
  position: relative;
  width: 90%;
  max-width: 600px;
  margin: 3rem auto;
  padding: 2rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  overflow: visible; /* this lets animations breathe */
  z-index: 0;
}

/* Center inline/inline-block elements inside container for both light and dark modes */
.container.light-mode,
.container.dark-mode {
  text-align: center;
}

/* Center block-level animation elements horizontally */
#bloomCircle,
#pulseDot,
#waveRing {
  margin-left: auto;
  margin-right: auto;
}
button, select {
  margin: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 1.2rem;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: background 0.3s, color 0.3s;
  background: #fff;
  color: #0072ff;
  box-shadow: 0 2px 8px rgba(0,114,255,0.08);
}

button:hover, select:hover {
  background: #f0f0f0;
  color: #0057b8;
}

label {
  font-weight: bold;
  margin-top: 1rem;
  display: block;
}

.timer {
  font-size: 2rem;
  margin-top: 1rem;
  font-weight: bold;
}

.affirmation {
  font-size: 1.2rem;
  margin-top: 1rem;
  font-style: italic;
}

.audio-controls, .controls {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* === Theme Styles === */
body.light-mode {
  background: linear-gradient(to right, #e0e7ff, #fff);
  color: #222;
}

body.dark-mode {
  background: linear-gradient(to right, #232526, #414345);
  color: #fff;
}

.light-mode .container {
  background: rgba(255,255,255,0.8);
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.dark-mode .container {
  background: rgba(34,34,34,0.8);
  box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

/* Center block-level animation elements horizontally */
#bloomCircle,
#pulseDot,
#waveRing {
  margin-left: auto;
  margin-right: auto;
}

/* === Breathing Visual Styles === */
.breath-visual {
  margin: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  position: relative;
}

/* Blooming Circle */
#bloomCircle {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.973) 60%, #0072ff 100%);
  box-shadow: 0 0 40px 10px #0072ff55;
  animation: bloom 4s cubic-bezier(.4,.8,.6,1) infinite;
  margin-bottom: 20px;
  font-weight: bold;
}

/* Pulse Dot */
#pulseDot {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(255,255,255,0.3);
  box-shadow: 0 0 30px 10px rgba(159, 100, 255, 0.699);
  border-radius: 50%;
  animation: pulseDot 4s cubic-bezier(.4,.8,.6,1) infinite;
  margin-bottom: 20px;
}

/* Wave Ring */
.wave {
  margin-top: 20px;
  width: 140px;
  height: 140px;
  border: 8px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  animation: waveBreath 4s infinite;
  box-shadow: 0 0 40px 10px rgba(159, 100, 255, 0.699);
}


/* Text Animation */
#breathText, #breathTextDot, #breathTextWave, #breathTextSquare {
  color: inherit;
  animation: bloomText 4s infinite;
  font-size: 1.5rem;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  position: absolute;
  width: 100%;
}

/* === Notification === */
#callNotification {
  background: #ffc107;
  padding: 1rem;
  border-radius: 10px;
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

/* === Buttons === */
#themeToggleBtn {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
}

/* Light mode buttons */
body.light-mode button,
body.light-mode .audio-controls button,
body.light-mode #animationFlipBtn,
body.light-mode #themeToggleBtn {
  background: #fff;
  color: #0072ff;
  border: none;
  border-radius: 1.2rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,114,255,0.08);
  transition: 0.3s, color 0.3s;
}

/* Dark mode buttons */
body.dark-mode button,
body.dark-mode .audio-controls button,
body.dark-mode #animationFlipBtn,
body.dark-mode #themeToggleBtn {
  background: #232526;
  color: #e0e7ff;
  border: none;
  border-radius: 1.2rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(160,100,255,0.12);
  transition: 0.3s, color 0.3s;
}

/* Button hover effect */
button:hover,
.audio-controls button:hover,
#animationFlipBtn:hover,
#themeToggleBtn:hover {
  background: #f0f0f0;
  color: #0057b8;
}

body.dark-mode button:hover,
body.dark-mode .audio-controls button:hover,
body.dark-mode #animationFlipBtn:hover,
body.dark-mode #themeToggleBtn:hover {
  background: #414345;
  color: #b3aaff;
}

/* Light mode selectors */
body.light-mode #rhythmSelect,
body.light-mode #durationSelect,
body.light-mode #backgroundSelect {
  background: #fff;
  color: #0072ff;
  border: none;
  border-radius: 1.2rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,114,255,0.08);
  padding: 0.6rem 1.2rem;
  margin-bottom: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: background 0.3s, color 0.3s;
}

/* Dark mode selectors */
body.dark-mode #rhythmSelect,
body.dark-mode #durationSelect,
body.dark-mode #backgroundSelect {
  background: #232526;
  color: #e0e7ff;
  border: none;
  border-radius: 1.2rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(160,100,255,0.12);
  padding: 0.6rem 1.2rem;
  margin-bottom: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: 0.3s, color 0.3s;
}

/* === Responsive === */
@media (max-width: 600px) {
  .breath-visual {
    height: 150px;
  }

  .circle, .wave, .square {
    width: 100px;
    height: 100px;
  }

  button, select {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
}

@keyframes bloom {
  0%   { transform: scale(1); opacity: 0.8; }
  40%  { transform: scale(1.25); opacity: 1; }
  60%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}

/* Wave Ring Animation */
@keyframes waveBreath {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Pulse Square Animation */
@keyframes pulseSquare {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Text Bloom Animation */
@keyframes bloomText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
body.light-mode #bloomCircle {
  background: radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.973) 60%, #0072ff 100%);
  box-shadow: 0 0 40px 10px #0072ff55;
}

body.dark-mode #bloomCircle {
  background: radial-gradient(circle at 60% 40%, rgba(160,100,255,0.8) 60%, #a084ff 100%);
  box-shadow: 0 0 40px 10px rgba(160,100,255,0.6);
}

body.light-mode #pulseDot {
  background: #0072ff;
  box-shadow: 0 0 30px 10px #0072ff55;
}

body.dark-mode #pulseDot {
  background: rgba(160,100,255,0.25);
  box-shadow: 0 0 30px 10px rgba(159, 100, 255, 0.699);
}

body.light-mode #waveRing .wave {
  border: 8px solid #0072ff;
  box-shadow: 0 0 40px 10px #0072ff55;
}

body.dark-mode #waveRing .wave {
  border: 8px solid rgba(159, 100, 255, 0.699);
  box-shadow: 0 0 40px 10px rgba(159, 100, 255, 0.699);
}

.breath-visual span {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 1.5rem;
  left: 0;
  color: inherit;
  font-weight: bold;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Specific positioning for each animation */
#breathText {
  top: 50%;
  transform: translateY(-50%);
}

#breathTextDot {
  top: 50%;
  transform: translateY(-50%);
}

#breathTextWave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: matrix(1, 0, 0, 1, -270.002, -14.2753);
  animation: bloomText 4s infinite;
  width: 100%;
  text-align: center;
  font-size: 1.5rem;
  color: inherit;
  font-weight: bold;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* === Global Page Scaling (for both themes) === */
body.light-mode,
body.dark-mode {
  transform: scale(0.6);
  transform-origin: center center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

/* === Wave Ring Centered Properly === */
#waveRing {
  position: relative;
  margin-left: auto;
  margin-right: auto;
  margin-top: 60px;
  width: fit-content;
  /* optional nudge */
  left: 194.5px; /* tweak this if needed */
  bottom: 15px;
}
/* === The Wave Ring Visual Element === */
.wave {
  width: 172.5px; /* adjust if needed */
  height: 172.5px;
  margin-left: 10px; /* adjust if needed */
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* === Text inside the Wave Ring === */
#breathTextWave {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -70%);
  text-align: center;
  
}
/* === Remove conflicting margin styles for waveRing === */
body.light-mode #waveRing,
body.dark-mode #waveRing {
  margin: 0; /* Remove the old margin-left: 210px, etc */
  padding: 0; /* Remove padding that caused spacing issues */
}

/* === Background Variations === */
body.bg-gradient {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}
body.bg-forest {
  background: url('Images/forest.jpg') center/cover no-repeat;
}
body.bg-ocean {
  background: url('Images/ocean.jpg') center/cover no-repeat;
}
body.bg-sunrise {
  background: url('Images/sunrise.jpg') center/cover no-repeat;
}

.breathe-in {
  color: #0575ff !important;
  transition: color 0.3s;
}
.breathe-out {
  color: #311cee !important;
  transition: color 0.3s;
}
