/* Timer Mode Styles */
.main-content {
  position: fixed;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1 !important;
  will-change: transform; /* Improves performance for animations */
}

#timer-mode {
  min-width: 500px;
  max-width: 800px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 40px;
  border: 1px solid rgba(255, 165, 0, 0.1);
  position: relative;
  transform: translateZ(0); /* Hardware acceleration */
  animation: softAppear 0.5s ease-out forwards;
}

@keyframes softAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timer-display {
  font-family: "vpssolah", monospace;
  font-size: 100px;
  color: #ffa500;
  text-align: center;
  margin: 20px 0;
  text-shadow: 0 0 15px rgba(255, 165, 0, 0.5);
  letter-spacing: 2px;
  animation: timerGlow 3s infinite alternate;
}

@keyframes timerGlow {
  0%,
  100% {
    text-shadow: 0 0 15px rgba(255, 165, 0, 0.5);
  }
  50% {
    text-shadow: 0 0 30px rgba(255, 165, 0, 0.8),
      0 0 50px rgba(255, 165, 0, 0.4);
  }
}

.timer-inputs {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 15px;
}

.timer-input-group {
  position: relative;
}

.timer-input-group label {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #ffa500;
  font-weight: 600;
  letter-spacing: 1px;
}

.timer-inputs input {
  width: 80px;
  height: 45px;
  font-size: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 165, 0, 0.2);
  color: #ffa500;
  border-radius: 10px;
  font-family: "vpssolah", monospace;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.timer-inputs input:focus {
  outline: none;
  border-color: #ffa500;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

.timer-inputs input::-webkit-inner-spin-button,
.timer-inputs input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Sound selector styles */
.sound-selector {
  margin: 20px 0;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.sound-selector label {
  display: block;
  font-size: 14px;
  color: #ffa500;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}

.sound-selector select {
  flex: 1;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 165, 0, 0.2);
  border-radius: 10px;
  color: #ffa500;
  font-size: 14px;
  cursor: pointer;
  font-family: "vpssolah", monospace;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sound-selector select:focus {
  outline: none;
  border-color: #ffa500;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

.sound-selector .test-sound {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 20px;
  background: #666;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform; /* Improves performance */
}

.sound-selector .test-sound:hover {
  background: #777;
  transform: scale(1.1);
}

.timer-controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
}

.control-btn {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 30px;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, background-color; /* Improves performance */
}

#start-timer {
  background: #4caf50;
}

#start-timer:hover {
  background: #45a049;
  transform: scale(1.1);
}

#reset-timer {
  background: #666;
}

#reset-timer:hover {
  background: #777;
  transform: scale(1.1);
}

/* Notification Modal */
.notification-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.notification-modal.show {
  display: flex;
  opacity: 1;
}

.notification-content {
  background: rgba(0, 0, 0, 0.9);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(255, 165, 0, 0.2);
  box-shadow: 0 0 30px rgba(255, 165, 0, 0.2);
  animation: enhancedSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateZ(0); /* Hardware acceleration */
}

.notification-icon {
  font-size: 40px;
  color: #ffa500;
  margin-bottom: 20px;
}

.notification-content h2 {
  color: #ffa500;
  font-size: 28px;
  margin: 10px 0;
  font-family: "vpssolah", monospace;
}

.notification-time {
  color: #ffa500;
  font-size: 24px;
  margin: 15px 0;
  font-family: "vpssolah", monospace;
}

.notification-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.notification-buttons .btn {
  padding: 10px 25px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform; /* Improves performance */
}

.notification-buttons .restart-btn {
  background: #4caf50;
  color: white;
}

.notification-buttons .ok-btn {
  background: #666;
  color: white;
}

.notification-buttons .btn:hover {
  transform: scale(1.1);
}

body {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.8s ease-in-out;
}

#bgChangeBtn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 8px;
  transition: color 0.2s ease;
}

#bgChangeBtn:hover {
  color: #ddd;
}

/* Background container styles */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  transition: transform 0.5s ease; /* For smoother background transitions */
}

#bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0); /* Hardware acceleration */
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

/* Timer Alert Modal */
.timer-alert {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timer-alert.show {
  display: flex;
  opacity: 1;
}

.alert-content {
  background-color: rgba(0, 0, 0, 0.9);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  border: 1px solid rgba(255, 165, 0, 0.2);
  box-shadow: 0 0 30px rgba(255, 165, 0, 0.2);
  animation: enhancedSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateZ(0); /* Hardware acceleration */
}

.alert-icon {
  font-size: 48px;
  margin-bottom: 25px;
}

.alert-message {
  color: #ffa500;
  font-size: 24px;
  margin-bottom: 30px;
  line-height: 1.4;
  font-family: "Digital-7", monospace;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

.alert-button {
  background: #4caf50;
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  font-family: "Digital-7", monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-width: 150px;
  will-change: transform; /* Improves performance */
}

.alert-button:hover {
  background: #45a049;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

/* Enhanced Animations with Multiple Keyframes */
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.2;
  }
  40% {
    opacity: 0.4;
  }
  60% {
    opacity: 0.6;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  20% {
    opacity: 0.8;
  }
  40% {
    opacity: 0.6;
  }
  60% {
    opacity: 0.4;
  }
  80% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
  }
}

@keyframes enhancedSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-60px);
  }
  20% {
    opacity: 0.2;
    transform: translateY(-48px);
  }
  40% {
    opacity: 0.4;
    transform: translateY(-36px);
  }
  60% {
    opacity: 0.6;
    transform: translateY(-24px);
  }
  80% {
    opacity: 0.8;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseEffect {
  0% {
    transform: scale(1);
  }
  10% {
    transform: scale(1.02);
  }
  20% {
    transform: scale(1.04);
  }
  30% {
    transform: scale(1.06);
  }
  40% {
    transform: scale(1.08);
  }
  50% {
    transform: scale(1.1);
  }
  60% {
    transform: scale(1.08);
  }
  70% {
    transform: scale(1.06);
  }
  80% {
    transform: scale(1.04);
  }
  90% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Apply pulse animation to buttons when active */
.control-btn:active,
.notification-buttons .btn:active,
.alert-button:active {
  animation: pulseEffect 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Add GPU acceleration to all animated elements */
.control-btn,
.notification-buttons .btn,
.alert-button,
.notification-content,
.alert-content,
.sound-selector .test-sound {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}
