/**
 * Liquid Timer Background Styles
 *
 * Provides a visual background fill that grows from bottom-to-top
 * behind the steps list to indicate elapsed time vs planned duration.
 *
 * Design Philosophy:
 * - Continuous motion driven by requestAnimationFrame, with no CSS transitions
 * - Low opacity to avoid distraction from content
 * - Theme-aware gradients (yang/yin)
 * - Accessible with reduced motion and high contrast support
 */

/* =============================================================================
   Timer Background Container
   ============================================================================= */

.timer-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 10;

  /* Purely visual - never blocks interactions */
  pointer-events: none;
}

/* =============================================================================
   Timer Fill Element
   ============================================================================= */

/**
 * Fill element that rises from the bottom to the top of the screen.
 *
 * The element is always full height. JavaScript moves it with translate3d:
 * 100% means empty (fully below the screen), 0% means full. Transform is
 * handled by the GPU and does not trigger layout, so the motion stays smooth
 * when it updates every frame. The top edge is a child, so it moves with the
 * fill and keeps its 2px thickness.
 */
.timer-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: translate3d(0, 100%, 0);  /* Initial state: empty, updated by JavaScript */
  will-change: transform;

  /* Prevent interaction */
  pointer-events: none;
}

/* =============================================================================
   Timer Fill Top Edge
   ============================================================================= */

/**
 * Solid, fully opaque 4px line along the top of the fill.
 * It is more prominent than the translucent fill body, so the current
 * level of the timer is easy to see at a glance.
 *
 * Hidden by default and shown only once the fill has height
 * (the Stimulus controller adds `has-edge`), so an empty timer does not
 * draw a line at the bottom of the screen.
 */
.timer-fill-edge {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  display: none;

  /* Purely visual - never blocks interactions */
  pointer-events: none;
}

.timer-fill.has-edge .timer-fill-edge {
  display: block;
}

/* =============================================================================
   Timer Clock
   ============================================================================= */

/**
 * Current time shown just below the fill's top edge, right-aligned.
 * The clock is a child of the fill, so it moves with the edge in the same
 * compositor frame. `top: 6px` places it below the 2px edge. JavaScript adds a
 * transform only when the edge would rise above the header, which pins the
 * clock under the header.
 */
.timer-clock {
  position: absolute;
  top: 6px;
  right: 2.5rem;

  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgb(41 37 36 / 0.85);

  /* Purely visual - never blocks interactions */
  pointer-events: none;
}

.dark .timer-clock {
  color: rgb(245 245 244 / 0.9);
}

/* Colour (solid, per step type) comes from the Tailwind classes set in the view */

/* =============================================================================
   Yang Theme (Action-Oriented, Warm)
   ============================================================================= */

/**
 * Yang theme: Warm orange gradients for execution/action contexts
 * Light mode: Subtle presence to avoid distraction
 */
.timer-fill-yang {
  background: linear-gradient(
    to top,
    rgba(251, 146, 60, 0.4),    /* Much more visible */
    rgba(251, 146, 60, 0.2)     /* Much more visible */
  );
}

/**
 * Dark mode: Slightly more vibrant to maintain visibility
 */
.dark .timer-fill-yang {
  background: linear-gradient(
    to top,
    rgba(251, 146, 60, 0.10),
    rgba(251, 146, 60, 0.20)
  );
}

/* =============================================================================
   Yin Theme (Reflective, Cool)
   ============================================================================= */

/**
 * Yin theme: Cool purple gradients for planning/reflection contexts
 * Light mode: Subtle presence to avoid distraction
 */
.timer-fill-yin {
  background: linear-gradient(
    to top,
    rgba(139, 92, 246, 0.08),    /* Lighter at bottom */
    rgba(139, 92, 246, 0.15)     /* Deeper at top */
  );
}

/**
 * Dark mode: Slightly more vibrant to maintain visibility
 */
.dark .timer-fill-yin {
  background: linear-gradient(
    to top,
    rgba(139, 92, 246, 0.10),
    rgba(139, 92, 246, 0.20)
  );
}

/* =============================================================================
   Accessibility
   ============================================================================= */

/**
 * High contrast: Increase visibility
 * Helps users with visual impairments
 */
@media (prefers-contrast: high) {
  .timer-fill-yang,
  .timer-fill-yin {
    background: linear-gradient(
      to top,
      rgba(251, 146, 60, 0.20),  /* Increased opacity */
      rgba(251, 146, 60, 0.30)
    );
  }
}

/* =============================================================================
   Timer Behavior Notes
   ============================================================================= */

/**
 * Timer at 100% (Duration Exceeded):
 * - JavaScript caps height at 100% (no overflow)
 * - No additional visual pressure or warnings
 * - Steady state maintained for "something is something" philosophy
 *
 * This aligns with the app's principle of avoiding guilt-inducing
 * time pressure - the timer provides feedback without judgment.
 */