:root {
  --bg-color: #f0f2f5;
  --text-color: #333;
  --container-bg: white;
  --input-border: #ccc;
  --result-bg: #ecf0f1;
}

body.dark-mode {
  --bg-color: #121212;
  --text-color: #f0f0f0;
  --container-bg: #1e1e1e;
  --input-border: #555;
  --result-bg: #2c2c2c;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  text-align: center;
  margin-bottom: 10px;
}

.live-time {
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.container {
  background: var(--container-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}

.input-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.input-group label {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.input-group input {
  flex: 1;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid var(--input-border);
  border-radius: 5px;
  max-width: 120px;
  background: inherit;
  color: inherit;
}

button {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  margin-top: 12px;
  transition: background-color 0.2s ease-in-out;
}

button.calculate {
  background-color: #f1c40f;
}
button.calculate:hover {
  background-color: #d4ac0d;
}

button.reset {
  background-color: #e67e22;
}
button.reset:hover {
  background-color: #ca6f1e;
}

.result {
  margin-top: 20px;
  background: var(--result-bg);
  padding: 15px;
  border-radius: 10px;
  font-size: 15px;
}

.result strong {
  color: var(--text-color);
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 22px;
  transition: 0.4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}
input:checked + .slider {
  background-color: #4caf50;
}
input:checked + .slider:before {
  transform: translateX(18px);
}
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

@media (max-width: 500px) {
  .input-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-group input {
    width: 100%;
    max-width: none;
    margin-top: 5px;
  }

  h1 {
    font-size: 20px;
  }

  .live-time {
    font-size: 13px;
  }

  .result {
    font-size: 14px;
  }

  button {
    font-size: 14px;
    padding: 10px;
  }
}
