/* ============================================
 * splash.css — Knowledge Network Splash Screen
 * ============================================ */

/* --- KNOWLEDGE NETWORK BACKGROUND --- */
.network-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: radial-gradient(circle at center, #FFFFFF 0%, #F4F7F9 100%);
}

.network-svg {
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.network-lines line {
    stroke: #CBD5E1; /* Tailwind slate-300 */
    stroke-width: 0.25;
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
    animation: drawLines 3s ease-out forwards;
}

.network-nodes circle {
    fill: #10B981; /* Mint Green */
    opacity: 0;
    animation: fadeInNodes 1s ease-out forwards 1.5s;
}

/* Sequential drawing for a "growing network" effect */
.network-lines line:nth-child(1) { animation-delay: 0s; }
.network-lines line:nth-child(2) { animation-delay: 0.2s; }
.network-lines line:nth-child(3) { animation-delay: 0.4s; }
.network-lines line:nth-child(4) { animation-delay: 0.6s; }
.network-lines line:nth-child(5) { animation-delay: 0.8s; }
.network-lines line:nth-child(6) { animation-delay: 1.0s; }
.network-lines line:nth-child(7) { animation-delay: 1.2s; }
.network-lines line:nth-child(8) { animation-delay: 1.4s; }

/* Node appearances */
.network-nodes circle:nth-child(odd) { animation-delay: 1.8s; }
.network-nodes circle:nth-child(even) { animation-delay: 2.0s; }
.network-nodes circle:nth-child(3n) { animation-delay: 2.2s; }

/* Ensure content sits above background */
.app-splash__content {
    position: relative;
    z-index: 10;
}

/* --- LOGO 3D SCENE --- */
.logo-3d-scene {
    perspective: 1200px;
    width: 220px;
    height: 220px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The bare 3D logo */
.logo-3d-object {
    position: relative;
    width: 170px;
    height: 170px;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: flipIn3D 1.0s cubic-bezier(0.16, 1, 0.3, 1) forwards, float3D 4s ease-in-out infinite 1.0s;
}

.app-splash__logo-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}

/* Dải sáng quét qua liên tục (quét 2 lần, chậm) */
.logo-light-sweep {
    position: absolute;
    inset: 0;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    
    background: linear-gradient(135deg, transparent 35%, rgba(255,255,255,1) 50%, transparent 65%);
    background-size: 200% 200%;
    background-repeat: no-repeat; /* Ngăn chặn dải sáng lặp lại khi di chuyển xa */
    
    /* Quét dứt khoát nhưng êm ái trong 2.0s, xuất hiện ngay khi logo vừa lật xong (sau 1.0s) */
    animation: sweepLightLogo 2.0s ease-in-out forwards 1.0s;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}



/* --- ANIMATIONS --- */
@keyframes drawLines {
    0% { stroke-dashoffset: 150; }
    100% { stroke-dashoffset: 0; }
}

@keyframes fadeInNodes {
    0% { opacity: 0; transform: scale(0); transform-origin: center; }
    100% { opacity: 1; transform: scale(1); transform-origin: center; }
}

@keyframes flipIn3D {
    0% { 
        transform: translateZ(-500px) rotateY(-180deg) scale(0.3); 
        opacity: 0; 
    }
    100% { 
        transform: translateZ(0) rotateY(0deg) scale(1); 
        opacity: 1; 
    }
}

@keyframes float3D {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

@keyframes sweepLightLogo {
    0% { background-position: 150% 150%; opacity: 0; }
    20% { opacity: 1; } /* Từ từ hiện rõ (Fade in chậm) */
    80% { background-position: -50% -50%; opacity: 1; }
    100% { background-position: -50% -50%; opacity: 0; }
}
