@import url("https://fonts.googleapis.com/css2?family=Michroma&display=swap");

:root {
  --progress-dash: 685;
  --progress-stroke: 12;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Michroma", sans-serif;
}

body {
  background: #f5f5f5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #afbbf5 40%, #667eea 100%);
}

.main-container {
  background: #fff;
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
  gap: 1.75rem;
  padding: 2.5rem;
  border-radius: 0.75rem;
  border: 2px solid #afbbf5;
  box-shadow: 0 0.2rem 1.25rem rgba(0, 0, 0, 0.1);
}

.page-title {
  color: #2a2a2a;
  font-size: 2.25rem;
}

.input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  color: #626262;
  font-size: 0.9em;
  font-weight: 500;
}

.input-group input[type="number"] {
  width: 100%;
  padding: 1rem;
  font-size: 1.2rem;
  text-align: center;
  outline: none;
  border-radius: 0.5rem;
  border: 2px solid #e0e0e0;
  transition: border-color 0.3s ease;
}

.input-group input[type="number"]:focus {
  border-color: #4caf50;
}

.timer-display {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress-circle {
  position: absolute;
  width: 240px;
  height: 240px;
  transform: rotate(-90deg);
}

.progress-circle svg {
  width: 100%;
  height: 100%;
}

.progress-bg {
  fill: none;
  stroke: #e9ecef;
  stroke-width: var(--progress-stroke);
}

.progress-bar {
  fill: none;
  stroke: #667eea;
  stroke-width: var(--progress-stroke);
  stroke-linecap: round;
  stroke-dasharray: var(--progress-dash);
  stroke-dashoffset: var(--progress-dash);
  transition: stroke 0.3s ease;
}

.progress-bar.warning,
.progress-circle.finished .progress-bg {
  stroke: #e74c3c;
}

.progress-bar.animate {
  animation: progressAnimation var(--duration, 10s) linear forwards;
}

@keyframes progressAnimation {
  from {
    stroke-dashoffset: var(--progress-dash);
  }
  to {
    stroke-dashoffset: 0;
  }
}

#countdown {
  font-size: 3rem;
  font-weight: 600;
  color: #333;
  transition: color 0.3s ease;
  z-index: 1;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#countdown.warning {
  color: #e74c3c;
}

.buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.action-btn {
  min-width: 100px;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn i {
  font-size: 1.5rem;
}

.start-btn {
  background: #667eea;
  color: #fff;
}

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

.start-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

.reset-btn {
  background: #f44336;
  color: #fff;
}

.reset-btn:hover {
  background: #da190b;
}

.status-message {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.status-message.show {
  opacity: 1;
  transform: translateY(0);
}

.status-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.finished {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@media (max-width: 480px) {
  .main-container {
    padding: 2rem 1.25rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  #countdown {
    font-size: 2.5rem;
  }

  .buttons {
    flex-direction: column;
    align-items: center;
  }

  .action-btn {
    width: 100%;
    max-width: 200px;
  }
}
