/* Hide main content until loading is complete */
body.loading {
    overflow: hidden;
}

body.loading .main-content {
    opacity: 0;
    visibility: hidden;
}

.main-content {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease 0.2s;
}

/* Loading screen styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-icon {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.loading-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: loading-rotate 1s linear infinite;
}

.loading-circle:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: transparent;
    border-right-color: var(--primary-color);
    animation-duration: 1.2s;
    animation-direction: reverse;
}

.loading-circle:nth-child(3) {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-top-color: transparent;
    border-left-color: var(--primary-color);
    animation-duration: 0.8s;
}

.loading-text {
    color: var(--primary-color);
    font-family: 'Roboto Mono', monospace;
    font-size: 18px;
    letter-spacing: 2px;
    margin-top: 20px;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background-color: rgba(0, 255, 170, 0.1);
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
    position: relative;
}

.loading-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    position: absolute;
    left: 0;
    top: 0;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.215, 0.61, 0.355, 1);
    box-shadow: 0 0 10px var(--primary-color);
}

@keyframes loading-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Binary animation in loading screen */
.binary-code {
    position: absolute;
    color: rgba(0, 255, 170, 0.1);
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.binary-line {
    position: absolute;
    white-space: nowrap;
    animation: binary-fall linear infinite;
}

@keyframes binary-fall {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(100vh);
    }
}