/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  user-select: none;
}

/* ===== Background Layer ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(15px);
  transform: scale(1.1); /* prevent blur edges */
  transition: filter 0.5s ease;
  z-index: 0;
}

/* ===== Overlay (UI Container) ===== */
.overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  gap: 18px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.45) 100%);
}

/* ===== Status Text ===== */
.status-text {
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* ===== Timer Display ===== */
.timer-display {
  font-size: 6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timer-display.running {
  transform: scale(1.25);
}

.timer-display .colon {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0.3; }
}

/* ===== Setter ===== */
.setter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: opacity 0.3s ease;
}

.setter-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.setter-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}

.setter-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.8);
  transform: scale(1.1);
}

.setter-btn:active {
  transform: scale(0.95);
}

.setter-value {
  min-width: 80px;
  text-align: center;
}

.setter-value span {
  font-size: 2.4rem;
  font-weight: 600;
}

.setter-unit {
  font-size: 1rem !important;
  font-weight: 300 !important;
  margin-left: 4px;
  opacity: 0.7;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  justify-items: center;
  max-width: 280px;
}

.preset-btn {
  padding: 10px 20px;
  border-radius: 24px;
  border: 1.5px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  min-width: 48px;
  text-align: center;
}

.preset-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.7);
}

.preset-btn:active {
  transform: scale(0.93);
}

/* ===== Pomodoro Toggle ===== */
.pomodoro-toggle-row {
  margin-top: 4px;
}

.pomodoro-toggle-btn {
  padding: 10px 24px;
  font-size: 0.95rem;
  opacity: 0.75;
  transition: all 0.25s ease;
}

.pomodoro-toggle-btn.active {
  opacity: 1;
  background: rgba(255,100,100,0.25);
  border-color: rgba(255,150,150,0.7);
}

/* ===== Pomodoro Bar ===== */
.pomodoro-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.pomodoro-dots {
  display: flex;
  gap: 8px;
}

.pomo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: transparent;
  transition: all 0.3s ease;
}

.pomo-dot.done {
  background: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.9);
}

.pomo-dot.current {
  border-color: rgba(255,200,200,0.9);
  box-shadow: 0 0 8px rgba(255,150,150,0.5);
}

.pomodoro-label {
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  opacity: 0.8;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ===== Progress Ring ===== */
.progress-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  pointer-events: none;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring__bg {
  fill: none;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 8;
}

.progress-ring__fg {
  fill: none;
  stroke: rgba(255,255,255,0.7);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 565.48;  /* 2 * π * 90 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease;
}

/* ===== Controls ===== */
.controls {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 40px;
  border: 2px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.control-btn svg {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.control-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.7);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.control-btn:active {
  transform: translateY(0) scale(0.97);
}

.primary-btn {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.6);
}

/* ===== Completion Overlay ===== */
.complete-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.5s ease;
}

.complete-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.complete-text {
  font-size: 1.8rem;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.complete-filename {
  font-size: 1.1rem;
  opacity: 0.85;
  font-weight: 300;
  margin-top: -12px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.complete-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== Background View Overlay ===== */
.bg-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 40px;
  animation: fadeIn 0.3s ease;
}

.bg-view-hint {
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  opacity: 0.7;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  animation: pulse-hint 2s ease-in-out infinite;
}

@keyframes pulse-hint {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.3; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== Utility ===== */
.hidden {
  display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 500px) {
  .timer-display {
    font-size: 4rem;
  }

  .progress-container {
    width: 220px;
    height: 220px;
  }

  .control-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .setter-btn {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .setter-btn-sm {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
  }

  .preset-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: 40px;
  }

  .complete-buttons {
    flex-direction: column;
    gap: 10px;
  }
}
