/* =============================================
   LOADER STYLES
   Page loading animation with phone mockup
   ============================================= */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  background: linear-gradient(
    135deg,
    #0f0f23 0%,
    #1a1a2e 25%,
    #16213e 50%,
    #0f3460 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

/* Prevent scrolling when loader is active */
body:has(.page-loader) {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
}

.loader-content {
  text-align: center;
  color: white;
}

/* Phone image frame for loader */
.loader-phone-img {
  position: relative;
  width: 80px;
  height: 160px;
  margin: 0 auto 20px;
}

.loader-iphone-frame {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loader-phone-img .loader-screen {
  position: absolute;
  top: 2.5%;
  left: 4.5%;
  width: 91%;
  height: 95%;
  overflow: hidden;
}

.loader-screen {
  width: 100%;
  height: 100%;
  background: #000000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: screenPulse 2s ease-in-out infinite;
}

.app-icon {
  width: 30px;
  height: 30px;
  background: #e74c3c;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
  position: relative;
  animation: iconBounce 2s ease-in-out infinite;
}

.app-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.loader-text {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loader-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 2px;
  animation: loadProgress 0.8s ease-out forwards;
}

/* Keyframe Animations */
@keyframes screenPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

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

@keyframes buttonPulse {
  0%, 100% {
    opacity: 0.7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3),
      inset 0 0.5px 0 rgba(255, 255, 255, 0.1),
      inset 0 -0.5px 0 rgba(0, 0, 0, 0.1);
  }
  50% {
    opacity: 1;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  }
}

@keyframes loadProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* Fade out transition */
.page-loader.fade-out {
  opacity: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .loader-text {
    font-size: 1.5rem;
  }
  .app-icon {
    width: 30px !important;
    height: 30px !important;
  }
}
