@charset "UTF-8";

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
  background: var(--primary-bg);
  overflow: hidden;
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Circuit Background Animation */
.circuit-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  overflow: hidden;
}

.circuit-line {
  position: absolute;
  background: #09ff00;
  animation: pulse 2s ease-in-out infinite;
}

.circuit-line.horizontal {
  height: 2px;
  width: 100px;
}

.circuit-line.vertical {
  width: 2px;
  height: 100px;
}

.circuit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #09ff00;
  border-radius: 50%;
  box-shadow: 0 0 10px #09ff00;
  animation: blink 1.5s ease-in-out infinite;
}

/* Logo Container */
.logo-container {
  position: relative;
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-logo {
  display: block;
  width: clamp(192px, 32vw, 312px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(9, 255, 0, 0.28));
}

.logo-subtitle {
  text-align: center;
  color: #8b92b0;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* Arduino Board Animation */
.arduino-container {
  position: relative;
  width: 200px;
  height: 120px;
  margin-bottom: 3rem;
  animation: float 3s ease-in-out infinite;
}

.arduino-board {
  width: 100%;
  height: 100%;
  background: #006666;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 217, 255, 0.3);
}

.arduino-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: #1a1a1a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #09ff00;
}

.arduino-pin {
  position: absolute;
  width: 8px;
  height: 20px;
  background: #ffd700;
  border-radius: 2px;
}

.arduino-pin.left {
  left: -4px;
}

.arduino-pin.right {
  right: -4px;
}

.pin-1 {
  top: 10px;
}

.pin-2 {
  top: 30px;
}

.pin-3 {
  top: 50px;
}

.pin-4 {
  top: 70px;
}

.pin-5 {
  top: 90px;
}

/* LED Indicators */
.led-container {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

.led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: ledBlink 1s ease-in-out infinite;
}

.led.red {
  background: #ff3366;
  box-shadow: 0 0 10px #ff3366;
}

.led.green {
  background: #00ff88;
  box-shadow: 0 0 10px #00ff88;
  animation-delay: 0.3s;
}

.led.blue {
  background: #09ff00;
  box-shadow: 0 0 10px #09ff00;
  animation-delay: 0.6s;
}

/* Loading Bar */
.loading-bar-container {
  width: 300px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, #09ff00 0%, #0bffc6 50%, #09ff00 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  animation: loadingProgress 2s ease-in-out infinite;
  width: 0%;
  transition: width 0.3s ease;
}

/* Loading Text */
.loading-text {
  color: #8b92b0;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  animation: fadeIn 0.8s ease-out;
}

.loading-percentage {
  color: #09ff00;
  font-size: 1.2rem;
  font-weight: 600;
  animation: fadeIn 0.8s ease-out;
}

/* Code Blocks Animation */
.code-blocks {
  position: absolute;
  bottom: 50px;
  display: flex;
  gap: 10px;
  animation: slideUp 0.8s ease-out;
}

.code-block {
  width: 60px;
  height: 60px;
  background: rgba(123, 47, 247, 0.2);
  border: 2px solid #7b2ff7;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  animation: blockFloat 2s ease-in-out infinite;
}

.code-block:nth-child(2) {
  animation-delay: 0.2s;
}

.code-block:nth-child(3) {
  animation-delay: 0.4s;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }
}

@keyframes blockFloat {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes ledBlink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes loadingProgress {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .loading-logo {
    width: clamp(88px, 30vw, 128px);
  }

  .arduino-container {
    width: 160px;
    height: 96px;
  }

  .loading-bar-container {
    width: 250px;
  }

  .code-blocks {
    bottom: 30px;
  }

  .code-block {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}
