/* 
   Web Digital Solution - New Loader Animation Stylesheet
   Author: Web Digital Solution
   Version: 1.0
*/

/* Ensure body is always visible by default */
body {
    visibility: visible !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease-out;
}

:root {
    --loader-primary: #4e57d4;
    --loader-secondary: #00e5ff;
    --loader-accent: #ff3e6c;
    --loader-bg: #121212;
    --loader-text: #ffffff;
}

/* Loader Container */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--loader-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    pointer-events: none; /* Allow clicks to pass through */
}

.loader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Main Loader */
.loader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Logo Animation */
.loader-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 30px;
    position: relative;
}

.loader-logo svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px var(--loader-secondary));
}

.loader-logo path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-logo 2s forwards ease-in-out;
}

/* Progress Bar */
.loader-progress {
    width: 200px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 15px;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--loader-primary), var(--loader-secondary));
    animation: progress 2.5s ease-in-out forwards;
    box-shadow: 0 0 10px var(--loader-secondary);
}

/* Loading Text */
.loader-text {
    font-family: 'Orbitron', sans-serif;
    color: var(--loader-text);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

.loader-text span {
    display: inline-block;
    animation: pulse-text 1.5s infinite alternate;
    animation-delay: calc(var(--i) * 0.1s);
}

/* Particle Effects */
.loader-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: var(--loader-secondary);
    border-radius: 50%;
    animation: float 3s infinite linear;
}

.particle:nth-child(even) {
    background-color: var(--loader-primary);
}

.particle:nth-child(3n) {
    background-color: var(--loader-accent);
}

/* Animations */
@keyframes draw-logo {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes pulse-text {
    0% { opacity: 0.4; transform: translateY(0); }
    100% { opacity: 1; transform: translateY(-3px); }
}

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

/* Ensure content visibility after loader */
body.content-visible {
    visibility: visible !important;
    opacity: 1 !important;
    overflow: auto !important;
}

/* Media Queries for Responsive Loader */
@media (max-width: 768px) {
    .loader-logo {
        width: 120px;
        height: 120px;
        margin-bottom: 20px;
    }
    
    .loader-progress {
        width: 160px;
    }
    
    .loader-text {
        font-size: 12px;
    }
}