:root {
  --primary-color: #0ff;
  --secondary-color: #f0f;
  --bg-color: #111;
  --glass-color: rgba(20, 20, 40, 0.7);
  --text-color: #fff;
  --glow-intensity: 1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Orbitron", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background-color: rgba(0, 255, 255, 0.5);
  border-radius: 50%;
  animation: float 15s infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

.clock-container {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--glass-color);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 2rem 3rem;
  width: 90%;
  max-width: 800px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.clock-container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    var(--primary-color),
    transparent,
    var(--secondary-color),
    transparent
  );
  animation: rotate 6s linear infinite;
  z-index: -1;
  opacity: 0.1;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.clock-container:hover {
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5), 0 0 40px rgba(255, 0, 255, 0.3);
}

.time {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.time-segment {
  font-size: clamp(2rem, 10vw, 6rem);
  font-weight: 700;
  text-align: center;
  color: var(--primary-color);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.7), 0 0 20px rgba(0, 255, 255, 0.5);
  position: relative;
  transition: all 0.3s ease;
}

.time-segment.colon {
  color: var(--secondary-color);
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.7), 0 0 20px rgba(255, 0, 255, 0.5);
  animation: pulse 1s infinite;
  margin: 0 0.5rem;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.ampm {
  font-size: clamp(1rem, 4vw, 2rem);
  color: var(--secondary-color);
  text-shadow: 0 0 5px rgba(255, 0, 255, 0.7);
  align-self: flex-end;
  margin-left: 1rem;
  transition: all 0.3s ease;
}

.date {
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(1rem, 4vw, 1.5rem);
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 2px;
  margin-top: 1rem;
  text-transform: uppercase;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.btn.active {
  background: var(--primary-color);
  color: var(--bg-color);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
}

@media (max-width: 768px) {
  .clock-container {
    padding: 1.5rem 2rem;
  }

  .time {
    gap: 0.2rem;
  }

  .time-segment.colon {
    margin: 0 0.2rem;
  }

  .ampm {
    margin-left: 0.5rem;
  }
}
