/* ============================================
   PAGE TRANSITION LOADER - Option B: Hexagonal Grid
   ============================================ */

/* Overlay */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d0d1a;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

#page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Circuit background lines */
#page-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(233, 29, 99, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(233, 29, 99, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: grid-scroll 8s linear infinite;
}

@keyframes grid-scroll {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(40px, 40px);
    }
}

/* Hex Container replaced */

/* Hex glow colors and delays */
.loader-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
    animation: fade-in-up 1s ease forwards;
}

.loader-img {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
    animation: pulse-glow 3s infinite alternate;
}

@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2)) drop-shadow(0 0 5px rgba(233, 29, 99, 0.5));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 15px rgba(41, 171, 226, 0.6));
        transform: scale(1.05);
    }

    100% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2)) drop-shadow(0 0 5px rgba(233, 29, 99, 0.5));
        transform: scale(1);
    }
}

/* Logo Text with Glitch */
.loader-brand {
    position: relative;
    z-index: 1;
    font-family: 'Varela Round', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 8px;
    animation: glitch-text 4s linear infinite;
}

.loader-brand::before,
.loader-brand::after {
    content: 'PUBLIKLAB';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loader-brand::before {
    color: #E91D63;
    animation: glitch-1 3s infinite linear alternate-reverse;
    clip-path: inset(0 0 65% 0);
}

.loader-brand::after {
    color: #29ABE2;
    animation: glitch-2 3s infinite linear alternate-reverse;
    clip-path: inset(65% 0 0 0);
}

@keyframes glitch-1 {

    0%,
    90%,
    100% {
        transform: translate(0);
    }

    92% {
        transform: translate(3px, -1px);
    }

    94% {
        transform: translate(-3px, 1px);
    }

    96% {
        transform: translate(2px, 0px);
    }
}

@keyframes glitch-2 {

    0%,
    88%,
    100% {
        transform: translate(0);
    }

    90% {
        transform: translate(-2px, 1px);
    }

    93% {
        transform: translate(3px, -1px);
    }

    95% {
        transform: translate(-1px, 0px);
    }
}

@keyframes glitch-text {

    0%,
    85%,
    100% {
        opacity: 1;
    }

    86% {
        opacity: 0.8;
    }

    87% {
        opacity: 1;
    }

    88% {
        opacity: 0.6;
    }

    89% {
        opacity: 1;
    }
}

/* Subtitle */
.loader-subtitle {
    position: relative;
    z-index: 1;
    font-family: 'Varela Round', sans-serif;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

/* Scanning line */
.loader-scanline {
    position: relative;
    z-index: 1;
    width: 220px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.loader-scanline::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #E91D63, #29ABE2, transparent);
    animation: scan-line 1.8s ease-in-out infinite;
}

@keyframes scan-line {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

/* Floating particles */
.loader-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #E91D63;
    border-radius: 50%;
    opacity: 0;
    z-index: 0;
    animation: float-particle 4s ease-in-out infinite;
}

.loader-particle:nth-child(1) {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.loader-particle:nth-child(2) {
    top: 70%;
    left: 80%;
    animation-delay: 0.8s;
    background: #29ABE2;
}

.loader-particle:nth-child(3) {
    top: 30%;
    left: 75%;
    animation-delay: 1.6s;
    background: #7E57C2;
}

.loader-particle:nth-child(4) {
    top: 80%;
    left: 20%;
    animation-delay: 2.4s;
}

.loader-particle:nth-child(5) {
    top: 50%;
    left: 10%;
    animation-delay: 1.2s;
    background: #29ABE2;
}

.loader-particle:nth-child(6) {
    top: 15%;
    left: 60%;
    animation-delay: 2s;
    background: #7E57C2;
}

@keyframes float-particle {

    0%,
    100% {
        opacity: 0;
        transform: translateY(0) scale(1);
    }

    25% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.4;
        transform: translateY(-30px) scale(1.5);
    }

    75% {
        opacity: 0.8;
    }
}