.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  overflow: hidden;
}

.loading-overlay::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.2) 80%);
  animation: rotate 30s linear infinite;
}

.dark-mode .loading-overlay {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.loader-hidden {
  opacity: 0;
  visibility: hidden;
}

.camera-loader {
  position: relative;
  width: 200px;
  height: 200px;
  perspective: 1200px;
  transform-style: preserve-3d;
  z-index: 2;
}

.camera {
  position: relative;
  width: 120px;
  height: 80px;
  background: linear-gradient(to bottom, #34495e, #2c3e50);
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 3px 10px rgba(0, 0, 0, 0.3);
  transform-style: preserve-3d;
  animation: float 4s ease-in-out infinite;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.camera-top {
  position: absolute;
  top: -15px;
  left: 30px;
  width: 60px;
  height: 15px;
  background: linear-gradient(to bottom, #3a536b, #34495e);
  border-radius: 7px 7px 0 0;
  transform-style: preserve-3d;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
}

.camera-flash {
  position: absolute;
  top: -11px;
  left: 55px;
  width: 10px;
  height: 10px;
  background: #f1c40f;
  border-radius: 50%;
  box-shadow: 0 0 15px #f1c40f;
  animation: flash 5s ease-in-out infinite;
  z-index: 2;
}

.camera-button {
  position: absolute;
  top: 18px;
  right: 10px;
  width: 20px;
  height: 8px;
  background: linear-gradient(to bottom, #e74c3c, #c0392b);
  border-radius: 5px;
  cursor: pointer;
  transform-style: preserve-3d;
  animation: button 5s ease-in-out infinite;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-lens {
  position: absolute;
  top: 20px;
  left: 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ecf0f1, #bdc3c7);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), inset 0 2px 5px rgba(0, 0, 0, 0.2);
  transform-style: preserve-3d;
  animation: lensPulse 5s ease-in-out infinite;
  z-index: 3;
  border: 2px solid #2c3e50;
  overflow: hidden;
}

.lens-inner {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: rotateLens 8s linear infinite;
}

.lens-inner-inner {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2c3e50;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.2);
  animation: zoom 5s ease-in-out infinite;
}

.lens-reflection {
  position: absolute;
  top: 1px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  filter: blur(1px);
}

.lens-reflection::after {
  content: '';
  position: absolute;
  top: 3px;
  left: -1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.4;
}

.shutter {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 9998;
  background: black;
  transform-origin: center;
  animation: shutterEffect 5s ease-in-out infinite;
  opacity: 0;
}

.capture-flash {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 9997;
  background: white;
  opacity: 0;
  animation: flashEffect 5s ease-in-out infinite;
}

.light-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  z-index: 1;
  animation: pulseBeam 5s ease-in-out infinite;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation-duration: 8s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-out;
  filter: blur(2px);
}

.particle:nth-child(1) {
  top: 20%;
  left: 30%;
  animation-name: floatParticle1;
}

.particle:nth-child(2) {
  top: 70%;
  left: 60%;
  animation-name: floatParticle2;
}

.particle:nth-child(3) {
  top: 40%;
  left: 80%;
  animation-name: floatParticle3;
}

.loading-progress {
  position: relative;
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin-top: 40px;
  overflow: hidden;
  z-index: 2;
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: white;
  animation: progress 4s ease-in-out forwards;
}

/* Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotateX(5deg) rotateY(5deg) rotateZ(0deg);
  }
  25% {
    transform: translateY(-15px) rotateX(-2deg) rotateY(8deg) rotateZ(2deg);
  }
  50% {
    transform: translateY(-5px) rotateX(-8deg) rotateY(-3deg) rotateZ(-2deg);
  }
  75% {
    transform: translateY(-10px) rotateX(3deg) rotateY(-10deg) rotateZ(1deg);
  }
}

@keyframes button {
  0%, 100% {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    transform: translateY(0);
  }
  15% {
    background: linear-gradient(to bottom, #c0392b, #a33226);
    transform: translateY(2px);
  }
  20% {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    transform: translateY(0);
  }
}

@keyframes flash {
  0%, 100% {
    opacity: 0.3;
    box-shadow: 0 0 5px #f1c40f;
  }
  15% {
    opacity: 1;
    box-shadow: 0 0 20px #f1c40f, 0 0 40px #f1c40f, 0 0 60px #f1c40f;
  }
  20% {
    opacity: 0.3;
    box-shadow: 0 0 5px #f1c40f;
  }
}

@keyframes shutterEffect {
  0%, 100% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  20% {
    opacity: 0;
  }
}

@keyframes flashEffect {
  0%, 100% {
    opacity: 0;
  }
  15% {
    opacity: 0.7;
  }
  17% {
    opacity: 0;
  }
}

@keyframes progress {
  0% {
    width: 0%;
  }
  20% {
    width: 20%;
  }
  50% {
    width: 60%;
  }
  70% {
    width: 80%;
  }
  100% {
    width: 100%;
  }
}

@keyframes lensPulse {
  0%, 100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.05);
  }
  20% {
    transform: scale(0.95);
  }
  25% {
    transform: scale(1);
  }
}

@keyframes zoom {
  0%, 100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.3);
  }
  20% {
    transform: scale(0.8);
  }
  25% {
    transform: scale(1);
  }
}

@keyframes rotateLens {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulseBeam {
  0%, 100% {
    opacity: 0.1;
    transform: translate(-50%, -50%) scale(1);
  }
  15% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1.2);
  }
  20% {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(0.9);
  }
  25% {
    opacity: 0.1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes floatParticle1 {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  20% {
    transform: translate(20px, -30px) scale(1.5);
    opacity: 0.6;
  }
  100% {
    transform: translate(60px, -100px) scale(0.5);
    opacity: 0;
  }
}

@keyframes floatParticle2 {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  30% {
    transform: translate(-30px, -50px) scale(2);
    opacity: 0.5;
  }
  100% {
    transform: translate(-80px, -120px) scale(0.5);
    opacity: 0;
  }
}

@keyframes floatParticle3 {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0;
  }
  40% {
    transform: translate(40px, -60px) scale(1.2);
    opacity: 0.4;
  }
  100% {
    transform: translate(100px, -150px) scale(0.3);
    opacity: 0;
  }
}