/* ===================================
   Tela de Carregamento - NutriFresh
   =================================== */

/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* Container de carregamento */
.loading-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Animação de pulso suave */
.pulse-soft {
    animation: pulse 3s infinite ease-in-out;
}

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

/* Animação de fade in para elementos */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animação de rotação suave */
.rotate-smooth {
    animation: rotateSmoothly 20s linear infinite;
}

@keyframes rotateSmoothly {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Animação de brilho */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* Estilo para barra de progresso animada */
#progressBar {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(19, 236, 91, 0.4);
}

/* Animação de processamento para barra pausada */
#progressBar.processing {
    animation: processingPulse 2s ease-in-out infinite;
}

@keyframes processingPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(19, 236, 91, 0.4);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 30px rgba(19, 236, 91, 0.8);
        opacity: 0.9;
    }
}

/* Header fixo */
.fixed.top-0 {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Efeito de hover no header (apenas para elementos interativos) */
header h2 {
    transition: all 0.3s ease;
}

header h2:hover {
    transform: scale(1.05);
    cursor: pointer;
}

/* Animação de entrada para o conteúdo principal */
main > div {
    animation: slideUp 1s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efeito de transição suave para textos que mudam */
.text-transition {
    transition: opacity 0.3s ease-in-out;
}

.text-transition.fade-out {
    opacity: 0;
}

/* Animação para o ícone eco */
.material-symbols-outlined {
    transition: transform 0.3s ease;
}

/* Responsividade adicional */
@media (max-width: 640px) {
    .loading-container {
        padding: 1rem;
    }

    header {
        padding: 1rem !important;
    }

    header .flex.items-center.gap-4 {
        display: none !important;
    }

    main .max-w-[480px] {
        max-width: 100%;
    }

    h1 {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .fixed.bottom-0 {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }

    .fixed.bottom-0 .h-4 {
        display: none;
    }
}

/* Modo escuro - ajustes adicionais */
.dark #progressBar {
    box-shadow: 0 0 25px rgba(19, 236, 91, 0.6);
}

.dark #progressBar.processing {
    animation: processingPulseDark 2s ease-in-out infinite;
}

@keyframes processingPulseDark {
    0%, 100% {
        box-shadow: 0 0 25px rgba(19, 236, 91, 0.6);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 40px rgba(19, 236, 91, 1);
        opacity: 0.9;
    }
}

/* Animação para check circle */
.material-symbols-outlined.text-primary {
    animation: checkPulse 2s infinite ease-in-out;
}

@keyframes checkPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Estilo para estados de carregamento */
.loading-state {
    position: relative;
}

.loading-state::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #13ec5b;
    animation: loadingLine 2s ease-in-out infinite;
}

@keyframes loadingLine {
    0%, 100% {
        width: 0;
        left: 0;
    }
    50% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 0;
        left: 100%;
    }
}

/* Animação de fade para transição de página */
.page-transition {
    transition: opacity 0.5s ease-out;
}

.page-transition.fade-out-page {
    opacity: 0;
}

/* Efeito de glow nos elementos de fundo */
.fixed.bg-primary\\/5,
.fixed.bg-primary\\/10 {
    animation: glowPulse 8s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from {
        opacity: 0.3;
    }
    to {
        opacity: 1;
    }
}

/* Estilos para navegação de dicas */
#prevTip,
#nextTip {
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#prevTip:hover,
#nextTip:hover {
    background: rgba(19, 236, 91, 0.1);
    transform: scale(1.1);
}

#prevTip:active,
#nextTip:active {
    transform: scale(0.95);
}

/* Dots indicadores */
.dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    transform: scale(1.3);
    opacity: 0.7 !important;
}

/* Animação de entrada para os dots */
.dot {
    animation: dotFadeIn 0.5s ease-out;
}

@keyframes dotFadeIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animação para o nome do site */
h1.text-primary {
    animation: fadeInScale 1s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animação para ícone de construção */
.material-symbols-outlined {
    animation: none;
}

span.material-symbols-outlined:has(+ p:contains("Construção")) {
    animation: rotateConstruction 3s ease-in-out infinite;
}

@keyframes rotateConstruction {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}
