/* Timer Page Styles */

.timer-header {
  text-align: center;
  padding: 60px 0 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(217,166,51,0.12) 0%, transparent 60%);
}
.timer-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.timer-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Mode Tabs */
.timer-mode-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 24px auto;
  max-width: 320px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}
.timer-mode-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.timer-mode-tab.active {
  background: rgba(217,166,51,0.15);
  color: var(--text);
}

/* Duration Picker */
.timer-duration-picker {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 auto 32px;
  max-width: 480px;
  padding: 0 24px;
}
.timer-duration-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.timer-duration-btn:hover {
  border-color: rgba(217,166,51,0.3);
}
.timer-duration-btn.active {
  background: var(--gradient);
  color: var(--bg);
  border-color: transparent;
  font-weight: 700;
}

/* Timer Display */
.timer-display {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0 32px;
}
.timer-ring-container {
  position: relative;
  width: 260px;
  height: 260px;
}
.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.timer-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 6;
}
.timer-ring-progress {
  fill: none;
  stroke: url(#timer-gradient);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 10px rgba(217,166,51,0.4));
}
.timer-ring-glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(217,166,51,0.1);
  animation: timer-pulse 4s ease-in-out infinite;
}
@keyframes timer-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0; }
}
.timer-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 52px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: var(--text);
}
.timer-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 36px));
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 1px;
}

/* Breathing indicator (countup mode) */
.timer-breathing {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 42px));
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}
.timer-breathing.visible {
  opacity: 1;
}

/* Controls */
.timer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 48px;
}
.timer-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.timer-btn svg {
  width: 24px;
  height: 24px;
}
.timer-btn-start {
  width: 72px;
  height: 72px;
  background: var(--gradient);
  color: var(--bg);
}
.timer-btn-start:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 24px rgba(217,166,51,0.4);
}
.timer-btn-start svg {
  width: 28px;
  height: 28px;
}
.timer-btn-stop {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.timer-btn-stop:hover {
  border-color: rgba(217,166,51,0.3);
}
.timer-btn-stop[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Completed state */
.timer-completed-msg {
  text-align: center;
  margin-bottom: 24px;
  opacity: 0;
  transition: opacity 0.5s;
}
.timer-completed-msg.visible {
  opacity: 1;
}
.timer-completed-msg p {
  color: var(--text-secondary);
  font-size: 15px;
}
.timer-completed-msg .timer-duration-result {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* Weekly Bar Chart */
.timer-weekly {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}
.timer-weekly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.timer-weekly-title {
  font-size: 13px;
  color: var(--text-secondary);
}
.timer-weekly-total {
  font-size: 13px;
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.timer-weekly-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
}
.timer-weekly-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.timer-weekly-value {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.timer-weekly-bar {
  width: 100%;
  border-radius: 3px;
  background: rgba(217,166,51,0.5);
  min-height: 3px;
  transition: height 0.3s;
}
.timer-weekly-bar.today {
  background: var(--gradient);
}
.timer-weekly-bar.empty {
  background: rgba(255,255,255,0.06);
  height: 3px !important;
}
.timer-weekly-label {
  font-size: 10px;
  color: var(--text-tertiary);
}
.timer-weekly-label.today {
  color: var(--text);
  font-weight: 700;
}

/* Contribution Heatmap */
.timer-heatmap {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.timer-heatmap-scroll {
  overflow-x: auto;
  padding: 0 12px;
  -webkit-overflow-scrolling: touch;
}
.timer-heatmap-scroll::-webkit-scrollbar {
  display: none;
}
.timer-heatmap-grid {
  display: inline-flex;
}
.timer-heatmap-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
  padding-top: 16px;
  flex-shrink: 0;
}
.timer-heatmap-label {
  width: 14px;
  height: 14px;
  font-size: 9px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-heatmap-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 2px;
}
.timer-heatmap-col:last-child {
  margin-right: 0;
}
.timer-heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
}
.timer-heatmap-cell.future {
  background: rgba(255,255,255,0.03);
}
.timer-heatmap-cell.lv1 { background: rgba(217,166,51,0.25); }
.timer-heatmap-cell.lv2 { background: rgba(217,166,51,0.45); }
.timer-heatmap-cell.lv3 { background: rgba(217,166,51,0.65); }
.timer-heatmap-cell.lv4 { background: rgba(217,166,51,0.9); }
.timer-heatmap-months {
  display: flex;
  margin-bottom: 2px;
}
.timer-heatmap-month {
  font-size: 9px;
  color: var(--text-tertiary);
  flex: none;
  overflow: hidden;
}
.timer-heatmap-body {
  display: flex;
}

/* History Accordion */
.timer-history {
  max-width: 520px;
  margin: 0 auto 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.timer-history-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.timer-history-toggle:hover {
  background: rgba(255,255,255,0.03);
}
.timer-history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.timer-history-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.timer-history-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.06);
  padding: 2px 10px;
  border-radius: 10px;
}
.timer-history-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform 0.3s;
}
.timer-history.open .timer-history-chevron {
  transform: rotate(180deg);
}
.timer-history-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.timer-history.open .timer-history-body {
  max-height: 1200px;
}
.timer-history-list {
  padding: 0 20px;
}
.timer-history-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}
.timer-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.timer-history-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(217,166,51,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.timer-history-item-icon svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}
.timer-history-item-info {
  flex: 1;
  min-width: 0;
}
.timer-history-item-duration {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.timer-history-item-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.timer-history-item-mode {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(217,166,51,0.1);
  padding: 2px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.timer-history-clear {
  display: block;
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}
.timer-history-clear:hover {
  color: #e74c3c;
}

/* CTA */
.timer-cta {
  max-width: 520px;
  margin: 0 auto 60px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}
.timer-cta h2 {
  font-size: 18px;
  margin-bottom: 8px;
}
.timer-cta p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

/* SEO content */
.timer-seo {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.timer-seo h2 {
  font-size: 20px;
  margin-bottom: 12px;
}
.timer-seo p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 600px) {
  .timer-header { padding-top: 40px; }
  .timer-header h1 { font-size: 24px; }
  .timer-ring-container { width: 220px; height: 220px; }
  .timer-time { font-size: 44px; }
  .timer-duration-picker { gap: 6px; }
  .timer-duration-btn { padding: 6px 12px; font-size: 13px; }
}
