/* Loading Screen Styles */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Usa a mesma cor do PWA manifest para evitar flicker */
  background: #001F0C;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loading-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loading-pulse 2s ease-in-out infinite;
}

.loading-logo-image {
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Customização do loading bars do DaisyUI */
.loading-screen .loading-bars {
  /* Usa um verde claro para contraste com o fundo escuro */
  color: #10B981;
}

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

@keyframes loading-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.loading-fade-out {
  animation: loading-fade-out 0.3s ease-out forwards;
}

/* Previne scroll enquanto o loading está ativo */
body:has(.loading-screen:not(.loading-fade-out)) {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Suporte a diferentes temas mantém a cor do PWA */
[data-theme] .loading-screen {
  background: #001F0C;
}

/* Loading status text */
.loading-status {
  margin-top: 1rem;
  color: #10B981;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  opacity: 0.8;
  min-height: 1.5rem;
  transition: opacity 0.2s ease-in-out;
}

.loading-status.loading-status-hidden {
  opacity: 0;
}

/* Loading checklist */
.loading-checklist {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
}

.loading-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #6B7280;
  font-size: 0.875rem;
  transition: color 0.2s ease-in-out;
}

.loading-checklist-item.loading-checklist-item-ready {
  color: #10B981;
}

.loading-checklist-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid currentColor;
  transition: all 0.2s ease-in-out;
}

.loading-checklist-item-ready .loading-checklist-icon {
  background: #10B981;
  border-color: #10B981;
}

.loading-checklist-icon::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.loading-checklist-item-ready .loading-checklist-icon::before {
  opacity: 1;
  background: white;
}
