/* ============================================
   SIMPLE ENVELOPE PRELOADER - SARIY ZƏRF ANİMASİYASI
   Sadə və professional
   ============================================ */

/* Preloader Container */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  overflow: hidden;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Logo */
.preloader-logo {
  margin-bottom: 60px;
  animation: logoFloat 2s ease-in-out infinite;
}

.preloader-logo-text {
  font-size: 2.5em;
  font-weight: 800;
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Envelope Animation Container */
.preloader-envelope-animation {
  position: relative;
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}

/* Envelope */
.envelope {
  position: absolute;
  width: 140px;
  height: 100px;
  animation: envelopeJourney 3s ease-in-out infinite;
}

/* Envelope Journey: Sol → Orta → Sağ */
@keyframes envelopeJourney {
  0% {
    left: -200px;
    transform: translateX(0) translateY(0) rotate(-15deg);
    opacity: 0;
  }
  
  20% {
    left: 50%;
    transform: translateX(-50%) translateY(0) rotate(0deg);
    opacity: 1;
  }
  
  50% {
    left: 50%;
    transform: translateX(-50%) translateY(-15px) rotate(0deg);
    opacity: 1;
  }
  
  70% {
    left: 50%;
    transform: translateX(-50%) translateY(0) rotate(0deg);
    opacity: 1;
  }
  
  90% {
    left: calc(100% + 200px);
    transform: translateX(-100%) translateY(0) rotate(15deg);
    opacity: 1;
  }
  
  100% {
    left: calc(100% + 200px);
    transform: translateX(-100%) translateY(0) rotate(15deg);
    opacity: 0;
  }
}

/* Envelope Body - Alt hissə */
.envelope-body {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 140px;
  height: 90px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 30px rgba(251, 191, 36, 0.4);
}

/* Envelope Flap - Üst qapaQ (bağlı) */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-top: 50px solid #f59e0b;
  border-radius: 4px 4px 0 0;
  transform-origin: top center;
  box-shadow: 0 -4px 20px rgba(245, 158, 11, 0.3);
}

/* Envelope Border Lines */
.envelope-lines {
  position: absolute;
  top: 30px;
  left: 20px;
  right: 20px;
}

.envelope-line {
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin-bottom: 8px;
}

.envelope-line:nth-child(1) {
  width: 60%;
}

.envelope-line:nth-child(2) {
  width: 80%;
}

.envelope-line:nth-child(3) {
  width: 50%;
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 35px;
  height: 35px;
  background: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Flying Particles */
.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: particleFly 3s ease-in-out infinite;
}

.particle:nth-child(1) {
  top: 20%;
  animation-delay: 0.2s;
}

.particle:nth-child(2) {
  top: 50%;
  animation-delay: 0.5s;
}

.particle:nth-child(3) {
  top: 80%;
  animation-delay: 0.8s;
}

@keyframes particleFly {
  0% {
    left: -20px;
    opacity: 0;
    transform: scale(0);
  }
  20% {
    left: 30%;
    opacity: 1;
    transform: scale(1);
  }
  80% {
    left: 70%;
    opacity: 1;
    transform: scale(1);
  }
  100% {
    left: calc(100% + 20px);
    opacity: 0;
    transform: scale(0);
  }
}

/* Loading Text */
.preloader-text {
  color: white;
  font-size: 1.3em;
  font-weight: 500;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 20px;
}

/* Loading Dots Animation */
.loading-dots::after {
  content: '';
  animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* Progress Bar */
.preloader-progress {
  width: 300px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.preloader-progress-bar {
  height: 100%;
  background: white;
  border-radius: 2px;
  animation: progressBar 3s ease-in-out infinite;
}

@keyframes progressBar {
  0% {
    width: 0%;
  }
  50% {
    width: 100%;
  }
  100% {
    width: 100%;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .preloader-logo-text {
    font-size: 2em;
  }
  
  .envelope {
    width: 100px;
    height: 70px;
  }
  
  .envelope-body {
    width: 100px;
    height: 63px;
  }
  
  .envelope-flap {
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-top: 35px solid #f59e0b;
  }
  
  .notification-badge {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .preloader-text {
    font-size: 1.1em;
    padding: 0 20px;
  }
  
  .preloader-progress {
    width: 80%;
  }
}