/* NEO DOGE - Preloader Styles */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-container {
    text-align: center;
    position: relative;
}

/* Cyber Loader */
.cyber-loader {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.cyber-circle {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: rotate 2s linear infinite;
}

.cyber-circle:nth-child(1) {
    width: 120px;
    height: 120px;
    border-top: 3px solid #00f5ff;
    border-right: 3px solid #00f5ff;
    animation-duration: 2s;
}

.cyber-circle:nth-child(2) {
    width: 90px;
    height: 90px;
    top: 15px;
    left: 15px;
    border-bottom: 3px solid #4ecdc4;
    border-left: 3px solid #4ecdc4;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.cyber-circle:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 30px;
    left: 30px;
    border-top: 3px solid #ff6b6b;
    border-right: 3px solid #ff6b6b;
    animation-duration: 1s;
}

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

/* Loading Text */
.loading-text {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #00f5ff, #4ecdc4, #ff6b6b, #00f5ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 2s ease-in-out infinite;
}

.loading-text span {
    display: inline-block;
    animation: letterFloat 2s ease-in-out infinite;
}

.loading-text span:nth-child(1) { animation-delay: 0s; }
.loading-text span:nth-child(2) { animation-delay: 0.1s; }
.loading-text span:nth-child(3) { animation-delay: 0.2s; }
.loading-text span:nth-child(4) { animation-delay: 0.3s; }
.loading-text span:nth-child(5) { animation-delay: 0.4s; }
.loading-text span:nth-child(6) { animation-delay: 0.5s; }
.loading-text span:nth-child(7) { animation-delay: 0.6s; }

@keyframes textShine {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes letterFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Loading Subtitle */
.loading-subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    color: #b3b3b3;
    margin-bottom: 2rem;
    animation: fade 2s ease-in-out infinite alternate;
}

@keyframes fade {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Progress Bar */
.progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00f5ff, #4ecdc4, #ff6b6b);
    border-radius: 10px;
    width: 0%;
    animation: progressFill 3s ease-in-out forwards;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Floating Particles */
.preloader-container::before,
.preloader-container::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00f5ff;
    border-radius: 50%;
    animation: floatParticle 4s ease-in-out infinite;
}

.preloader-container::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.preloader-container::after {
    bottom: 20%;
    right: 10%;
    animation-delay: 2s;
}

@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }
    50% {
        transform: translateY(-40px) scale(0.8);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.8;
    }
}

/* Grid Background Effect */
#preloader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 245, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Holographic Effect */
.cyber-loader::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(0, 245, 255, 0.2),
        transparent,
        rgba(255, 107, 107, 0.2),
        transparent,
        rgba(78, 205, 196, 0.2),
        transparent
    );
    border-radius: 50%;
    animation: holographicSpin 4s linear infinite;
    z-index: -1;
}

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

/* Glitch Effect for Text */
.loading-text {
    position: relative;
}

.loading-text::before,
.loading-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-text::before {
    animation: glitchTop 2s infinite;
    color: #ff6b6b;
    z-index: -1;
}

.loading-text::after {
    animation: glitchBottom 1.5s infinite;
    color: #00f5ff;
    z-index: -2;
}

@keyframes glitchTop {
    0%, 5%, 15%, 20%, 25%, 30%, 70%, 80%, 90%, 95%, 100% {
        transform: translate(0);
    }
    10% {
        transform: translate(-2px, -1px);
    }
    85% {
        transform: translate(2px, 1px);
    }
}

@keyframes glitchBottom {
    0%, 5%, 15%, 20%, 25%, 30%, 70%, 80%, 90%, 95%, 100% {
        transform: translate(0);
    }
    10% {
        transform: translate(1px, 2px);
    }
    85% {
        transform: translate(-1px, -2px);
    }
}

/* Pulse Effect */
.cyber-loader {
    position: relative;
}

.cyber-loader::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #00f5ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: centerPulse 2s ease-in-out infinite;
}

@keyframes centerPulse {
    0%, 100% {
        box-shadow: 
            0 0 0 0 rgba(0, 245, 255, 0.7),
            0 0 0 10px rgba(0, 245, 255, 0.5),
            0 0 0 20px rgba(0, 245, 255, 0.3),
            0 0 0 30px rgba(0, 245, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 0 10px rgba(0, 245, 255, 0.5),
            0 0 0 20px rgba(0, 245, 255, 0.3),
            0 0 0 30px rgba(0, 245, 255, 0.1),
            0 0 0 40px rgba(0, 245, 255, 0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .loading-text {
        font-size: 2rem;
    }
    
    .cyber-loader {
        width: 80px;
        height: 80px;
    }
    
    .cyber-circle:nth-child(1) {
        width: 80px;
        height: 80px;
    }
    
    .cyber-circle:nth-child(2) {
        width: 60px;
        height: 60px;
        top: 10px;
        left: 10px;
    }
    
    .cyber-circle:nth-child(3) {
        width: 40px;
        height: 40px;
        top: 20px;
        left: 20px;
    }
    
    .progress-bar {
        width: 250px;
    }
    
    .loading-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .loading-text {
        font-size: 1.5rem;
    }
    
    .cyber-loader {
        width: 60px;
        height: 60px;
        margin-bottom: 1.5rem;
    }
    
    .cyber-circle:nth-child(1) {
        width: 60px;
        height: 60px;
    }
    
    .cyber-circle:nth-child(2) {
        width: 45px;
        height: 45px;
        top: 7.5px;
        left: 7.5px;
    }
    
    .cyber-circle:nth-child(3) {
        width: 30px;
        height: 30px;
        top: 15px;
        left: 15px;
    }
    
    .progress-bar {
        width: 200px;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
    }
}

/* High Performance Mode - Reduced animations for low-end devices */
@media (prefers-reduced-motion: reduce) {
    .cyber-circle,
    .progress-fill,
    .loading-text span,
    .preloader-container::before,
    .preloader-container::after {
        animation: none;
    }
    
    .progress-fill {
        width: 100%;
        background: linear-gradient(90deg, #00f5ff, #4ecdc4, #ff6b6b);
    }
    
    .loading-text {
        background: linear-gradient(135deg, #00f5ff, #4ecdc4);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #preloader {
        background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #1a1a2e 100%);
    }
}

/* Print Styles */
@media print {
    #preloader {
        display: none !important;
    }
}
