/* SyndiVote - Préloader Électoral Mauritanien */
/* Couleurs mauritaniennes et syndicales */
:root {
  --primary-green: #00a651;
  --secondary-yellow: #ffd700;
  --accent-blue: #2563eb;
  --text-dark: #1f2937;
  --bg-light: #f8fafc;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

.app-loading {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, var(--bg-light) 0%, #e2e8f0 100%);
  z-index: 9999;
}

.app-loading p {
  display: block;
  font-size: 1.17em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-weight: normal;
}

/* Conteneur principal de l'animation */
.syndivote-loader {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 2rem;
}

/* Urne électorale */
.ballot-box {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 80px;
  background: linear-gradient(145deg, #ffffff, #e2e8f0);
  border-radius: 8px;
  box-shadow:
    0 4px 6px var(--shadow-color),
    inset 0 1px 3px rgba(255, 255, 255, 0.8);
  border: 2px solid var(--primary-green);
}

.ballot-box::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 10px;
  right: 10px;
  height: 15px;
  background: var(--primary-green);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -2px 4px var(--shadow-color);
}

.ballot-box::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 30px;
  right: 30px;
  height: 4px;
  background: #ffffff;
  border-radius: 2px;
}

/* Bulletins de vote animés */
.ballot-paper {
  position: absolute;
  width: 24px;
  height: 16px;
  background: #ffffff;
  border: 1px solid var(--text-dark);
  border-radius: 2px;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.ballot-paper::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  background: var(--secondary-yellow);
  border-radius: 50%;
}

.ballot-paper:nth-child(1) {
  top: -20px;
  left: 20px;
  animation: fall-ballot 2s infinite ease-in-out;
  animation-delay: 0s;
}

.ballot-paper:nth-child(2) {
  top: -20px;
  left: 80px;
  animation: fall-ballot 2s infinite ease-in-out;
  animation-delay: 0.4s;
}

.ballot-paper:nth-child(3) {
  top: -20px;
  left: 140px;
  animation: fall-ballot 2s infinite ease-in-out;
  animation-delay: 0.8s;
}

.ballot-paper:nth-child(4) {
  top: -20px;
  left: 50px;
  animation: fall-ballot 2s infinite ease-in-out;
  animation-delay: 1.2s;
}

.ballot-paper:nth-child(5) {
  top: -20px;
  left: 110px;
  animation: fall-ballot 2s infinite ease-in-out;
  animation-delay: 1.6s;
}

@keyframes fall-ballot {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
    transform: translateY(140px) rotate(180deg);
  }
  100% {
    transform: translateY(150px) rotate(180deg);
    opacity: 0;
  }
}

/* Logo et texte */
.loading-content {
  text-align: center;
  color: var(--text-dark);
}

.app-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary-green), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.app-subtitle {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* Barre de progression */
.progress-container {
  width: 200px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 1rem auto;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-green), var(--secondary-yellow));
  border-radius: 2px;
  animation: loading-progress 3s infinite ease-in-out;
}

@keyframes loading-progress {
  0% {
    width: 0%;
    transform: translateX(-100%);
  }
  50% {
    width: 100%;
    transform: translateX(0%);
  }
  100% {
    width: 100%;
    transform: translateX(100%);
  }
}

.loading-text {
  font-size: 0.9rem;
  color: #64748b;
  animation: pulse-text 2s infinite ease-in-out;
}

@keyframes pulse-text {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Icônes syndicales flottantes */
.floating-icons {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.1;
  top: 0;
  left: 0;
}

.floating-icon {
  position: absolute;
  font-size: 2rem;
  color: var(--primary-green);
  animation: float 6s infinite ease-in-out;
}

.floating-icon:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.floating-icon:nth-child(2) {
  top: 20%;
  right: 15%;
  animation-delay: 1s;
}

.floating-icon:nth-child(3) {
  bottom: 30%;
  left: 15%;
  animation-delay: 2s;
}

.floating-icon:nth-child(4) {
  bottom: 10%;
  right: 10%;
  animation-delay: 3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* Adaptation pour l'ancien système JHipster */
.app-loading .lds-pacman {
  display: none; /* Cache l'ancien Pac-Man */
}

/* Responsive */
@media (max-width: 480px) {
  .syndivote-loader {
    width: 150px;
    height: 150px;
  }

  .ballot-box {
    width: 90px;
    height: 60px;
  }

  .app-title {
    font-size: 2rem;
  }

  .progress-container {
    width: 150px;
  }

  .floating-icon {
    font-size: 1.5rem;
  }
}
