/* ==========================================================================
   VCSG UUHF PREMIUM ORBITAL PRELOADER STYLESHEET
   Futuristic yet Academic University Loading Animation
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Root Preloader Container (100vw, 100vh, Perfectly Centered)
   -------------------------------------------------------------------------- */
#preloader.vcsg-orbital-preloader-root,
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: #F8FBFF;
    background: radial-gradient(circle at center, rgba(47, 128, 237, 0.09) 0%, rgba(248, 251, 255, 0.95) 45%, #F8FBFF 75%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999999;
    box-sizing: border-box;
    pointer-events: all;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Exit State: Triggered when window load finishes */
#preloader.preloader-loaded,
#preloader.vcsg-preloader-hidden,
.preloader-hidden #preloader {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#preloader.preloader-destroyed {
    display: none !important;
}

#preloader #preloader_status,
#preloader #preloader-status,
#preloader .preloader-status {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#preloader.preloader-loaded #preloader_status,
#preloader.preloader-loaded #preloader-status,
#preloader.preloader-loaded .preloader-status {
    opacity: 0 !important;
    transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   2. Orbital Container & Stage
   -------------------------------------------------------------------------- */
.vcsg-orbital-container {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Ambient Radial Soft Glow behind the logo */
.vcsg-ambient-glow {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 128, 237, 0.16) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 70%);
    filter: blur(18px);
    pointer-events: none;
    z-index: 1;
    animation: vcsgAmbientPulse 4s ease-in-out infinite alternate;
}

@keyframes vcsgAmbientPulse {
    0% {
        transform: scale(0.92);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.1);
        opacity: 0.95;
    }
}

/* --------------------------------------------------------------------------
   3. Floating Ambient Particles (Subtle, 8 particles maximum)
   -------------------------------------------------------------------------- */
.vcsg-particles-group {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.vcsg-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.35;
    filter: blur(0.5px);
}

.vcsg-particle.p1 {
    width: 4px;
    height: 4px;
    top: 18%;
    left: 24%;
    background: #2F80ED;
    animation: vcsgFloatParticle 5s ease-in-out infinite;
}

.vcsg-particle.p2 {
    width: 3px;
    height: 3px;
    top: 14%;
    right: 28%;
    background: #06B6D4;
    animation: vcsgFloatParticle 6.5s ease-in-out 1s infinite alternate;
}

.vcsg-particle.p3 {
    width: 4px;
    height: 4px;
    bottom: 22%;
    left: 20%;
    background: #10B981;
    animation: vcsgFloatParticle 7s ease-in-out 0.5s infinite alternate;
}

.vcsg-particle.p4 {
    width: 3px;
    height: 3px;
    bottom: 18%;
    right: 22%;
    background: #C89933;
    animation: vcsgFloatParticle 5.5s ease-in-out 1.5s infinite;
}

.vcsg-particle.p5 {
    width: 2.5px;
    height: 2.5px;
    top: 48%;
    left: 10%;
    background: #8B5CF6;
    animation: vcsgFloatParticle 6s ease-in-out 2s infinite alternate;
}

.vcsg-particle.p6 {
    width: 3px;
    height: 3px;
    top: 46%;
    right: 10%;
    background: #2F80ED;
    animation: vcsgFloatParticle 7.5s ease-in-out 0.8s infinite alternate;
}

.vcsg-particle.p7 {
    width: 2px;
    height: 2px;
    top: 8%;
    left: 50%;
    background: #06B6D4;
    animation: vcsgFloatParticle 8s ease-in-out 1.2s infinite;
}

.vcsg-particle.p8 {
    width: 2.5px;
    height: 2.5px;
    bottom: 10%;
    left: 52%;
    background: #1558B0;
    animation: vcsgFloatParticle 6.8s ease-in-out 2.5s infinite alternate;
}

@keyframes vcsgFloatParticle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.2;
    }
    50% {
        transform: translateY(-8px) translateX(6px);
        opacity: 0.75;
    }
    100% {
        transform: translateY(4px) translateX(-4px);
        opacity: 0.3;
    }
}

/* --------------------------------------------------------------------------
   4. Concentric Orbital Rings Architecture (5 Independent Layers)
   -------------------------------------------------------------------------- */
.vcsg-orbital-system {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.vcsg-orbital-ring {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transform-origin: center center;
    will-change: transform;
}

.vcsg-orbital-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    transform: rotate(-90deg); /* Start arcs at top */
}

/* Subtle background guide tracks */
.vcsg-orbital-track {
    fill: none;
    stroke: rgba(21, 88, 176, 0.05);
    stroke-width: 1.5;
}

/* Common Arc Styling */
.vcsg-orbital-arc {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

/* Glowing Orbital Nodes */
.vcsg-orbital-node {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
}

/* --- RING 1: Outer Primary Academic Blue (#1558B0) ---
   Diameter: 280px | Clockwise | Duration: 7.5s
*/
.vcsg-orbital-ring.ring-1 {
    width: 280px;
    height: 280px;
    animation: vcsgRotateClockwise 7.5s linear infinite;
}

.vcsg-orbital-arc.arc-primary {
    stroke-width: 2.5px;
    stroke-dasharray: 840;
    /* Main arc approx 38% circumference, gap, secondary small arc */
    stroke-dasharray: 230 180 90 340;
    filter: drop-shadow(0 0 4px rgba(21, 88, 176, 0.45));
}

.vcsg-orbital-node.node-primary {
    width: 6px;
    height: 6px;
    top: 3px;
    left: 50%;
    margin-left: -3px;
    background: #2F80ED;
    box-shadow: 0 0 8px 1.5px rgba(47, 128, 237, 0.8), 0 0 2px #FFFFFF;
}

/* --- RING 2: Vibrant Cyan (#06B6D4) ---
   Diameter: 240px | Anti-Clockwise | Duration: 6s
*/
.vcsg-orbital-ring.ring-2 {
    width: 240px;
    height: 240px;
    animation: vcsgRotateCounterClockwise 6s linear infinite;
}

.vcsg-orbital-arc.arc-cyan {
    stroke-width: 2.2px;
    stroke-dasharray: 180 140 70 320;
    filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.5));
}

.vcsg-orbital-node.node-cyan {
    width: 5px;
    height: 5px;
    top: 3px;
    left: 50%;
    margin-left: -2.5px;
    background: #06B6D4;
    box-shadow: 0 0 7px 1.5px rgba(6, 182, 212, 0.85), 0 0 2px #FFFFFF;
}

/* --- RING 3: Academic Gold (#C89933) ---
   Diameter: 200px | Clockwise | Duration: 9s
*/
.vcsg-orbital-ring.ring-3 {
    width: 200px;
    height: 200px;
    animation: vcsgRotateClockwise 9s linear infinite;
}

.vcsg-orbital-arc.arc-gold {
    stroke-width: 2px;
    stroke-dasharray: 140 120 50 280;
    filter: drop-shadow(0 0 3px rgba(200, 153, 51, 0.45));
}

.vcsg-orbital-node.node-gold {
    width: 4.5px;
    height: 4.5px;
    top: 2.5px;
    left: 50%;
    margin-left: -2.25px;
    background: #E5B856;
    box-shadow: 0 0 6px 1px rgba(200, 153, 51, 0.8), 0 0 2px #FFFFFF;
}

/* --- RING 4: Royal Purple (#8B5CF6) ---
   Diameter: 166px | Anti-Clockwise | Duration: 7.5s
*/
.vcsg-orbital-ring.ring-4 {
    width: 166px;
    height: 166px;
    animation: vcsgRotateCounterClockwise 7.5s linear infinite;
}

.vcsg-orbital-arc.arc-purple {
    stroke-width: 1.8px;
    stroke-dasharray: 120 90 40 240;
    filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.45));
}

.vcsg-orbital-node.node-purple {
    width: 4px;
    height: 4px;
    top: 2px;
    left: 50%;
    margin-left: -2px;
    background: #A78BFA;
    box-shadow: 0 0 6px 1px rgba(139, 92, 246, 0.8), 0 0 2px #FFFFFF;
}

/* --- RING 5: Emerald Growth (#10B981) ---
   Diameter: 136px | Clockwise | Duration: 5s
*/
.vcsg-orbital-ring.ring-5 {
    width: 136px;
    height: 136px;
    animation: vcsgRotateClockwise 5s linear infinite;
}

.vcsg-orbital-arc.arc-emerald {
    stroke-width: 1.8px;
    stroke-dasharray: 100 70 30 190;
    filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.5));
}

.vcsg-orbital-node.node-emerald {
    width: 4px;
    height: 4px;
    top: 2.5px;
    left: 50%;
    margin-left: -2px;
    background: #34D399;
    box-shadow: 0 0 6px 1px rgba(16, 185, 129, 0.85), 0 0 2px #FFFFFF;
}

/* --------------------------------------------------------------------------
   5. Center Logo Stage & Subtle Breathing Effect
   -------------------------------------------------------------------------- */
.vcsg-logo-stage {
    position: relative;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transform: translateZ(0);
}

/* Subtle Inner Pulsing Circular Halo */
.vcsg-logo-halo {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(47, 128, 237, 0.22);
    box-shadow: 0 0 16px rgba(47, 128, 237, 0.12), inset 0 0 12px rgba(47, 128, 237, 0.08);
    pointer-events: none;
    animation: vcsgHaloPulse 3.5s ease-in-out infinite alternate;
}

@keyframes vcsgHaloPulse {
    0% {
        transform: scale(0.97);
        opacity: 0.6;
        border-color: rgba(47, 128, 237, 0.15);
    }
    100% {
        transform: scale(1.04);
        opacity: 0.95;
        border-color: rgba(47, 128, 237, 0.35);
    }
}

/* Logo Wrapper with Crisp Circular Clipping & Breathing Keyframe */
.vcsg-logo-wrapper {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(8, 37, 82, 0.1), 0 1px 4px rgba(8, 37, 82, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6px;
    box-sizing: border-box;
    will-change: transform;
    animation: vcsgLogoBreathe 3.5s ease-in-out infinite alternate;
}

.vcsg-preloader-logo {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    border-radius: 50% !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: none !important;
}

/* Ensure legacy generic selector doesn't override */
#preloader img.vcsg-preloader-logo {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
}

/* Gentle, academic breathing: 1 -> 1.025 -> 1 */
@keyframes vcsgLogoBreathe {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.025);
    }
}

/* --------------------------------------------------------------------------
   6. Loading Status Text & Animated Dots
   -------------------------------------------------------------------------- */
.vcsg-loader-status-text {
    position: absolute;
    bottom: -38px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #64748B;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 1px;
    white-space: nowrap;
    z-index: 10;
}

.vcsg-status-dots .dot {
    display: inline-block;
    animation: vcsgDots 1.4s infinite;
    opacity: 0.2;
}

.vcsg-status-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.vcsg-status-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.vcsg-status-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes vcsgDots {
    0%, 20% {
        opacity: 0.2;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
    80%, 100% {
        opacity: 0.2;
        transform: translateY(0);
    }
}

/* --------------------------------------------------------------------------
   7. Continuous Infinite Rotations (Clockwise & Anti-Clockwise)
   -------------------------------------------------------------------------- */
@keyframes vcsgRotateClockwise {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

/* --------------------------------------------------------------------------
   8. Responsive Scaling (Tablet & Mobile Proportions)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .vcsg-orbital-container {
        width: 250px;
        height: 250px;
    }

    .vcsg-orbital-ring.ring-1 {
        width: 230px;
        height: 230px;
    }

    .vcsg-orbital-ring.ring-2 {
        width: 198px;
        height: 198px;
    }

    .vcsg-orbital-ring.ring-3 {
        width: 168px;
        height: 168px;
    }

    .vcsg-orbital-ring.ring-4 {
        width: 140px;
        height: 140px;
    }

    .vcsg-orbital-ring.ring-5 {
        width: 114px;
        height: 114px;
    }

    .vcsg-logo-stage {
        width: 96px;
        height: 96px;
    }

    .vcsg-logo-wrapper {
        width: 92px;
        height: 92px;
        padding: 5px;
    }

    .vcsg-loader-status-text {
        bottom: -32px;
        font-size: 12.5px;
    }
}

@media (max-width: 480px) {
    .vcsg-orbital-container {
        width: 210px;
        height: 210px;
    }

    .vcsg-orbital-ring.ring-1 {
        width: 194px;
        height: 194px;
    }

    .vcsg-orbital-ring.ring-2 {
        width: 168px;
        height: 168px;
    }

    .vcsg-orbital-ring.ring-3 {
        width: 142px;
        height: 142px;
    }

    .vcsg-orbital-ring.ring-4 {
        width: 120px;
        height: 120px;
    }

    .vcsg-orbital-ring.ring-5 {
        width: 98px;
        height: 98px;
    }

    .vcsg-logo-stage {
        width: 82px;
        height: 82px;
    }

    .vcsg-logo-wrapper {
        width: 78px;
        height: 78px;
        padding: 4px;
    }

    .vcsg-loader-status-text {
        bottom: -28px;
        font-size: 11.5px;
    }
}

/* --------------------------------------------------------------------------
   9. Strict Accessibility: Respect prefers-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .vcsg-orbital-ring,
    .vcsg-ambient-glow,
    .vcsg-logo-halo,
    .vcsg-logo-wrapper,
    .vcsg-particle,
    .vcsg-status-dots .dot {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }

    .vcsg-orbital-ring.ring-1,
    .vcsg-orbital-ring.ring-2,
    .vcsg-orbital-ring.ring-3,
    .vcsg-orbital-ring.ring-4,
    .vcsg-orbital-ring.ring-5 {
        transform: none !important;
    }

    .vcsg-logo-wrapper {
        transform: scale(1) !important;
    }

    .vcsg-particles-group {
        display: none !important;
    }
}
