:root {
  /* Base */
  --bg-main: #0f172a;
  --bg-surface: #162033;
  --bg-elevated: #1e293b;

  /* Borders */
  --border-subtle: #23304a;

  /* Accent colors */
  --accent-primary: #d6d83a;

  /* Text */
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --footer-height: 42px;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: sans-serif;
  margin: 0;
  padding: 0;
}

header {
  align-items: center;
  display: flex;
  font-weight: bold;
  margin-left: 20px;
}

header p {
  font-size: 18px;
  margin: 20px 0 20px 10px;
}

main.page-wrapper {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: calc(100svh - var(--footer-height) - 62px);
  justify-content: center;
}

.top-container {
  margin-bottom: 20px;
}

h1 {
  margin: 0 0 20px;
}

.switch-wrapper {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin-bottom: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--text-muted);
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background: white;
  transition: 0.4s;
  border-radius: 50%;
}

.status-wrapper {
  font-weight: bold;
}

.status {
  color: #444f64;
  text-shadow: none;
  transition: color 0.3s, text-shadow 0.3s;
}

.status.active {
  color: var(--accent-primary);
  text-shadow: 0 0 20px var(--text-primary);
}

.timer-paragraph {
  margin: 0 0 20px;
}

.timer {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-style: italic;
}

input:checked + .slider {
  background: var(--accent-primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.eye-closed,
.eye-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.eye-closed svg,
.eye-opens svg {
  fill: var(--accent-primary);
}

.hidden {
  display: none !important;
}

footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer p {
  margin: 0 14px;
}

@media (max-width: 768px) {
  footer p {
    margin: 10px 14px;
  }
}

footer a {
  color: var(--text-muted);
}

.timer-container {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timer-svg {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-circle-bg {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 4;
}

.timer-circle {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 4;
  stroke-dasharray: 282.7; /* 2 * π * 45 */
  stroke-dashoffset: 0;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease-out, opacity 0.3s ease;
  opacity: 0; /* hidden by default (count-up mode) */
}

.timer-container.countdown-active .timer-circle {
  opacity: 1; /* fade in when countdown mode is active */
}

.timer-container.countdown-active .timer-paragraph {
  color: var(--text-muted);
}

.timer-paragraph {
  position: absolute;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1rem;
  font-weight: bold;
  color: var(--accent-primary);
}

/* When the live clock is shown inside the timer circle, make it match
   the same styling as the numeric timer (color, size, weight, tabular nums). */
.timer-paragraph .clock {
  color: var(--accent-primary);
  font-size: 1rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

.timer-mode-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;

  transform: translateX(-50%) !important;
  position: absolute;
  top: 0;
  left: 50%;
}

.timer-options option {
  background-color: var(--bg-surface);
  color: var(--accent-primary);
  border: none;
  outline: none;
  padding: 8px;
}

.timer-mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.timer-mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timer-mode-btn {
  background-color: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: inherit;
  transition: all 0.3s;
  font-style: italic;
}

.timer-mode-btn:hover,
.timer-mode-btn.active {
  color: var(--accent-primary);
}

.timer-mode-btn.active {
  font-weight: bold;
}

.countdown-duration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.countdown-duration label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.countdown-input {
  background-color: transparent;
  color: var(--text-muted);
  border: 0;
}

.countdown-input:hover {
  border-color: var(--accent-primary);
}

.countdown-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 8px rgba(214, 216, 58, 0.3);
}

.add-timer-btn {
  background-color: transparent;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: 20px;
  height: 16px;
  font-style: italic;
  z-index: 99;
}

/* Generic fade utility for elements that should animate into view */
.fade {
  opacity: 0;
  transition: opacity 0.36s ease;
}

.fade.in {
  opacity: 1;
  transform: translateY(0);
}

.hidden-height {
  height: 0 !important;
  overflow: hidden !important;
  transition: 1s height ease !important;
}

.hide {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease !important;
}

.screen-lock-status-wrapper {
  position: relative;
  width: 200px;
  height: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.screen-lock-status {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) !important;
  color: var(--text-muted);
  margin-bottom: 10px;
  width: max-content;
}

@media (max-width: 768px) {
  .screen-lock-status-wrapper,
  .status-wrapper,
  .timer-mode-wrapper {
    font-size: 18px;
  }
}
