/* ========================================
   LOADING SCREEN STYLES
   Neural Network Initialization Animation
   ======================================== */

/* Loading Container */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: var(--z-loading);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Neural Logo Animation */
.loading-logo {
    position: relative;
    width: 120px;
    height: 120px;
}

.loading-brain {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated Neural Nodes */
.neural-nodes {
    position: relative;
    width: 80px;
    height: 80px;
}

.node {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: var(--shadow-glow-primary);
}

.node:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.node:nth-child(2) {
    top: 20%;
    left: 10%;
}

.node:nth-child(3) {
    top: 20%;
    right: 10%;
}

.node:nth-child(4) {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.node:nth-child(5) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--secondary);
    box-shadow: var(--shadow-glow-secondary);
}

.node:nth-child(6) {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.node:nth-child(7) {
    bottom: 20%;
    left: 10%;
}

.node:nth-child(8) {
    bottom: 20%;
    right: 10%;
}

.node:nth-child(9) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Node Pulse Animation */
.node {
    animation: nodePulse 2s ease-in-out infinite;
}

.node:nth-child(1) {
    animation-delay: 0s;
}

.node:nth-child(2) {
    animation-delay: 0.1s;
}

.node:nth-child(3) {
    animation-delay: 0.2s;
}

.node:nth-child(4) {
    animation-delay: 0.3s;
}

.node:nth-child(5) {
    animation-delay: 0.4s;
}

.node:nth-child(6) {
    animation-delay: 0.5s;
}

.node:nth-child(7) {
    animation-delay: 0.6s;
}

.node:nth-child(8) {
    animation-delay: 0.7s;
}

.node:nth-child(9) {
    animation-delay: 0.8s;
}

@keyframes nodePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* SVG Connections */
.neural-connections {
    position: absolute;
    inset: 0;
    overflow: visible;
}

.neural-connections line {
    stroke: var(--primary);
    stroke-width: 1;
    opacity: 0.3;
    animation: connectionPulse 2s ease-in-out infinite;
}

@keyframes connectionPulse {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.6;
    }
}

/* Rotating Ring */
.loading-ring {
    position: absolute;
    inset: -10px;
    border: 2px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    border-radius: 50%;
    animation: rotate 1.5s linear infinite;
}

.loading-ring::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 2px solid transparent;
    border-bottom-color: var(--accent);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: rotate 2s linear infinite reverse;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Loading Text */
.loading-text {
    text-align: center;
}

.loading-title {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    color: var(--primary);
    margin-bottom: var(--space-sm);
    text-shadow: var(--shadow-glow-primary);
}

.loading-status {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.loading-status::before {
    content: '>';
    color: var(--accent);
}

.loading-dots {
    display: inline-flex;
    gap: 2px;
}

.loading-dots span {
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    animation: loadingDots 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDots {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress Bar */
.loading-progress {
    width: 200px;
    height: 3px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-md);
}

.loading-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    box-shadow: var(--shadow-glow-primary);
}

/* Scanline Effect */
.loading-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 50%,
            rgba(0, 0, 0, 0.05) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.1;
}