/* Custom styles for smooth animations and visual enhancements */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
}

/* Smooth hand transitions */
svg line {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Second hand gets faster transition */
svg line[stroke="red"] {
  transition: transform 0.1s ease-out;
}

/* Watch face shadow enhancement */
.watch-shadow {
  box-shadow: 
    0 0 0 2px rgba(255, 255, 255, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 2px 8px rgba(255, 255, 255, 0.1);
}

/* Celebration animation */
.celebration {
  animation: celebration 2s ease-in-out;
}

@keyframes celebration {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Fullscreen adjustments */
:fullscreen {
  background: linear-gradient(135deg, #1f2937, #111827);
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Range slider styling */
input[type="range"] {
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
  background: rgba(255, 255, 255, 0.3);
  height: 4px;
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  background: rgba(255, 255, 255, 0.3);
  height: 4px;
  border-radius: 2px;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
}

/* Button hover effects */
button {
  transition: all 0.2s ease-in-out;
}

button:active {
  transform: scale(0.98);
}

/* Clock number positioning refinements */
.clock-number {
  transform: translate(-50%, -50%);
}

/* Debug dots styling */
.debug-dots {
  z-index: 10;
}

/* Success animation for test button */
button:active.test-button {
  background: linear-gradient(45deg, #10b981, #059669);
}

/* Hover effect for watch face */
.watch-face-hover {
  transition: transform 0.3s ease;
}

.watch-face-hover:hover {
  transform: scale(1.05);
}

/* Special styling for Whoopsie Fix theme */
.whoopsie-gradient {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

/* Responsive design for smaller screens */
@media (max-width: 640px) {
  .watch-container {
    width: 280px;
    height: 280px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .watch-face {
    border-width: 4px;
  }
  
  svg line {
    stroke-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  svg line {
    transition: none;
  }
  
  button {
    transition: none;
  }
  
  .celebration {
    animation: none;
  }
}

/* Additional visual enhancements */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, #3b82f6, #10b981, #f59e0b);
  border-radius: inherit;
  z-index: -1;
}

/* Loading animation for when audio context starts */
.audio-loading {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Success checkmark animation */
@keyframes checkmark {
  0% { 
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(45deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(45deg);
    opacity: 1;
  }
}

.success-checkmark {
  animation: checkmark 0.5s ease-in-out;
}

/* Enhanced focus states for accessibility */
button:focus,
input:focus,
select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Custom tooltip styles */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.tooltip:hover::after {
  opacity: 1;
}