/* Calm, dark, minimal styling */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1d24;
  color: #d8d4cf;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

/* Screens stack on top of each other; only one is visible */
.screen {
  display: none;
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

h1 {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: 4px;
  margin-bottom: 40px;
  color: #e8e4dd;
}

h2 {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 2px;
  color: #e8e4dd;
}

label {
  display: block;
  font-size: 14px;
  letter-spacing: 1px;
  color: #8a8680;
  margin-top: 16px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* Mode selection buttons on home screen */
.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.mode-btn {
  background: #252932;
  color: #d8d4cf;
  border: 1px solid #3a3f4b;
  padding: 24px;
  font-size: 18px;
  letter-spacing: 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: inherit;
}

.mode-btn:hover, .mode-btn:active {
  background: #2d323d;
  border-color: #5a6072;
}

/* Length / round selection buttons */
.length-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.length-btn {
  background: #252932;
  color: #d8d4cf;
  border: 1px solid #3a3f4b;
  padding: 14px 22px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  min-width: 70px;
}

.length-btn.selected {
  background: #4a5066;
  border-color: #7a8099;
  color: #fff;
}

input[type="number"], select {
  background: #252932;
  color: #d8d4cf;
  border: 1px solid #3a3f4b;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  width: 100%;
  max-width: 280px;
  font-family: inherit;
}

.start-btn {
  background: #4a5066;
  color: #fff;
  border: none;
  padding: 18px 50px;
  font-size: 18px;
  letter-spacing: 3px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 24px;
  font-family: inherit;
}

.start-btn:hover {
  background: #5a6076;
}

.back-btn, .text-btn {
  background: none;
  border: none;
  color: #8a8680;
  font-size: 14px;
  cursor: pointer;
  align-self: flex-start;
  font-family: inherit;
}

.text-btn {
  align-self: center;
  margin-top: 30px;
}

/* SESSION SCREEN */
#session-info {
  margin-top: 40px;
}

#session-mode-label {
  font-size: 14px;
  letter-spacing: 3px;
  color: #8a8680;
  text-transform: uppercase;
  margin-bottom: 24px;
}

#session-timer {
  font-size: 64px;
  font-weight: 200;
  letter-spacing: 4px;
  color: #e8e4dd;
}

#session-detail {
  font-size: 14px;
  color: #8a8680;
  margin-top: 16px;
}

.session-controls {
  display: flex;
  gap: 16px;
  margin-top: 60px;
}

#pause-btn, #stop-btn {
  background: #252932;
  color: #d8d4cf;
  border: 1px solid #3a3f4b;
  padding: 14px 30px;
  font-size: 14px;
  letter-spacing: 2px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

/* Breath circle - only shown in breathing mode */
#breath-circle-container {
  display: none;
  margin: 40px 0;
  position: relative;
  width: 200px;
  height: 200px;
  align-items: center;
  justify-content: center;
}

#breath-circle-container.active {
  display: flex;
}

#breath-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #4a5066;
  transition: transform linear, background-color 0.5s;
}

#breath-phase-label {
  position: absolute;
  font-size: 14px;
  letter-spacing: 3px;
  color: #e8e4dd;
  text-transform: uppercase;
}

/* Sleep-dim mode for breathing - reduces brightness gradually */
body.sleep-dim #breath-circle {
  opacity: 0.3;
}

body.sleep-dim #session-timer,
body.sleep-dim #session-detail,
body.sleep-dim #breath-phase-label {
  opacity: 0.2;
}

/* Stats */
#stats-content {
  background: #252932;
  border-radius: 8px;
  padding: 24px;
  width: 100%;
  text-align: left;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #3a3f4b;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: #8a8680;
}

.stat-value {
  color: #e8e4dd;
  font-weight: 500;
}
