/* Professional Dental Clinic Preloader - Tooth Filling Animation */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0EA5A3 0%, #0A8179 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.6s ease-out;
  visibility: visible;
}

#preloader.hide,
#preloader.preloader-fadeout {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
}

.preloader-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

/* Professional tooth container with 3D effect */
.tooth-container {
  position: relative;
  width: 100px;
  height: 140px;
  perspective: 1000px;
}

.tooth {
  width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F7FA 100%);
  border-radius: 20px 20px 40px 40px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset -2px -2px 5px rgba(0, 0, 0, 0.1),
    inset 2px 2px 5px rgba(255, 255, 255, 0.8);
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.6);
  animation: toothPulse 2.5s ease-in-out infinite;
}

/* Realistic tooth filling animation */
.filling {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60px;
  height: 0;
  background: linear-gradient(
    180deg, 
    #1b9b93 0%,
    #0EA5A3 30%,
    #0a8179 100%
  );
  border-radius: 30px 30px 8px 8px;
  animation: fillTooth 2.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.2),
    0 0 30px rgba(14, 165, 163, 0.6),
    inset -1px 0 2px rgba(0, 0, 0, 0.1);
}

@keyframes fillTooth {
  0% {
    height: 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 10px rgba(14, 165, 163, 0.3);
  }
  20% {
    height: 20px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 20px rgba(14, 165, 163, 0.5);
  }
  40% {
    height: 45px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 30px rgba(14, 165, 163, 0.6);
  }
  60% {
    height: 80px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 30px rgba(14, 165, 163, 0.6);
  }
  80%, 100% {
    height: 85px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 25px rgba(14, 165, 163, 0.5);
  }
}

@keyframes toothPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

/* Highlight/shine effect on tooth */
.shine {
  position: absolute;
  top: 12px;
  left: 15px;
  width: 30px;
  height: 40px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  border-radius: 50%;
  filter: blur(6px);
  animation: shineEffect 2.8s ease-in-out infinite;
}

@keyframes shineEffect {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.3;
  }
}

/* Loading text */
.preloader-text {
  color: white;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  animation: fadeInOut 2s ease-in-out infinite;
}

.preloader-text::after {
  content: '';
  animation: dots 2s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes dots {
  0% {
    content: '';
  }
  33% {
    content: '.';
  }
  66% {
    content: '..';
  }
  100% {
    content: '...';
  }
}
