/* ── Loading overlay — Lani Boot Sequence ────────── */
/* ── Boot Overlay ─────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.04);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3D scene container */
.boot-scene {
    position: relative;
    width: 340px;
    height: 340px;
    perspective: 900px;
}
.boot-scene-inner {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
}

/* Volumetric background glow */
.boot-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.boot-glow::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,180,234,0.08) 0%, rgba(237,26,119,0.04) 40%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* Central core — spinning rings + hexagon outlines */
.boot-core {
    position: absolute;
    left: 0; top: 0;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.boot-core-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(0,180,234,0.15);
}
.boot-core-ring:nth-child(1) {
    animation: spin 10s linear infinite;
    transform: rotateX(60deg);
}
.boot-core-ring:nth-child(2) {
    inset: 8px;
    animation: spin 15s linear infinite reverse;
    transform: rotateY(60deg);
    border-color: rgba(237,26,119,0.15);
}
.boot-core-ring:nth-child(3) {
    inset: 20px;
    animation: spin 8s linear infinite;
    border-style: dashed;
    border-color: rgba(255,255,255,0.06);
}
@keyframes spin { to { transform: rotate(360deg); } }

.boot-core-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 20px rgba(255,255,255,0.8), 0 0 40px rgba(0,180,234,0.4);
    animation: corePulse 2s ease-in-out infinite;
}
@keyframes corePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255,255,255,0.8), 0 0 40px rgba(0,180,234,0.4); }
    50% { box-shadow: 0 0 30px rgba(255,255,255,1), 0 0 60px rgba(0,180,234,0.6); }
}

/* Orbiting electron dots around core */
.boot-electron {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform-origin: center;
}
.boot-electron:nth-child(5) { animation: spin 3s linear infinite; }
.boot-electron:nth-child(6) { animation: spin 5s linear infinite reverse; }
.boot-electron-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}
.boot-electron:nth-child(5) .boot-electron-dot {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--accent);
}
.boot-electron:nth-child(6) .boot-electron-dot {
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-magenta);
    color: var(--accent-magenta);
}

/* Satellite nucleus node */
.boot-node {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(15,15,15,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.5s, box-shadow 0.5s;
    pointer-events: none;
}
.boot-node.active {
    border-color: var(--accent);
    box-shadow: 0 0 24px rgba(0,180,234,0.3);
}
.boot-node.ready {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(0,180,234,0.2);
}
.boot-node-icon {
    transform: rotate(-45deg);
    font-size: 16px;
    opacity: 0.5;
    transition: opacity 0.5s;
}
.boot-node.active .boot-node-icon,
.boot-node.ready .boot-node-icon { opacity: 1; }

/* Connection line from center to node */
.boot-line {
    position: absolute;
    left: 0;
    top: 0;
    height: 1px;
    transform-origin: left center;
    pointer-events: none;
    opacity: 0.15;
    transition: opacity 0.5s;
}
.boot-line.active { opacity: 0.6; }

/* Energy pulse traveling along a connection */
.boot-pulse {
    position: absolute;
    left: 0;
    top: 0;
    height: 1px;
    transform-origin: left center;
    pointer-events: none;
    opacity: 0;
}
.boot-pulse.active { opacity: 0.7; }
.boot-pulse-head {
    position: absolute;
    right: 0;
    top: 50%;
    width: 4px;
    height: 4px;
    transform: translate(50%, -50%);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px #fff;
}

/* Data dust particles */
.boot-dust {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    pointer-events: none;
}

/* Boot status text + progress */
.boot-status {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}
.boot-phase-text {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color 0.4s;
    font-family: 'SF Mono','Consolas','Monaco',monospace;
}
.boot-phase-text.active { color: var(--text-secondary); }

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
    transition: opacity 0.3s;
}

.progress-bar-container {
    width: 200px;
    height: 2px;
    background: rgba(46, 46, 46, 0.5);
    border-radius: 1px;
    margin-top: 8px;
    overflow: hidden;
    display: none;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #fbbf24);
    border-radius: 1px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* Subsystem status indicators */
.boot-subsystems {
    display: flex;
    gap: 18px;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.6s;
}
.boot-subsystems.visible { opacity: 1; }
.boot-subsystem {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-family: 'SF Mono','Consolas','Monaco',monospace;
    color: var(--text-muted);
    transition: color 0.4s;
}
.boot-subsystem.active { color: var(--text-secondary); }
.boot-subsystem.ready { color: var(--accent); }
.boot-subsystem-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.4s, box-shadow 0.4s;
}
.boot-subsystem.active .boot-subsystem-dot {
    background: var(--text-secondary);
    animation: dotPulse 1s ease-in-out infinite;
}
.boot-subsystem.ready .boot-subsystem-dot {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
    animation: none;
}
@keyframes dotPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Hide the old spinner */
.loading-spinner { display: none !important; }
