/* ================================================================
   TechTools — 番茄专注时钟 (Pomodoro Timer) Styles
   Indigo accent: --cat-study (#6366F1)
   ================================================================ */

/* ------------------------------------------------------------
   1. Timer Circle Area
   ------------------------------------------------------------ */
.pomodoro-timer-area {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.pomodoro-ring-wrap {
  position: relative;
  width: clamp(220px, 40vw, 320px);
  height: clamp(220px, 40vw, 320px);
}

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

/* Track (background circle) */
.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 10;
}

/* Progress arc */
.ring-progress {
  fill: none;
  stroke: var(--cat-study);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 848.23;
  stroke-dashoffset: 0;
  transition: stroke 0.5s ease, filter 0.5s ease;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6)) drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
}

.ring-progress.mode-work {
  stroke: var(--cat-study);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6)) drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
}
.ring-progress.mode-shortBreak {
  stroke: var(--accent-teal);
  filter: drop-shadow(0 0 8px rgba(19, 221, 196, 0.6)) drop-shadow(0 0 20px rgba(19, 221, 196, 0.3));
}
.ring-progress.mode-longBreak {
  stroke: var(--accent-amber);
  filter: drop-shadow(0 0 8px rgba(255, 180, 84, 0.6)) drop-shadow(0 0 20px rgba(255, 180, 84, 0.3));
}

/* Time Display (centered over ring) */
.pomodoro-time-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pomodoro-time-text {
  font-family: var(--font-hero);
  font-size: clamp(42px, 7vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
  text-shadow:
    0 0 20px rgba(99, 102, 241, 0.3),
    0 0 40px rgba(99, 102, 241, 0.15);
  transition: text-shadow 0.5s ease;
}
.pomodoro-time-text.mode-work {
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.35), 0 0 40px rgba(99, 102, 241, 0.15);
}
.pomodoro-time-text.mode-shortBreak {
  text-shadow: 0 0 20px rgba(19, 221, 196, 0.35), 0 0 40px rgba(19, 221, 196, 0.15);
}
.pomodoro-time-text.mode-longBreak {
  text-shadow: 0 0 20px rgba(255, 180, 84, 0.35), 0 0 40px rgba(255, 180, 84, 0.15);
}

.pomodoro-mode-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* Pulse animation when timer is running */
.pomodoro-ring-wrap.running .pomodoro-time-text {
  animation: timerPulse 2s ease-in-out infinite;
}
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ------------------------------------------------------------
   2. Mode Selector Buttons
   ------------------------------------------------------------ */
.pomodoro-mode-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pomodoro-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 20px;
  border-radius: 14px;
  border: 1px solid rgba(147, 129, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 90px;
}
.pomodoro-mode-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}
.pomodoro-mode-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--cat-study);
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.2),
    0 0 40px rgba(99, 102, 241, 0.08);
}

.mode-emoji {
  font-size: 20px;
  line-height: 1;
}
.mode-duration {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.pomodoro-mode-btn.active .mode-duration {
  color: rgba(99, 102, 241, 0.7);
}
.pomodoro-mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ------------------------------------------------------------
   3. Duration Adjustment
   ------------------------------------------------------------ */
.pomodoro-duration-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pomodoro-duration-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: 4px;
}

.pomodoro-dur-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(147, 129, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pomodoro-dur-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}
.pomodoro-dur-btn:active {
  transform: scale(0.92);
}
.pomodoro-dur-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.pomodoro-duration-value {
  font-family: var(--font-hero);
  font-size: 20px;
  font-weight: 700;
  color: var(--cat-study);
  min-width: 32px;
  text-align: center;
}

.pomodoro-duration-unit {
  font-size: 14px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   4. Control Buttons (Start/Pause/Reset)
   ------------------------------------------------------------ */
.pomodoro-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.pomodoro-ctrl-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
}

.ctrl-icon {
  font-size: 18px;
  line-height: 1;
}

/* Start/Pause button */
.pomodoro-ctrl-start {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.2),
    0 0 40px rgba(99, 102, 241, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.pomodoro-ctrl-start:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow:
    0 0 32px rgba(99, 102, 241, 0.35),
    0 0 64px rgba(99, 102, 241, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  letter-spacing: 0.06em;
}
.pomodoro-ctrl-start:active {
  transform: scale(0.96);
}

.pomodoro-ctrl-start.is-running {
  background: rgba(19, 221, 196, 0.15);
  border-color: rgba(19, 221, 196, 0.35);
  box-shadow:
    0 0 20px rgba(19, 221, 196, 0.18),
    0 0 40px rgba(19, 221, 196, 0.06);
}
.pomodoro-ctrl-start.is-running:hover {
  border-color: rgba(19, 221, 196, 0.5);
  box-shadow:
    0 0 32px rgba(19, 221, 196, 0.3),
    0 0 64px rgba(19, 221, 196, 0.1);
}
.pomodoro-ctrl-start.is-running .ctrl-icon {
  color: var(--accent-teal);
}

/* Reset button */
.pomodoro-ctrl-reset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(147, 129, 255, 0.18);
  color: var(--text-secondary);
}
.pomodoro-ctrl-reset:hover:not(:disabled) {
  background: rgba(255, 77, 109, 0.1);
  border-color: rgba(255, 77, 109, 0.35);
  color: var(--text-primary);
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.15);
  transform: translateY(-2px);
}
.pomodoro-ctrl-reset:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   5. Session Counter
   ------------------------------------------------------------ */
.pomodoro-session-counter {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.pomodoro-session-counter strong {
  color: var(--cat-study);
  font-weight: 700;
  font-size: 22px;
  font-family: var(--font-hero);
}

/* ------------------------------------------------------------
   6. Config Panels Grid
   ------------------------------------------------------------ */
.pomodoro-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 768px) {
  .pomodoro-config-grid {
    grid-template-columns: 1fr;
  }
}

.pomodoro-panel-title {
  font-family: var(--font-hero);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

/* ------------------------------------------------------------
   7. Ambient Sound Buttons
   ------------------------------------------------------------ */
.pomodoro-sound-panel {
  /* Extends .tool-config-panel */
}

.pomodoro-sound-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pomodoro-sound-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(147, 129, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}
.pomodoro-sound-btn:hover {
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
}
.pomodoro-sound-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
  color: var(--cat-study);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.sound-emoji {
  font-size: 16px;
  line-height: 1;
}

/* ------------------------------------------------------------
   8. Auto-start Toggle
   ------------------------------------------------------------ */
.pomodoro-auto-panel {
  /* Extends .tool-config-panel */
}

.pomodoro-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.pomodoro-toggle-input {
  display: none;
}

.pomodoro-toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.pomodoro-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.pomodoro-toggle-input:checked + .pomodoro-toggle-track {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.pomodoro-toggle-input:checked + .pomodoro-toggle-track .pomodoro-toggle-thumb {
  left: 23px;
  background: var(--cat-study);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.pomodoro-toggle-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------
   9. Statistics Panel
   ------------------------------------------------------------ */
.pomodoro-stats-panel {
  /* Extends .tool-result-panel */
  margin-bottom: 32px;
}

.pomodoro-stats-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: space-around;
}

.pomodoro-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 24px;
  min-width: 120px;
}

.pomodoro-stat-value {
  font-family: var(--font-hero);
  font-size: 36px;
  font-weight: 700;
  color: var(--cat-study);
  line-height: 1;
  text-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.pomodoro-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   10. Responsive
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .pomodoro-controls {
    gap: 10px;
  }
  .pomodoro-ctrl-btn {
    padding: 10px 24px;
    font-size: 15px;
  }
  .pomodoro-stats-grid {
    gap: 12px;
  }
  .pomodoro-stat-card {
    padding: 8px 16px;
    min-width: 90px;
  }
  .pomodoro-stat-value {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .pomodoro-mode-btn {
    min-width: 75px;
    padding: 8px 14px;
    font-size: 12px;
  }
  .mode-emoji {
    font-size: 18px;
  }
  .pomodoro-controls {
    flex-direction: column;
    align-items: center;
  }
  .pomodoro-ctrl-btn {
    width: 100%;
    max-width: 260px;
    justify-content: center;
  }
  .pomodoro-sound-btns {
    gap: 6px;
  }
  .pomodoro-sound-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .sound-emoji {
    font-size: 14px;
  }
}
