/* ============================================
   FlowHour MVP — Style System
   Aesthetic: "Quiet Luxury / Invisible UI"
   ============================================ */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
  color: #fff;
  background: #0a0a0f;
  -webkit-font-smoothing: antialiased;
}

/* --- Background Layer --- */
#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(1.5px) brightness(0.55) saturate(1.1);
  transform: scale(1.05); /* prevent blur edge artifacts */
  transition: filter 1.8s ease;
}

/* When timer is running, deepen the blur for immersion */
body.running #bg-image {
  filter: blur(4px) brightness(0.4) saturate(1.05);
}

/* --- Rain Canvas --- */
#rain-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 2s ease;
}

/* Fade raindrops when timer is running — less distraction */
body.running #rain-canvas {
  opacity: 0.35;
}

/* --- Frost Overlay --- */
#frost-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    ellipse at 50% 40%,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.35) 70%,
    rgba(0, 0, 0, 0.6) 100%
  );
  pointer-events: none;
}

/* --- Main App UI --- */
#app {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 2rem;
  gap: 1.5rem;
}

/* --- Brand / Header --- */
#brand {
  position: absolute;
  top: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  animation: fadeSlideDown 1.2s ease-out;
}

#brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 200;
  font-size: 1.4rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

#brand-tagline {
  font-weight: 200;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.3rem;
}

/* --- Timer Section --- */
#timer-section {
  text-align: center;
  user-select: none;
  animation: fadeIn 1.5s ease-out 0.3s both;
}

#timer-display {
  font-family: 'Outfit', sans-serif;
  font-weight: 200;
  font-size: clamp(5rem, 14vw, 10rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  text-shadow:
    0 0 60px rgba(0, 0, 0, 0.4),
    0 2px 20px rgba(0, 0, 0, 0.3);
  transition: opacity 0.6s ease, transform 0.6s ease;
  /* Prevent digit-width shifts during countdown */
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  justify-content: center;
}

#timer-minutes,
#timer-seconds {
  display: inline-block;
  min-width: 2.2ch; /* fixed width for 2 digits */
  text-align: center;
}

#timer-separator {
  display: inline-block;
  width: 0.5ch;
  text-align: center;
}

/* Pulsing separator when running */
body.running #timer-separator {
  animation: blink 2s ease-in-out infinite;
}

#timer-label {
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 0.6rem;
  transition: opacity 0.5s ease;
}

body.running #timer-label {
  opacity: 0;
}

/* --- Controls --- */
#controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  animation: fadeSlideUp 1.2s ease-out 0.6s both;
}

/* Time Selector Pills */
#time-selector {
  display: flex;
  gap: 0.5rem;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.running #time-selector {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.time-btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.35s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  letter-spacing: 0.05em;
}

.time-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.time-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Start Button — glassy, premium feel */
#start-btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1rem 2.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#start-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#start-btn:active {
  transform: translateY(0);
}

/* Paused state button */
body.paused #start-btn {
  border-color: rgba(255, 200, 100, 0.3);
  color: rgba(255, 220, 150, 0.85);
}

/* Reset Button */
#reset-btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.5rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

#reset-btn:hover {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
}

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

/* --- Completion Overlay --- */
#completion-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeIn 0.8s ease-out;
}

.completion-card {
  text-align: center;
  padding: 3rem 4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.completion-card h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 200;
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.5rem;
}

.completion-card p {
  font-weight: 300;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.completion-card .stat {
  font-family: 'Outfit', sans-serif;
  font-weight: 200;
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.3rem;
}

.completion-card .stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.completion-card button {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.8rem 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.completion-card button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-15px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.2; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
