/* Homepage web Pomodoro timer */

.home-web-timer {
  position: relative;
  margin: 0;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(14, 18, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 40px -24px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.home-web-timer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 45% 80% at 100% 50%, rgba(34, 211, 160, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.home-web-timer__panel--copy {
  min-width: 0;
  color: #fff;
  overflow: visible;
}

.home-web-timer__fs-btn {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.4375rem;
  background: rgba(8, 12, 20, 0.6);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-web-timer__fs-btn:hover {
  background: rgba(8, 12, 20, 0.85);
  color: #fff;
}

.home-web-timer__fs-btn[hidden] {
  display: none;
}

.home-web-timer__shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}

.home-web-timer__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(94, 234, 212, 0.75);
}

.home-web-timer__title {
  margin: 0 0 0.875rem;
  padding-bottom: 0.125rem;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.home-web-timer__controls {
  margin: 0;
}

.home-web-timer__controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4375rem;
}

.home-web-timer__field {
  flex: 0 0 auto;
  width: 5.75rem;
}

.home-web-timer__duration {
  width: 100%;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 0.5625rem 1.75rem 0.5625rem 0.6875rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 10, 16, 0.8);
  color: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='white'%3E%3Cpath d='M2 4l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  cursor: pointer;
}

.home-web-timer__start {
  flex: 0 0 auto;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 0.5625rem 1rem;
  border: none;
  border-radius: 0.625rem;
  background: #22d3a0;
  color: #041016;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.home-web-timer__start:hover {
  background: #2ee4b8;
  transform: translateY(-1px);
}

.home-web-timer__session-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.home-web-timer__session-actions[hidden] {
  display: none;
}

.home-web-timer__session-actions.is-visible {
  animation: home-web-timer-actions-in 0.24s ease-out;
}

@keyframes home-web-timer-actions-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}

.home-web-timer__btn-break,
.home-web-timer__btn-done {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 0.8125rem;
  border-radius: 0.625rem;
  cursor: pointer;
  white-space: nowrap;
}

.home-web-timer__btn-break {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.75);
}

.home-web-timer__btn-break:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.home-web-timer__btn-break:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.home-web-timer__btn-done {
  border: 1px solid rgba(34, 211, 160, 0.3);
  background: transparent;
  color: #22d3a0;
}

.home-web-timer__btn-done:hover {
  background: rgba(34, 211, 160, 0.1);
}

.home-web-timer__complete {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: rgba(167, 243, 208, 0.9);
}

.home-web-timer__complete a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.home-web-timer__complete a:hover {
  color: #5eead4;
  border-bottom-color: rgba(94, 234, 212, 0.5);
}

.home-web-timer__complete[hidden] {
  display: none;
}

.home-web-timer__hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(156, 163, 175, 0.95);
}

.home-web-timer__hint[hidden] {
  display: none;
}

.home-web-timer[data-pomo-phase="short_break"],
.home-web-timer[data-pomo-phase="long_break"] {
  border-color: rgba(251, 191, 36, 0.22);
}

.home-web-timer[data-pomo-phase="short_break"]::after,
.home-web-timer[data-pomo-phase="long_break"]::after {
  background: radial-gradient(ellipse 45% 80% at 100% 50%, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
}

.home-web-timer__panel--timer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-web-timer__ring-slot {
  position: relative;
  width: min(100%, 148px);
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-web-timer__ring-slot::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 160, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

@media (min-width: 480px) {
  .home-web-timer__shell {
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0.875rem 1rem;
  }

  .home-web-timer__panel--copy {
    flex: 1;
    min-width: 0;
    padding-right: 0.875rem;
  }

  .home-web-timer__panel--timer {
    flex: 0 0 148px;
    padding-left: 0.875rem;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
  }

  .home-web-timer__ring-slot {
    width: 148px;
    min-height: 148px;
  }
}

@media (min-width: 1024px) {
  .home-web-timer .studybo-aurora-timer {
    width: 144px;
    min-width: 144px;
  }
}

/* Aurora ring in widget — ring only, no inner card box */
.home-web-timer .studybo-aurora-timer {
  position: relative;
  width: min(100%, 148px);
  aspect-ratio: 1;
  min-width: 140px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: inline-size;
  overflow: visible;
}

.home-web-timer .studybo-aurora-timer .studybo-aurora-timer__ring-wrap {
  inset: 0;
}

.home-web-timer .studybo-aurora-timer.is-idle .studybo-aurora-timer__status {
  color: #6b7f88;
  letter-spacing: 0.1em;
}

.home-web-timer .studybo-aurora-timer.is-complete {
  animation: none;
}

.home-web-timer__ring-slot:has(.studybo-aurora-timer.is-complete)::before {
  animation: home-web-timer-complete-glow 2.4s ease-in-out infinite;
}

@keyframes home-web-timer-complete-glow {
  0%, 100% {
    background: radial-gradient(circle, rgba(247, 201, 72, 0.16) 0%, transparent 70%);
  }
  50% {
    background: radial-gradient(circle, rgba(247, 201, 72, 0.28) 0%, transparent 70%);
  }
}

.home-web-timer .studybo-aurora-timer.is-complete .studybo-aurora-timer__time,
.home-web-timer .studybo-aurora-timer.is-complete .studybo-aurora-timer__status {
  color: #f7c948;
}

/* Fullscreen stage timer (unchanged boxless in FS) */
.studybo-hero-fs-stage__mount .studybo-aurora-timer,
.studybo-aurora-timer.is-fs {
  position: relative;
  width: min(100%, 148px);
  aspect-ratio: 1;
  min-width: 140px;
  border-radius: 1rem;
  background: radial-gradient(ellipse at center, #121820 0%, #080c12 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: inline-size;
  overflow: visible;
}

.studybo-aurora-timer__ring-wrap {
  position: absolute;
  inset: clamp(0.55rem, 5cqi, 0.95rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.studybo-aurora-timer__svg {
  width: 100%;
  height: 100%;
}

.studybo-aurora-timer.is-idle .studybo-aurora-timer__progress { opacity: 0; }
.studybo-aurora-timer.is-idle .studybo-aurora-timer__idle-arc { opacity: 1; }
.studybo-aurora-timer:not(.is-idle) .studybo-aurora-timer__idle-arc { opacity: 0; }
.studybo-aurora-timer.is-active .studybo-aurora-timer__progress,
.studybo-aurora-timer.is-complete .studybo-aurora-timer__progress { opacity: 1; }

.studybo-aurora-timer__center {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0.125rem 0.75rem 0.25rem;
  pointer-events: none;
  overflow: visible;
}

.studybo-aurora-timer__time {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.25rem, 6.5cqi, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: #e8f4f8;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.studybo-aurora-timer__status {
  display: block;
  margin-top: 0.4375rem;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9db0ba;
}

.studybo-aurora-timer__session {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.625rem;
  line-height: 1.4;
  color: rgba(157, 176, 186, 0.92);
}

.studybo-aurora-timer.is-paused .studybo-aurora-timer__time,
.studybo-aurora-timer.is-paused .studybo-aurora-timer__status {
  animation: studybo-aurora-blink 550ms step-end infinite;
}

@keyframes studybo-aurora-blink {
  50% { opacity: 0.35; }
}

.studybo-hero-fs-stage {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0e17;
}

.studybo-hero-fs-stage:fullscreen,
.studybo-hero-fs-stage:-webkit-full-screen {
  display: flex;
}

.studybo-hero-fs-stage__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vmin, 3.5rem);
  width: 100%;
  flex: 1;
  padding: clamp(1.5rem, 4vmin, 3rem);
}

.studybo-hero-fs-stage__mount {
  position: relative;
  flex: 1 1 auto;
  width: min(92vmin, calc(100vw - 2.5rem), calc(100dvh - 14rem));
  height: min(92vmin, calc(100vw - 2.5rem), calc(100dvh - 14rem));
  max-width: 720px;
  max-height: 720px;
  aspect-ratio: 1;
}

.studybo-hero-fs-stage__mount .studybo-aurora-timer,
.studybo-aurora-timer.is-fs {
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none !important;
  animation: none !important;
  container-type: size;
}

.studybo-hero-fs-stage__mount .studybo-aurora-timer__ring-wrap,
.studybo-aurora-timer.is-fs .studybo-aurora-timer__ring-wrap {
  inset: clamp(0.375rem, 2.75%, 1rem);
}

.studybo-hero-fs-stage__mount .studybo-aurora-timer__center,
.studybo-aurora-timer.is-fs .studybo-aurora-timer__center {
  position: absolute;
  inset: 14%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 3cqi, 1.25rem);
  text-align: center;
}

.studybo-hero-fs-stage__mount .studybo-aurora-timer__time,
.studybo-aurora-timer.is-fs .studybo-aurora-timer__time {
  font-size: clamp(2rem, 22cqi, 5.5rem);
}

.studybo-hero-fs-stage__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  max-width: min(92vmin, 720px);
}

.studybo-hero-fs-stage__field { flex: 1 1 7rem; min-width: 7rem; }

.studybo-hero-fs-stage__duration {
  width: 100%;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 2rem 0.65rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e8f4f8;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='white'%3E%3Cpath d='M2 4l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.studybo-hero-fs-stage__btn {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.65rem 1.15rem;
  border-radius: 9999px;
  cursor: pointer;
}

.studybo-hero-fs-stage__btn--primary {
  border: none;
  background: #22d3a0;
  color: #0a0e1a;
}

.studybo-hero-fs-stage__btn--break {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
}

.studybo-hero-fs-stage__btn--done {
  border: 1px solid rgba(20, 184, 166, 0.35);
  background: transparent;
  color: #22d3a0;
}

.studybo-hero-fs-stage__exit {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .home-web-timer__session-actions.is-visible,
  .studybo-aurora-timer.is-paused .studybo-aurora-timer__time,
  .studybo-aurora-timer.is-paused .studybo-aurora-timer__status,
  .home-web-timer__ring-slot:has(.studybo-aurora-timer.is-complete)::before {
    animation: none;
  }
}
