/* Giao diện mặc định (sáng) */
body {
  padding-top: 5%;
  margin: 0 auto;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  background-color: whitesmoke;
  color: black;
  width: 80%;
  transition: background-color 0.3s, color 0.3s;
}

h1 {
  font-size: 40px;
  margin: 0;
  color: #333;
}

.content {
  max-width: 500px;
  margin: auto;
  font-size: 20px;
  text-align: center;
}

.content > hr {
  margin: 15px 0 25px 0;
  border: none;
  height: 1px;
  background-color: #ccc;
}

.secret-section {
  margin-bottom: 20px;
  text-align: center;
}

.secret-section label {
  font-weight: bold;
  margin-right: 10px;
  color: #555;
}

input[type=text] {
  font-size: 100%;
  width: 100%;
  padding: 10px 15px;
  margin: 8px 0;
  box-sizing: border-box;
  border: 2px solid #999;
  border-radius: 4px;
  text-align: center;
  background-color: white;
  color: black;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input[type=text]:focus {
  outline: none;
  border-color: #555;
  box-shadow: 0 0 5px rgba(85, 85, 85, 0.3);
}

#code-1 {
  font-size: 48px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #2c3e50;
  margin: 30px 0;
  cursor: pointer;
  padding: 15px;
  transition: color 0.3s, text-shadow 0.3s;
  font-family: 'Courier New', monospace;
  user-select: none;
}

#code-1:hover {
  color: #34495e;
}

#code-1.copied {
  color: #27ae60;
  text-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
}

.copy-notification {
  position: fixed;
  color: #27ae60;
  font-weight: bold;
  font-size: 12px;
  z-index: 1000;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.copy-notification.show {
  animation: slideDown 1.2s ease forwards;
}

@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  15%, 85% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

#ticker {
  font-size: 12px;
  text-align: center;
  color: #666;
  margin: 10px 0;
}

progress {
  width: 100%;
  height: 8px;
  border: none;
  border-radius: 4px;
  background-color: #ddd;
  overflow: hidden;
  margin: 15px 0;
}

progress::-webkit-progress-bar {
  background-color: #ddd;
  border-radius: 4px;
}

progress::-webkit-progress-value {
  background-color: #3498db;
  border-radius: 4px;
  transition: width 0.1s linear;
}

progress::-moz-progress-bar {
  background-color: #3498db;
  border-radius: 4px;
}

.time-offset-section {
  margin-top: 20px;
  padding: 15px;
  background-color: #f0f0f0;
  border-radius: 6px;
  text-align: center;
}

.time-offset-section input[type=number] {
  width: 120px;
  padding: 8px;
  font-size: 14px;
  border: 2px solid #999;
  border-radius: 4px;
  text-align: center;
  margin-right: 10px;
  background-color: white;
  color: black;
  transition: border-color 0.3s;
}

.time-offset-section input[type=number]:focus {
  outline: none;
  border-color: #555;
}

#offset-display {
  display: inline;
  margin: 0;
  font-size: 14px;
  font-weight: bold;
  color: #0066cc;
}

footer {
  text-align: left;
  margin-top: 30px;
  font-size: 12px;
  color: #888;
}

footer p {
  margin: 0;
}

/* Tự động áp dụng khi thiết bị ở chế độ tối */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: whitesmoke;
  }

  h1 {
    color: whitesmoke;
  }

  .secret-section label {
    color: #aaa;
  }

  input[type=text] {
    background-color: #333;
    color: whitesmoke;
    border-color: #555;
  }

  input[type=text]:focus {
    border-color: #777;
    box-shadow: 0 0 5px rgba(119, 119, 119, 0.3);
  }

  #code-1 {
    color: #aaa;
  }

  #code-1:hover {
    color: #ccc;
  }

  #code-1.copied {
    color: #27ae60;
    text-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
  }

  #ticker {
    color: #888;
  }

  progress::-webkit-progress-bar {
    background-color: #333;
  }

  progress::-webkit-progress-value {
    background-color: #666;
  }

  progress::-moz-progress-bar {
    background-color: #666;
  }

  .time-offset-section {
    background-color: #222;
  }

  .time-offset-section input[type=number] {
    background-color: #333;
    color: whitesmoke;
    border-color: #555;
  }

  .time-offset-section input[type=number]:focus {
    border-color: #777;
  }

  #offset-display {
    color: #aaa;
  }

  footer {
    color: #666;
  }
}