/* Image base styles */

/* Base class for all glitch elements */
.glitch-base {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 150px;
  width: 150px;
  animation-iteration-count: infinite;
  animation-timing-function: steps(1);
  position: relative;
  cursor: pointer;
}

/* Retângulos de detecção - estilo de software de vigilância */
.detection-rectangle {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  background: rgba(0, 255, 255, 0.08);
  border: 2px solid rgba(0, 255, 255, 0.9);
  border-radius: 3px;
  box-shadow: 
    0 0 15px rgba(0, 255, 255, 0.4),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  transform: scale(0.8) rotate(-2deg);
  filter: blur(0.5px);
  overflow: hidden;
}

.detection-rectangle.active {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  filter: blur(0px);
  box-shadow: 
    0 0 25px rgba(0, 255, 255, 0.6),
    inset 0 0 30px rgba(0, 255, 255, 0.15);
}

/* Efeito de scanning */
.detection-rectangle.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(0, 255, 255, 0.3), 
    transparent
  );
  animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Labels de identificação nos retângulos */
.detection-label {
  position: absolute;
  top: -30px;
  left: 0;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.95), rgba(0, 200, 255, 0.9));
  color: #000;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 10px rgba(0, 255, 255, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Linhas conectoras entre retângulos */
.detection-connection {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  background: linear-gradient(90deg, 
    rgba(0, 255, 255, 0.8), 
    rgba(0, 255, 255, 0.4), 
    rgba(0, 255, 255, 0.8)
  );
  height: 2px;
  opacity: 0;
  transition: all 0.4s ease;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.detection-connection.active {
  opacity: 1;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}


.glitch-base:hover::before {
  opacity: 1;
}


/* Ghost trail para as imagens flutuantes */
.glitch-ghost {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: opacity, transform;
  opacity: 0.22;
  filter: blur(0.4px);
  transition: opacity 0.65s linear;
  z-index: 38;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* Glitch-1 specific */
.glitch-1 {
  background-image: url('../glitch-1/image-1.png');
  animation-name: glitch-1;
  animation-duration: 3s;
}

@keyframes glitch-1 {
  0%, 100% {
    background-image: url('../glitch-1/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-1/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-1/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-1/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-2 */
.glitch-2 {
  background-image: url('../glitch-2/image-1.png');
  animation-name: glitch-2;
  animation-duration: 2.5s;
}

@keyframes glitch-2 {
  0%, 100% {
    background-image: url('../glitch-2/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-2/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-2/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-2/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-3 */
.glitch-3 {
  background-image: url('../glitch-3/image-1.png');
  animation-name: glitch-3;
  animation-duration: 4s;
}

@keyframes glitch-3 {
  0%, 100% {
    background-image: url('../glitch-3/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-3/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-3/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-3/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-4 */
.glitch-4 {
  background-image: url('../glitch-4/image-1.png');
  animation-name: glitch-4;
  animation-duration: 3.5s;
}

@keyframes glitch-4 {
  0%, 100% {
    background-image: url('../glitch-4/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-4/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-4/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-4/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-5 */
.glitch-5 {
  background-image: url('../glitch-5/image-1.png');
  animation-name: glitch-5;
  animation-duration: 2s;
}

@keyframes glitch-5 {
  0%, 100% {
    background-image: url('../glitch-5/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-5/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-5/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-5/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-6 */
.glitch-6 {
  background-image: url('../glitch-6/image-1.png');
  animation-name: glitch-6;
  animation-duration: 4.5s;
}

@keyframes glitch-6 {
  0%, 100% {
    background-image: url('../glitch-6/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-6/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-6/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-6/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-7 */
.glitch-7 {
  background-image: url('../glitch-7/image-1.png');
  animation-name: glitch-7;
  animation-duration: 2.8s;
}

@keyframes glitch-7 {
  0%, 100% {
    background-image: url('../glitch-7/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-7/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-7/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-7/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-8 */
.glitch-8 {
  background-image: url('../glitch-8/image-1.png');
  animation-name: glitch-8;
  animation-duration: 3.2s;
}

@keyframes glitch-8 {
  0%, 100% {
    background-image: url('../glitch-8/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-8/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-8/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-8/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-9 */
.glitch-9 {
  background-image: url('../glitch-9/image-1.png');
  animation-name: glitch-9;
  animation-duration: 1.8s;
}

@keyframes glitch-9 {
  0%, 100% {
    background-image: url('../glitch-9/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-9/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-9/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-9/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-10 */
.glitch-10 {
  background-image: url('../glitch-10/image-1.png');
  animation-name: glitch-10;
  animation-duration: 3.8s;
}

@keyframes glitch-10 {
  0%, 100% {
    background-image: url('../glitch-10/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-10/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-10/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-10/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-11 */
.glitch-11 {
  background-image: url('../glitch-11/image-1.png');
  animation-name: glitch-11;
  animation-duration: 2.3s;
}

@keyframes glitch-11 {
  0%, 100% {
    background-image: url('../glitch-11/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-11/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-11/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-11/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Glitch-12 */
.glitch-12 {
  background-image: url('../glitch-12/image-1.png');
  animation-name: glitch-12;
  animation-duration: 4.2s;
}

@keyframes glitch-12 {
  0%, 100% {
    background-image: url('../glitch-12/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-12/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-12/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-12/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

.glitch-13 {
  background-image: url('../glitch-13/image-1.png');
  animation-name: glitch-13;
  animation-duration: 4.2s;
}

@keyframes glitch-13 {
  0%, 100% {
    background-image: url('../glitch-13/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-13/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-13/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-13/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}
.glitch-14 {
  background-image: url('../glitch-14/image-1.png');
  animation-name: glitch-14;
  animation-duration: 4.2s;
}

@keyframes glitch-14 {
  0%, 100% {
    background-image: url('../glitch-14/image-1.png');
    background-size: cover;
  }
  92.5% {
    background-image: url('../glitch-14/image-2.png');
    background-size: cover;
    opacity: 1;
  }
  95% {
    background-image: url('../glitch-14/image-3.png');
    background-size: cover;
    opacity: 0;
  }
  97.5% {
    background-image: url('../glitch-14/image-4.png');
    background-size: cover;
    opacity: 1;
  }
}

/* Apply base class to all glitch elements */
.glitch-1,
.glitch-2,
.glitch-3,
.glitch-4,
.glitch-5,
.glitch-6,
.glitch-7,
.glitch-8,
.glitch-9,
.glitch-10,
.glitch-11,
.glitch-12,
.glitch-13,
.glitch-14
 {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 120px;
  width: 120px;
  animation-iteration-count: infinite;
  animation-timing-function: steps(1);
}

@media screen and (max-width: 768px) {
.glitch-1,
.glitch-2,
.glitch-3,
.glitch-4,
.glitch-5,
.glitch-6,
.glitch-7,
.glitch-8,
.glitch-9,
.glitch-10,
.glitch-11,
.glitch-12,
.glitch-13,
.glitch-14 { 
  height: 50px;
  width: 50px;
} 

}

.glitch-left {
  width: 300px;
  display: flex;
  align-items: center;
  justify-content: start;
}

.glitch-right {
  width: 300px;
  display: flex;
  align-items: center;
  justify-content: end;
}
