/* Splash Screen CSS - Nhutchi PWA */
/* Arquivo: public/css/splash-screen.css */

.nhutchi-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #78bf23;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nhutchi-splash.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

/* CONTAINER DE CONTEÚDO - CENTRALIZACAO PERFEITA */
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* LOGO - PERFEITAMENTE CENTRALIZADO */
.splash-logo {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px auto; /* Centralização com margin auto */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: logoAnimation 2.5s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

.splash-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(120, 191, 35, 0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

.splash-logo img {
    width: 85px;
    height: 85px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* FALLBACK LOGO TEXTO */
.splash-logo-text {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 3rem;
    font-weight: 900;
    color: #78bf23;
    animation: logoAnimation 2.5s ease-in-out infinite alternate;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* TÍTULO */
.splash-title {
    color: white;
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0 auto 15px auto;
    text-align: center;
    opacity: 0;
    animation: titleFadeIn 1.2s ease-out 0.5s forwards;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 1px;
    line-height: 1.2;
}

/* SUBTÍTULO */
.splash-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    margin: 0 auto 40px auto;
    opacity: 0;
    animation: titleFadeIn 1.2s ease-out 1s forwards;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    line-height: 1.4;
}

/* BARRA DE PROGRESSO */
.splash-progress {
    width: 220px;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 25px auto;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.splash-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, #f0f0f0, #ffffff);
    background-size: 200% 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressShimmer 2s ease-in-out infinite;
}

/* LOADER SPINNER */
.splash-loader {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    margin: 0 auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* PARTÍCULAS ANIMADAS */
.splash-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.splash-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: float 4s infinite linear;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

/* ANIMAÇÕES */
@keyframes logoAnimation {
    0% {
        transform: scale(1) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1.08) rotateY(5deg);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    }
}

@keyframes shimmer {
    0%, 100% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        transform: translateX(100%);
        opacity: 1;
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes progressShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10px) rotate(360deg);
        opacity: 0;
    }
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    .splash-title {
        font-size: 2.2rem;
        margin-bottom: 12px;
    }

    .splash-subtitle {
        font-size: 1rem;
        padding: 0 25px;
        max-width: 280px;
        margin-bottom: 35px;
    }

    .splash-logo,
    .splash-logo-text {
        width: 100px;
        height: 100px;
        margin-bottom: 25px;
    }

    .splash-logo img {
        width: 70px;
        height: 70px;
    }

    .splash-logo-text {
        font-size: 2.5rem;
    }

    .splash-progress {
        width: 180px;
        height: 5px;
        margin-bottom: 20px;
    }

    .splash-loader {
        width: 40px;
        height: 40px;
        border-width: 2.5px;
    }
}

@media (max-width: 480px) {
    .splash-title {
        font-size: 1.9rem;
    }

    .splash-subtitle {
        font-size: 0.9rem;
        padding: 0 20px;
        max-width: 250px;
    }

    .splash-logo,
    .splash-logo-text {
        width: 90px;
        height: 90px;
        border-radius: 20px;
    }

    .splash-logo img {
        width: 60px;
        height: 60px;
    }

    .splash-logo-text {
        font-size: 2.2rem;
    }

    .splash-progress {
        width: 160px;
        height: 4px;
    }

    .splash-loader {
        width: 35px;
        height: 35px;
    }
}

/* LANDSCAPE MOBILE */
@media (max-height: 500px) and (orientation: landscape) {
    .splash-title {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .splash-subtitle {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }

    .splash-logo,
    .splash-logo-text {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }

    .splash-logo img {
        width: 50px;
        height: 50px;
    }

    .splash-progress {
        width: 140px;
        margin-bottom: 15px;
    }

    .splash-loader {
        width: 30px;
        height: 30px;
    }
}

/* DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
    .splash-logo {
        background: #f8f9fa;
    }
    
    .splash-logo-text {
        background: #f8f9fa;
        color: #78bf23;
    }
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
    .splash-title,
    .splash-subtitle {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    
    .splash-logo {
        box-shadow: 0 0 0 3px white, 0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .splash-logo,
    .splash-logo-text {
        animation: none;
    }
    
    .splash-particles {
        display: none;
    }
    
    .splash-loader {
        animation: none;
        border-top-color: transparent;
    }
    
    .nhutchi-splash.fade-out {
        transition-duration: 0.3s;
    }
}