:root {
  --bg-color: #f0f0f0;
  --text-color: #333;
  --accent-color: #d9534f;
  --transition-time: 0.5s;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: color var(--transition-time) ease;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.clock-container {
  text-align: left;
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  width: 80%;
  max-width: 1000px;
}

.time {
  font-size: 8vw;
  font-weight: 300;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  display: flex;
  align-items: baseline;
}

.time-change {
  transform: scale(1.05);
  color: var(--accent-color);
}

.date {
  font-size: 2vw;
  margin-top: 20px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.theme-control {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
}

button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  backdrop-filter: blur(5px);
  color: var(--text-color);
  font-size: 20px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

button:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

.theme-menu {
  position: absolute;
  top: 60px;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-menu.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.theme-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-color);
  background: var(--theme-color);
}

.theme-option i {
  font-size: 14px;
  color: var(--icon-color);
}

.theme-option:hover {
  transform: scale(1.1);
  border-color: var(--text-color);
}

.theme-default {
  --bg-color: #f0f0f0;
  --text-color: #333;
  --accent-color: #d9534f;
  --theme-color: #f0f0f0;
  --icon-color: #333;
}

.theme-dark {
  --bg-color: #222;
  --text-color: #fff;
  --accent-color: #d9534f;
  --theme-color: #222;
  --icon-color: #fff;
}

.theme-red {
  --bg-color: #d9534f;
  --text-color: #fff;
  --accent-color: #333;
  --theme-color: #d9534f;
  --icon-color: #fff;
}

.theme-blue {
  --bg-color: #4285f4;
  --text-color: #fff;
  --accent-color: #fbbc05;
  --theme-color: #4285f4;
  --icon-color: #fff;
}

.theme-green {
  --bg-color: #4CAF50;
  --text-color: #fff;
  --accent-color: #FFEB3B;
  --theme-color: #4CAF50;
  --icon-color: #fff;
}

.theme-purple {
  --bg-color: #9C27B0;
  --text-color: #fff;
  --accent-color: #FF9800;
  --theme-color: #9C27B0;
  --icon-color: #fff;
}

.theme-orange {
  --bg-color: #FF9800;
  --text-color: #fff;
  --accent-color: #9C27B0;
  --theme-color: #FF9800;
  --icon-color: #fff;
}

.theme-pink {
  --bg-color: #E91E63;
  --text-color: #fff;
  --accent-color: #00BCD4;
  --theme-color: #E91E63;
  --icon-color: #fff;
}

.theme-cyan {
  --bg-color: #00BCD4;
  --text-color: #fff;
  --accent-color: #E91E63;
  --theme-color: #00BCD4;
  --icon-color: #fff;
}

.milliseconds {
  display: inline-block;
  width: 1.2ch;
  text-align: left;
  color: var(--accent-color);
  transition: transform 0.1s ease;
}

.milliseconds-change {
  transform: translateY(-5px);
}

.digit {
  display: inline-block;
  transition: transform 0.2s ease;
  position: relative;
}

.digit-change {
  animation: digitBounce 0.4s ease;
  color: var(--accent-color);
}

@keyframes digitBounce {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}

.theme-wave {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 300%;
  height: 300%;
  background: var(--new-bg-color);
  z-index: 1000;
  border-radius: 45%;
  animation: waveAnimation 1.5s ease-in-out forwards;
  transform: translate(-50%, 0) rotate(0deg);
  opacity: 0.9;
}

@keyframes waveAnimation {
  0% {
    transform: translate(-50%, 0) rotate(0deg);
    bottom: -100%;
  }
  100% {
    transform: translate(-50%, 0) rotate(360deg);
    bottom: 150%;
  }
}

.separator {
  display: inline-block;
  transition: transform 0.3s ease;
}

.separator-change {
  animation: separatorPulse 0.5s ease;
}

@keyframes separatorPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
  .clock-container {
    left: 5%;
  }
  .time {
    font-size: 15vw;
  }
  .date {
    font-size: 5vw;
  }
}
