/* Loading Overlay */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Share Tech Mono', monospace;
}

/* Scanlines - More visible */
.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.1) 0px,
        rgba(0, 255, 255, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    animation: glitch 0.05s infinite;
}

/* More intense glitch effect */
@keyframes glitch {
    0% {
        transform: translate(0);
        opacity: 0.8;
    }
    20% {
        transform: translate(-4px, 2px) skewX(10deg);
        opacity: 0.9;
    }
    40% {
        transform: translate(4px, -2px) skewX(-10deg);
        opacity: 0.7;
    }
    60% {
        transform: translate(3px, 3px) skewX(5deg);
        opacity: 0.95;
    }
    80% {
        transform: translate(-3px, -3px) skewX(-5deg);
        opacity: 0.85;
    }
    100% {
        transform: translate(0);
        opacity: 0.8;
    }
}

/* More intense flicker effect */
@keyframes flicker {
    0%, 100% {
        opacity: 0.9;
        text-shadow: 
            -1px -1px 0 #0ff, 
            1px 1px 0 #f0f,
            0 0 10px rgba(0, 255, 255, 0.5);
    }
    5%, 15%, 25%, 35%, 45%, 55%, 65%, 75%, 85%, 95% {
        opacity: 0.4;
        text-shadow: none;
    }
    10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% {
        opacity: 0.7;
        text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    }
}

/* More intense scanline animation */
@keyframes scanline {
    0% {
        transform: translateY(-100%);
        opacity: 0;
        height: 2px;
    }
    2% {
        opacity: 1;
        height: 4px;
        box-shadow: 0 0 20px rgba(0, 255, 255, 1);
    }
    90% {
        opacity: 1;
        height: 4px;
    }
    95% {
        opacity: 0.2;
        height: 8px;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
        height: 2px;
    }
}

/* Moving scanline - more visible */
.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, 
        transparent, 
        rgba(0, 255, 255, 0.8), 
        transparent);
    animation: scanline 2s linear infinite;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    z-index: 1;
    filter: blur(0.5px);
}

/* More aggressive glitch lines */
.glitch-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 255, 255, 0.8);
    transform: scaleY(0.3);
    z-index: 0;
    animation: glitch-line 1.5s infinite;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

@keyframes glitch-line {
    0% { 
        opacity: 0; 
        transform: translateY(-20px) scaleY(0.1);
        height: 1px;
    }
    5% { 
        opacity: 0.9; 
        transform: translateY(0) scaleY(1);
        height: 3px;
    }
    10% { 
        opacity: 0.7; 
        transform: translateY(5px) scaleY(0.5);
        height: 2px;
    }
    15% {
        opacity: 0.3;
        transform: translateY(10px) scaleY(0.3);
        height: 1px;
    }
    100% { 
        opacity: 0; 
        transform: translateY(15px) scaleY(0.1);
        height: 1px;
    }
}

/* Create multiple glitch lines with varying effects */
.glitch-line:nth-child(1) { 
    top: 15%; 
    animation-delay: 0s;
    background: rgba(0, 255, 255, 0.9);
}
.glitch-line:nth-child(2) { 
    top: 35%; 
    animation-delay: 0.3s;
    background: rgba(0, 200, 255, 0.8);
    animation-duration: 2s;
}
.glitch-line:nth-child(3) { 
    top: 55%; 
    animation-delay: 0.6s;
    background: rgba(0, 150, 255, 0.7);
    animation-duration: 1.8s;
}
.glitch-line:nth-child(4) { 
    top: 75%; 
    animation-delay: 0.9s;
    background: rgba(0, 100, 255, 0.6);
    animation-duration: 2.2s;
}

@keyframes glitch-block {
    0%, 100% { opacity: 0; transform: scale(0.95); }
    10% { opacity: 0.1; transform: scale(1); }
    20% { opacity: 0; transform: scale(1.05); }
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-container {
    width: 80%;
    max-width: 500px;
    position: relative;
}

.loading-header {
    color: #00ffff;
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

.loading-header::after {
    content: '...';
    display: inline-block;
    width: 0;
    animation: dots 1.5s steps(4, end) infinite;
    overflow: hidden;
    vertical-align: bottom;
}

@keyframes dots {
    to { width: 3ch; }
}

.decryption-bar {
    width: 100%;
    height: 40px;
    background: rgba(0, 20, 30, 0.8);
    border: 1px solid #00ffff;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.decryption-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        rgba(0, 200, 255, 0.2) 0%, 
        rgba(0, 255, 255, 0.8) 50%, 
        rgba(0, 200, 255, 0.2) 100%);
    transition: width 0.3s ease-out;
    animation: scan 2s linear infinite;
    background-size: 200% 100%;
}

@keyframes scan {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.decryption-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ffff;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.7);
    font-family: 'Share Tech Mono', monospace;
}

.decryption-text::before {
    content: '[';
    margin-right: 5px;
    opacity: 0.7;
}

.decryption-text::after {
    content: ']';
    margin-left: 5px;
    opacity: 0.7;
}

.loading-percentage {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #00ffff;
    font-size: 12px;
    font-family: 'Share Tech Mono', monospace;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.7);
}

/* Binary code rain effect */
.binary-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

.binary-digit {
    position: absolute;
    color: #00ffff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    opacity: 0;
    animation: fall linear infinite;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.7);
}

@keyframes fall {
    0% { 
        transform: translateY(-20px);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% { 
        transform: translateY(100vh);
        opacity: 0;
    }
}
