/* PQ Crypta Custom Loading Animation - CSP Compliant */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 1s ease-out;
}

.loading-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

.quantum-loader {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* PQ Logo Container */
.pq-logo-container {
    position: relative;
    display: flex;
    gap: 10px;
    z-index: 2;
}

/* PQ Letters */
.pq-letter {
    font-family: 'Arial', sans-serif;
    font-size: 60px;
    font-weight: bold;
    color: #0088ff;
    text-shadow: 0 0 20px #0088ff, 0 0 40px #00d4ff;
    animation: pq-glow 2s ease-in-out infinite;
}

.pq-letter.letter-p {
    animation-delay: 0s;
}

.pq-letter.letter-q {
    animation-delay: 0.2s;
}

@keyframes pq-glow {
    0%, 100% {
        opacity: 0.6;
        text-shadow: 0 0 10px #0088ff, 0 0 20px #00d4ff;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 30px #0088ff, 0 0 60px #00d4ff, 0 0 80px #0088ff;
        transform: scale(1.1);
    }
}

/* Quantum Orbit Rings */
.quantum-orbit {
    position: absolute;
    border: 2px solid rgba(0, 136, 255, 0.3);
    border-radius: 50%;
    animation: orbit-rotate 3s linear infinite;
}

.orbit-1 {
    width: 120px;
    height: 120px;
    border-color: rgba(0, 136, 255, 0.5);
    animation-duration: 3s;
}

.orbit-2 {
    width: 160px;
    height: 160px;
    border-color: rgba(0, 212, 255, 0.4);
    animation-duration: 4s;
    animation-direction: reverse;
}

.orbit-3 {
    width: 200px;
    height: 200px;
    border-color: rgba(0, 0, 208, 0.3);
    animation-duration: 5s;
}

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

/* Quantum Particles - Enhanced Visibility */
.quantum-particle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #00d4ff 0%, #0088ff 50%, rgba(0, 136, 255, 0.5) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 15px #0088ff,
        0 0 30px #00d4ff,
        0 0 45px rgba(0, 212, 255, 0.5);
    animation: particle-float 2s ease-in-out infinite;
    z-index: 3;
}

.particle-1 {
    top: 10%;
    left: 50%;
    animation-delay: 0s;
    background: radial-gradient(circle, #00ffff 0%, #0088ff 50%, rgba(0, 136, 255, 0.5) 100%);
}

.particle-2 {
    top: 30%;
    left: 80%;
    animation-delay: 0.3s;
    width: 12px;
    height: 12px;
}

.particle-3 {
    top: 70%;
    left: 70%;
    animation-delay: 0.6s;
    width: 16px;
    height: 16px;
}

.particle-4 {
    top: 90%;
    left: 40%;
    animation-delay: 0.9s;
    background: radial-gradient(circle, #0088ff 0%, #0000d0 50%, rgba(0, 0, 208, 0.5) 100%);
}

.particle-5 {
    top: 50%;
    left: 10%;
    animation-delay: 1.2s;
    width: 13px;
    height: 13px;
}

.particle-6 {
    top: 20%;
    left: 20%;
    animation-delay: 1.5s;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, #00d4ff 0%, #0088ff 50%, rgba(0, 136, 255, 0.5) 100%);
}

@keyframes particle-float {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0) scale(1);
        opacity: 0.8;
        box-shadow:
            0 0 15px #0088ff,
            0 0 30px #00d4ff,
            0 0 45px rgba(0, 212, 255, 0.5);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-15px) scale(1.5);
        opacity: 1;
        box-shadow:
            0 0 25px #0088ff,
            0 0 50px #00d4ff,
            0 0 75px rgba(0, 212, 255, 0.8);
    }
}

/* Cryptographic Lock Element - Enhanced Design */
.crypto-lock {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 40px;
    background: linear-gradient(135deg, rgba(0, 136, 255, 0.2) 0%, rgba(0, 0, 208, 0.3) 100%);
    border: 3px solid #0088ff;
    border-radius: 8px;
    box-shadow:
        0 0 20px rgba(0, 136, 255, 0.6),
        inset 0 0 15px rgba(0, 212, 255, 0.2);
    animation: lock-pulse 2s ease-in-out infinite;
    z-index: 4;
}

/* Lock shackle (top curved part) */
.crypto-lock::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 22px;
    border: 4px solid #0088ff;
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    box-shadow:
        0 0 15px rgba(0, 136, 255, 0.6),
        inset 0 0 10px rgba(0, 212, 255, 0.3);
    animation: shackle-glow 2s ease-in-out infinite;
}

/* Quantum keyhole with rotating effect */
.crypto-lock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 18px;
    background: linear-gradient(180deg, #00d4ff 0%, #0088ff 100%);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    box-shadow:
        0 0 15px #00d4ff,
        0 0 30px rgba(0, 212, 255, 0.5),
        inset 0 0 8px rgba(255, 255, 255, 0.3);
    animation: keyhole-shine 2s ease-in-out infinite;
}

@keyframes lock-pulse {
    0%, 100% {
        box-shadow:
            0 0 15px rgba(0, 136, 255, 0.4),
            inset 0 0 15px rgba(0, 212, 255, 0.2);
        border-color: #0088ff;
    }
    50% {
        box-shadow:
            0 0 35px rgba(0, 136, 255, 0.9),
            0 0 60px rgba(0, 212, 255, 0.6),
            inset 0 0 25px rgba(0, 212, 255, 0.4);
        border-color: #00d4ff;
    }
}

@keyframes shackle-glow {
    0%, 100% {
        box-shadow:
            0 0 12px rgba(0, 136, 255, 0.5),
            inset 0 0 8px rgba(0, 212, 255, 0.2);
        border-color: #0088ff;
    }
    50% {
        box-shadow:
            0 0 25px rgba(0, 136, 255, 0.9),
            0 0 45px rgba(0, 212, 255, 0.5),
            inset 0 0 15px rgba(0, 212, 255, 0.4);
        border-color: #00ffff;
    }
}

@keyframes keyhole-shine {
    0%, 100% {
        box-shadow:
            0 0 12px #00d4ff,
            0 0 25px rgba(0, 212, 255, 0.4),
            inset 0 0 6px rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%) rotate(0deg);
    }
    50% {
        box-shadow:
            0 0 20px #00ffff,
            0 0 40px rgba(0, 255, 255, 0.7),
            inset 0 0 10px rgba(255, 255, 255, 0.5);
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Lock Circuit Lines - Decorative */
.crypto-lock-container {
    position: relative;
}

/* Add decorative quantum circuit lines around lock */
.lock-circuit-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, #0088ff, transparent);
    height: 2px;
    animation: circuit-flow 2s ease-in-out infinite;
}

.lock-circuit-1 {
    width: 30px;
    top: 50%;
    left: -35px;
    animation-delay: 0s;
}

.lock-circuit-2 {
    width: 30px;
    top: 50%;
    right: -35px;
    animation-delay: 0.5s;
}

.lock-circuit-3 {
    width: 2px;
    height: 25px;
    top: -28px;
    left: 20%;
    background: linear-gradient(180deg, transparent, #00d4ff, transparent);
    animation-delay: 1s;
}

.lock-circuit-4 {
    width: 2px;
    height: 25px;
    top: -28px;
    right: 20%;
    background: linear-gradient(180deg, transparent, #00d4ff, transparent);
    animation-delay: 1.5s;
}

@keyframes circuit-flow {
    0%, 100% {
        opacity: 0.3;
        box-shadow: 0 0 5px rgba(0, 136, 255, 0.3);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.8);
    }
}

/* Quantum Bit Indicators on lock sides */
.quantum-bit {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #00d4ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #00d4ff;
    animation: bit-blink 1.5s ease-in-out infinite;
}

.bit-1 {
    top: 25%;
    left: -2px;
    animation-delay: 0s;
}

.bit-2 {
    top: 50%;
    left: -2px;
    animation-delay: 0.3s;
}

.bit-3 {
    top: 75%;
    left: -2px;
    animation-delay: 0.6s;
}

.bit-4 {
    top: 25%;
    right: -2px;
    animation-delay: 0.2s;
}

.bit-5 {
    top: 50%;
    right: -2px;
    animation-delay: 0.5s;
}

.bit-6 {
    top: 75%;
    right: -2px;
    animation-delay: 0.8s;
}

@keyframes bit-blink {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.8);
        box-shadow: 0 0 5px #00d4ff;
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
        box-shadow: 0 0 15px #00ffff, 0 0 25px rgba(0, 255, 255, 0.5);
    }
}

/* Loading Text */
.loading-text {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    color: #0088ff;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.loading-text::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Quantum Data Stream */
.quantum-stream {
    position: absolute;
    width: 2px;
    height: 30px;
    background: linear-gradient(180deg, transparent, #0088ff, transparent);
    animation: stream-flow 2s linear infinite;
}

.stream-1 {
    top: 0;
    left: 25%;
    animation-delay: 0s;
}

.stream-2 {
    top: 0;
    left: 50%;
    animation-delay: 0.5s;
}

.stream-3 {
    top: 0;
    left: 75%;
    animation-delay: 1s;
}

@keyframes stream-flow {
    0% {
        transform: translateY(-30px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(230px);
        opacity: 0;
    }
}

/* Lattice Grid Pattern - Enhanced Visibility */
.lattice-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    background-image:
        linear-gradient(0deg, transparent 48%, rgba(0, 136, 255, 0.8) 49%, rgba(0, 212, 255, 0.9) 50%, rgba(0, 136, 255, 0.8) 51%, transparent 52%),
        linear-gradient(90deg, transparent 48%, rgba(0, 136, 255, 0.8) 49%, rgba(0, 212, 255, 0.9) 50%, rgba(0, 136, 255, 0.8) 51%, transparent 52%);
    background-size: 40px 40px;
    background-position: 0 0;
    animation: lattice-shift 15s linear infinite, lattice-pulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(0, 136, 255, 0.5));
    z-index: 1;
}

@keyframes lattice-shift {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 40px 40px;
    }
}

@keyframes lattice-pulse {
    0%, 100% {
        opacity: 0.4;
        filter: drop-shadow(0 0 6px rgba(0, 136, 255, 0.3));
    }
    50% {
        opacity: 0.6;
        filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.6));
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .quantum-loader {
        width: 150px;
        height: 150px;
    }

    .pq-letter {
        font-size: 45px;
    }

    .orbit-1 {
        width: 90px;
        height: 90px;
    }

    .orbit-2 {
        width: 120px;
        height: 120px;
    }

    .orbit-3 {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .quantum-loader {
        width: 120px;
        height: 120px;
    }

    .pq-letter {
        font-size: 35px;
    }

    .orbit-1 {
        width: 70px;
        height: 70px;
    }

    .orbit-2 {
        width: 95px;
        height: 95px;
    }

    .orbit-3 {
        width: 120px;
        height: 120px;
    }

    .loading-text {
        font-size: 12px;
    }
}
