/* Fintech Pre-loader Styles */
@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

@keyframes wave {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

@keyframes digitalCount {
  0% {
    content: '0%';
  }
  10% {
    content: '10%';
  }
  20% {
    content: '25%';
  }
  30% {
    content: '40%';
  }
  40% {
    content: '55%';
  }
  50% {
    content: '70%';
  }
  60% {
    content: '80%';
  }
  70% {
    content: '85%';
  }
  80% {
    content: '90%';
  }
  90% {
    content: '95%';
  }
  100% {
    content: '100%';
  }
}

.app-loading {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a4f8c 0%, #00a859 100%);
  color: white;
  z-index: 9999;
}

.app-loading p {
  font-size: 1.1em;
  margin-top: 2rem;
  font-weight: 500;
  text-align: center;
}

/* Main Fintech Loader */
.fintech-loader {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

/* Central Logo/Chip */
.loader-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ffd700 0%, #ffec8b 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
  z-index: 2;
}

.loader-core::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: linear-gradient(135deg, #daa520 0%, #ffd700 100%);
  border-radius: 4px;
}

.loader-core::after {
  content: '💳';
  position: relative;
  font-size: 20px;
  z-index: 1;
}

/* Orbiting Circles */
.orbit {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: rotate 4s linear infinite;
}

.orbit::before,
.orbit::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.orbit:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-color: rgba(255, 255, 255, 0.2);
  animation-duration: 3s;
  animation-direction: reverse;
}

.orbit:nth-child(2)::before {
  background: #00a859;
  width: 10px;
  height: 10px;
}

.orbit:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-color: rgba(255, 255, 255, 0.3);
  animation-duration: 2s;
}

.orbit:nth-child(3)::before {
  background: #ff6b00;
  width: 8px;
  height: 8px;
}

/* Digital Percentage */
.loading-percentage {
  font-family: 'Courier New', monospace;
  font-size: 1.5em;
  font-weight: 700;
  margin-top: 1rem;
  color: white;
  position: relative;
}

.loading-percentage::after {
  content: '0%';
  animation: digitalCount 3s linear forwards;
}

/* Progress Bar */
.loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
  position: relative;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffd700, #00a859);
  border-radius: 2px;
  width: 0%;
  animation: loadingProgress 3s ease-in-out forwards;
  position: relative;
}

.loading-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes loadingProgress {
  0% {
    width: 0%;
  }
  10% {
    width: 10%;
  }
  20% {
    width: 25%;
  }
  30% {
    width: 40%;
  }
  40% {
    width: 55%;
  }
  50% {
    width: 70%;
  }
  60% {
    width: 80%;
  }
  70% {
    width: 85%;
  }
  80% {
    width: 90%;
  }
  90% {
    width: 95%;
  }
  100% {
    width: 100%;
  }
}

/* Floating Elements */
.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.floating-element {
  position: absolute;
  font-size: 1.2em;
  opacity: 0.7;
  animation: bounce 2s ease-in-out infinite;
}

.floating-element:nth-child(1) {
  top: 20%;
  left: 20%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  top: 20%;
  right: 20%;
  animation-delay: 0.5s;
}

.floating-element:nth-child(3) {
  bottom: 30%;
  left: 30%;
  animation-delay: 1s;
}

.floating-element:nth-child(4) {
  bottom: 20%;
  right: 30%;
  animation-delay: 1.5s;
}

/* Brand Logo */
.brand-logo {
  margin-bottom: 2rem;
  text-align: center;
}

.brand-logo .logo-text {
  font-size: 2em;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffd700 0%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-logo .tagline {
  font-size: 0.9em;
  opacity: 0.8;
  font-weight: 300;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .fintech-loader {
    width: 100px;
    height: 100px;
  }

  .loader-core {
    width: 50px;
    height: 50px;
  }

  .brand-logo .logo-text {
    font-size: 1.5em;
  }

  .loading-percentage {
    font-size: 1.2em;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .app-loading {
    background: linear-gradient(135deg, #0d2b4d 0%, #006b3a 100%);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .orbit,
  .loader-core,
  .floating-element,
  .loading-progress-bar,
  .loading-percentage::after {
    animation: none;
  }

  .loader-core {
    animation: pulse 4s ease-in-out infinite;
  }
}
