/* Contraction Timer */

/* ---- Timer Hero ---- */
.timer-hero {
  text-align: center;
  padding: 32px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.timer-status {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  min-height: 1.4em;
}

.timer-display {
  font-family: 'Courier New', Courier, monospace;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.timer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 64px;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timer-btn-start {
  background: #38a169;
  color: #fff;
}

.timer-btn-start:hover {
  background: #2f855a;
}

.timer-btn-stop {
  background: #e53e3e;
  color: #fff;
}

.timer-btn-stop:hover {
  background: #c53030;
}

/* ---- 5-1-1 Alert ---- */
.alert-511 {
  background: #fff3cd;
  border: 2px solid #f6ad55;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: none;
}

.alert-511.visible {
  display: block;
}

.alert-511-title {
  font-weight: 700;
  font-size: 1rem;
  color: #c05621;
  margin-bottom: 4px;
}

.alert-511-text {
  font-size: 0.9rem;
  color: #744210;
  line-height: 1.5;
}

[data-theme="dark"] .alert-511 {
  background: #744210;
  border-color: #c05621;
}

[data-theme="dark"] .alert-511-title {
  color: #fbd38d;
}

[data-theme="dark"] .alert-511-text {
  color: #fefcbf;
}

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ---- Chart ---- */
.chart-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.chart-container h3 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

#chartWrap {
  max-height: 400px;
  overflow-y: auto;
}

#chartWrap svg {
  display: block;
}

/* ---- Contraction Log ---- */
.contraction-log {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.contraction-log h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.log-table-wrap {
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.log-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  border-bottom: 2px solid var(--color-border-light);
}

.log-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.delete-entry-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.delete-entry-btn:hover {
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.08);
}

.empty-log {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---- Action Buttons ---- */
.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-bg-secondary);
}

.btn-danger {
  background: var(--color-surface);
  color: #e53e3e;
  border-color: #e53e3e;
}

.btn-danger:hover {
  background: #e53e3e;
  color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .timer-display {
    font-size: 2.8rem;
  }
  .timer-btn {
    min-width: 160px;
    min-height: 56px;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
  .stat-card {
    padding: 12px;
  }
  .stat-value {
    font-size: 1rem;
  }
  .timer-display {
    font-size: 2.2rem;
  }
}

/* ---- Print ---- */
@media print {
  .timer-hero,
  .action-buttons,
  .delete-entry-btn {
    display: none !important;
  }
  .contraction-log {
    break-inside: avoid;
  }
}
