* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background-color: #050505; /* Darker background */
    font-family: Arial, sans-serif;
    color: #ffffff;
}

#canvas-container {
    position: fixed;
    width: 100%;
    height: 100%;
    opacity: 0; /* Start hidden */
    transition: opacity 1.5s ease-in-out; /* Smooth fade-in */
}

#canvas-container.loaded {
    opacity: 1;
}

#network-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Add an enhanced gradient background that matches the fog color */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0a1525 0%, #040a14 50%, #020408 100%);
    pointer-events: none;
    z-index: -1;
}

/* Loading screen styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0c1a2d 0%, #050c1a 60%, #020408 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s ease-out, transform 0.5s ease-in-out;
}

#loading-screen.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.loader {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
}

.loader-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #00aaff;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.loader-circle:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: transparent;
    border-right-color: #0077cc;
    animation-duration: 2s;
    animation-direction: reverse;
}

.loader-circle:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: transparent;
    border-left-color: #004488;
    animation-duration: 2.5s;
}

.loading-text {
    font-size: 18px;
    letter-spacing: 1px;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.7);
    font-weight: 300;
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0077cc, #00aaff);
    transition: width 0.5s ease;
}

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