/* ── Timer Panel ──────────────────────────────────────────────────
   Countdown timers inside the Calendar/Tasks area of the media panel. */

/* ── Add-timer section ──────────────────────────────────────────── */
.timer-add-section {
  flex-shrink: 0;
  padding: 10px 12px 4px;
}

.timer-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Format hint shown below the inputs */
.timer-format-hint {
  font-size: .70rem;
  color: var(--dim-text);
  padding: 3px 2px 0;
  letter-spacing: .01em;
  user-select: none;
}

.timer-add-label-input,
.timer-add-dur-input {
  flex: 1;
  min-width: 0;
  background: var(--control-bg);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: inherit;
  font-size: .82rem;
  padding: 6px 9px;
  outline: none;
  transition: border-color .15s;
}
/* Duration input: fixed width wide enough to show "0:00:00" */
.timer-add-dur-input {
  flex: 0 0 96px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}
.timer-add-label-input:focus, .timer-add-dur-input:focus {
  border-color: rgba(var(--accent-rgb), .6);
}
.timer-add-dur-input.timer-input-error {
  border-color: #f87171;
  animation: timer-shake .25s ease;
}
@keyframes timer-shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

.timer-add-btn {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), .18);
  border: 1.5px solid rgba(var(--accent-rgb), .4);
  color: rgba(var(--accent-rgb), 1);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
  will-change: transform;
}
.timer-add-btn:hover { background: rgba(var(--accent-rgb), .32); border-color: rgba(var(--accent-rgb), .7); }
.timer-add-btn:active { transform: scale(.92); }

/* ── Timer list ────────────────────────────────────────────────── */
.timer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.timer-empty {
  text-align: center;
  color: var(--dim-text);
  font-size: .82rem;
  padding: 20px 0;
}

/* ── Timer card ────────────────────────────────────────────────── */
.timer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 8px 10px 8px 8px;
  transition: background .2s, border-color .2s;
  animation: timer-card-in .2s ease both;
  will-change: transform;
}
@keyframes timer-card-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.timer-card.timer-done {
  background: var(--surface-alt);
  border-color: var(--divider);
  opacity: .65;
}
.timer-card.timer-paused {
  border-color: rgba(251,146,60,.3);
}

/* ── SVG progress ring ─────────────────────────────────────────── */
.timer-ring {
  flex-shrink: 0;
  width: 44px; height: 44px;
}
.timer-ring svg {
  width: 44px; height: 44px;
  overflow: visible;
}

.timer-circle-bg {
  fill: none;
  stroke: rgba(255,255,255,.10);
  stroke-width: 3;
}
.timer-circle-arc {
  fill: none;
  stroke: rgb(var(--accent-rgb));
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset .25s linear;
  will-change: stroke-dashoffset;
}
.timer-done .timer-circle-arc  { stroke: rgba(255,255,255,.25); }
.timer-paused .timer-circle-arc { stroke: var(--color-warn); }

/* ── Info area ─────────────────────────────────────────────────── */
.timer-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.timer-label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timer-time {
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  color: var(--text);
  line-height: 1.1;
}
.timer-done .timer-time { color: var(--dim-text); }

/* ── Controls ──────────────────────────────────────────────────── */
.timer-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.timer-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--control-bg);
  color: var(--muted-text);
  font-size: .9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  will-change: transform;
}
.timer-btn:hover  { background: var(--hover-bg); color: var(--text); }
.timer-btn:active { transform: scale(.88); }
.timer-btn svg { width: 14px; height: 14px; }

.timer-pause-btn,
.timer-resume-btn,
.timer-restart-btn {
  background: rgba(var(--accent-rgb), .12);
  border-color: rgba(var(--accent-rgb), .25);
  color: rgba(var(--accent-rgb), 1);
}
.timer-pause-btn:hover, .timer-resume-btn:hover, .timer-restart-btn:hover {
  background: rgba(var(--accent-rgb), .25);
  border-color: rgba(var(--accent-rgb), .5);
}
/* Stop deliberately keeps the neutral .timer-btn look rather than joining the
   accented group above: the accent marks the button that MOVES the timer
   (pause/resume/restart), and stop is the one that puts it away. Three visual
   weights across the row — accent for the primary action, neutral for stop,
   danger-on-hover for delete — so a four-button row still reads at a glance. */
.timer-stop-btn:hover { background: var(--hover-bg); color: var(--text); }

.timer-delete-btn { color: var(--dim-text); }
.timer-delete-btn:hover { background: color-mix(in srgb, var(--color-danger), transparent 82%); color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger), transparent 70%); }

/* Timer completion now uses the unified XenonToast system (js/toast.js,
   components/Toast/Toast.css) — the old .timer-done-toast pill was removed. */

/* Standalone Timer widget (extracted from the Agenda hub) */
.timer-panel {
  padding: 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
