/* =====================================================================
   LOADING ANIMATION STYLES - Pacman loader for application startup
   Used in index.html during initial app loading
   ===================================================================== */

.app-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  font-family: 'Montserrat', 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* Pacman loader animation */
.lds-pacman {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
  transform: scale(1.5);
}

.lds-pacman div:nth-child(2) {
  animation: lds-pacman-1 1s linear infinite;
  transform-origin: 40px 40px;
}

.lds-pacman div:nth-child(2) div {
  position: absolute;
  top: 33px;
  left: 4px;
  width: 26px;
  height: 14px;
  border-radius: 0 26px 26px 0;
  background: #00387a; /* AGEFAU brand color */
}

.lds-pacman div:nth-child(2) div:nth-child(2) {
  animation: lds-pacman-2 1s linear infinite;
  transform-origin: 0 7px;
}

.lds-pacman div:nth-child(3) {
  animation: lds-pacman-3 1s linear infinite;
  transform-origin: 40px 40px;
}

.lds-pacman div:nth-child(3) div {
  position: absolute;
  top: 33px;
  left: 4px;
  width: 26px;
  height: 14px;
  border-radius: 0 26px 26px 0;
  background: #00387a;
  transform: rotate(180deg);
}

.lds-pacman div:nth-child(3) div:nth-child(2) {
  animation: lds-pacman-2 1s linear infinite;
  transform-origin: 0 7px;
}

.lds-pacman div:nth-child(4) div {
  position: absolute;
  top: 37px;
  left: 56px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a74a8; /* Secondary AGEFAU color */
  animation: lds-pacman-4 2s linear infinite;
}

.lds-pacman div:nth-child(5) div {
  position: absolute;
  top: 37px;
  left: 69px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a74a8;
  animation: lds-pacman-4 2s linear infinite;
  animation-delay: -0.4s;
}

.lds-pacman div:nth-child(6) div {
  position: absolute;
  top: 37px;
  left: 82px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a74a8;
  animation: lds-pacman-4 2s linear infinite;
  animation-delay: -0.8s;
}

/* Loading text */
.app-loading::after {
  content: 'Chargement de DanayaDoc...';
  position: absolute;
  bottom: 30%;
  font-size: 1.2rem;
  font-weight: 500;
  color: #00387a;
  letter-spacing: 0.5px;
  animation: loading-pulse 2s ease-in-out infinite;
}

/* AGEFAU brand accent */
.app-loading::before {
  content: '';
  position: absolute;
  top: 20%;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #00387a, #1a74a8);
  border-radius: 50%;
  opacity: 0.1;
  animation: brand-pulse 3s ease-in-out infinite;
}

/* Keyframe animations */
@keyframes lds-pacman-1 {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-44deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes lds-pacman-2 {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(44deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes lds-pacman-3 {
  0% {
    transform: rotate(180deg);
  }
  50% {
    transform: rotate(224deg);
  }
  100% {
    transform: rotate(180deg);
  }
}

@keyframes lds-pacman-4 {
  0% {
    left: 56px;
    opacity: 0;
  }
  50% {
    left: 41px;
    opacity: 1;
  }
  100% {
    left: 13px;
    opacity: 0;
  }
}

@keyframes loading-pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes brand-pulse {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(1);
  }
  50% {
    opacity: 0.2;
    transform: scale(1.2);
  }
}

/* Error state styling */
#jhipster-error {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #dc2626;
  max-width: 800px;
  font-family: 'Montserrat', sans-serif;
}

#jhipster-error h1 {
  color: #dc2626;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

#jhipster-error h2 {
  color: #00387a;
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-weight: 500;
}

#jhipster-error h3 {
  color: #374151;
  font-size: 1rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

#jhipster-error p {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1rem;
}

#jhipster-error ol,
#jhipster-error ul {
  color: #374151;
  line-height: 1.6;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

#jhipster-error li {
  margin-bottom: 0.5rem;
}

#jhipster-error code {
  background: #f3f4f6;
  color: #dc2626;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
}

#jhipster-error a {
  color: #00387a;
  text-decoration: none;
  font-weight: 500;
}

#jhipster-error a:hover {
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .lds-pacman {
    transform: scale(1.2);
  }

  .app-loading::after {
    font-size: 1rem;
    bottom: 25%;
  }

  #jhipster-error {
    margin: 1rem;
    padding: 1.5rem;
  }

  #jhipster-error h1 {
    font-size: 1.5rem;
  }

  #jhipster-error h2 {
    font-size: 1.1rem;
  }
}
