/* ── Digital Stopwatch & Countdown Timer – Styles ──────────────────────── */

.dst-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 680px;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  color: #1e293b;
  box-sizing: border-box;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.dst__header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.dst__logo {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.dst__title {
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  font-weight: 800;
  margin: 0 0 0.2rem;
  color: #1e293b;
}

.dst__desc {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */

.dst__tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.dst__tab {
  padding: 0.55rem 1.3rem;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  border-radius: 0;
}

.dst__tab--active {
  color: #6c3de0;
  border-bottom-color: #6c3de0;
}

.dst__tab:hover:not(.dst__tab--active) {
  color: #334155;
  border-bottom-color: #cbd5e1;
}

/* ── Panels ──────────────────────────────────────────────────────────────── */

.dst__panel { display: block; }
.dst__panel[hidden] { display: none; }

/* ── Stopwatch display ───────────────────────────────────────────────────── */

.dst__sw-display {
  text-align: center;
  margin-bottom: 1.5rem;
}

.dst__sw-time {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(3rem, 14vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e293b;
  line-height: 1;
  padding: 1rem 0;
  transition: color 0.3s;
}

.dst__sw-time--running { color: #16a34a; }
.dst__sw-time--paused  { color: #6c3de0; }

.dst__progress-bar {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.dst__progress-bar-inner {
  height: 100%;
  width: 100%;
  background: #16a34a;
  animation: dst-pulse 1s ease-in-out infinite;
}

@keyframes dst-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.dst__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.dst__btn {
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  min-width: 100px;
  border: none;
}

.dst__btn:hover  { filter: brightness(0.9); }
.dst__btn:active { transform: scale(0.97); }

.dst__btn--green  { background: #16a34a; color: #fff; }
.dst__btn--amber  { background: #f59e0b; color: #fff; }
.dst__btn--blue   { background: #3b82f6; color: #fff; }
.dst__btn--red-outline {
  background: #fff;
  color: #ef4444;
  border: 2px solid #ef4444;
}
.dst__btn--purple { background: #6c3de0; color: #fff; }
.dst__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Lap table ───────────────────────────────────────────────────────────── */

.dst__lap-table {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  width: 100%;
  border-collapse: collapse;
}

.dst__lap-table th {
  padding: 0.55rem 0.85rem;
  background: #f1f5f9;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}

.dst__lap-table td {
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  color: #1e293b;
  border-top: 1px solid #e2e8f0;
}

.dst__lap-table td.dst__lap-split {
  font-family: 'Courier New', monospace;
  color: #6c3de0;
  font-weight: 600;
}

.dst__lap-table td.dst__lap-total {
  font-family: 'Courier New', monospace;
}

.dst__lap-table tr:nth-child(even) td { background: #f8fafc; }

.dst__empty {
  text-align: center;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ── Countdown inputs ────────────────────────────────────────────────────── */

.dst__cd-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.6rem;
}

.dst__cd-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dst__cd-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.dst__cd-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
}

.dst__cd-field input[type="number"] {
  padding: 0.6rem 0.5rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #0f172a;
  background: #f8fafc;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dst__cd-field input[type="number"]:focus {
  outline: none;
  border-color: #6c3de0;
  box-shadow: 0 0 0 3px rgba(108,61,224,0.15);
  background: #fff;
}

/* ── Presets ─────────────────────────────────────────────────────────────── */

.dst__presets-label {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}

.dst__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.dst__preset {
  padding: 0.3rem 0.7rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.dst__preset:hover {
  background: #e0e7ff;
  border-color: #6c3de0;
  color: #6c3de0;
}

/* ── Countdown ring ──────────────────────────────────────────────────────── */

.dst__cd-display {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  display: flex;
  justify-content: center;
}

.dst__ring-wrap {
  position: relative;
  display: inline-block;
}

.dst__ring-svg {
  width: clamp(160px, 40vw, 200px);
  height: clamp(160px, 40vw, 200px);
  transform: rotate(-90deg);
}

.dst__ring-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 10;
}

.dst__ring-progress {
  fill: none;
  stroke: #6c3de0;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 534.07;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.2s linear, stroke 0.3s;
}

.dst__ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dst__ring-time {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
  transition: color 0.3s;
}

.dst__ring-time--running { color: #6c3de0; }
.dst__ring-time--done    { color: #ef4444; }

.dst__ring-status {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* ── Alert ───────────────────────────────────────────────────────────────── */

.dst__alert {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  text-align: center;
  color: #dc2626;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ── Info box ────────────────────────────────────────────────────────────── */

.dst__info {
  margin-top: 2rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 4px solid #6c3de0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.7;
}

.dst__info strong { color: #374151; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .dst__cd-field input[type="number"] { font-size: 1.1rem; }
  .dst__btn { min-width: 80px; font-size: 0.88rem; padding: 0.55rem 1rem; }
}
