/* ╔══════════════════════════════════════════════════════════╗
   ║     AXVER HUB - LOADER CSS v1.2.0                      ║
   ║     Premium Loading Animation with Effects              ║
   ╚══════════════════════════════════════════════════════════╝ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --primary: #0066cc;
    --primary-light: #0088ee;
    --primary-dark: #004b99;
    --accent: #00aaff;
    --accent-light: #33bbff;
    --accent-dark: #0088cc;
    --bg-dark: #060c18;
    --bg-darker: #030810;
    --text: #e0f0ff;
    --text-light: #ffffff;
    --text-muted: #8899aa;
    --text-dim: #556677;
    --glow-blue: rgba(0, 102, 204, 0.15);
    --glow-accent: rgba(0, 170, 255, 0.1);
    --shadow-glow: rgba(0, 102, 204, 0.3);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(0, 102, 204, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 170, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 102, 204, 0.06) 0%, transparent 50%);
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: default;
}

/* ============================================
   BACKGROUND GRID
   ============================================ */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(0, 102, 204, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 204, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridPulse 10s infinite ease-in-out;
}

@keyframes gridPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   GLOW EFFECTS
   ============================================ */
.bg-glow-1 {
    position: fixed;
    width: 600px;
    height: 600px;
    top: -200px;
    left: -200px;
    background: radial-gradient(circle, var(--glow-blue) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: floatGlow1 18s infinite ease-in-out;
    filter: blur(30px);
}

.bg-glow-2 {
    position: fixed;
    width: 500px;
    height: 500px;
    bottom: -150px;
    right: -150px;
    background: radial-gradient(circle, var(--glow-accent) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: floatGlow2 22s infinite ease-in-out;
    filter: blur(25px);
}

@keyframes floatGlow1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    33% { transform: translate(80px, -50px) scale(1.1); opacity: 1; }
    66% { transform: translate(-40px, 40px) scale(0.9); opacity: 0.6; }
}

@keyframes floatGlow2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    50% { transform: translate(-60px, -40px) scale(1.15); opacity: 1; }
}

/* ============================================
   PARTICLES
   ============================================ */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary);
    border-radius: 50%;
    animation: particleFloat 4s infinite ease-in-out;
    opacity: 0;
    box-shadow:
        0 0 6px var(--accent),
        0 0 12px rgba(0, 102, 204, 0.5),
        0 0 20px rgba(0, 102, 204, 0.3);
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; width: 2px; height: 2px; }
.particle:nth-child(2) { left: 22%; animation-delay: 0.4s; width: 3px; height: 3px; }
.particle:nth-child(3) { left: 35%; animation-delay: 0.8s; width: 2px; height: 2px; }
.particle:nth-child(4) { left: 48%; animation-delay: 1.2s; width: 4px; height: 4px; }
.particle:nth-child(5) { left: 60%; animation-delay: 1.6s; width: 2px; height: 2px; }
.particle:nth-child(6) { left: 72%; animation-delay: 2s; width: 3px; height: 3px; }
.particle:nth-child(7) { left: 84%; animation-delay: 2.4s; width: 2px; height: 2px; }
.particle:nth-child(8) { left: 95%; animation-delay: 2.8s; width: 3px; height: 3px; }

@keyframes particleFloat {
    0% {
        bottom: -20px;
        opacity: 0;
        transform: translateX(0) scale(0.5) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
        transform: translateX(30px) scale(1.5) rotate(180deg);
    }
    90% {
        opacity: 0.1;
    }
    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(50px) scale(0.3) rotate(360deg);
    }
}

/* ============================================
   LOADER SCREEN
   ============================================ */
.loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at center, rgba(0, 102, 204, 0.05) 0%, transparent 70%);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, visibility;
}

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

/* ============================================
   LOGO CONTAINER WITH SPINNING RINGS
   ============================================ */
.loader-logo-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    margin-bottom: 35px;
}

.loader-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
    will-change: transform;
}

/* Ring 1 - Outer */
.loader-ring:nth-child(1) {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    animation: spin 1.2s linear infinite;
    box-shadow:
        0 0 15px var(--shadow-glow),
        inset 0 0 15px rgba(0, 102, 204, 0.1);
}

/* Ring 2 - Middle */
.loader-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: var(--accent);
    border-bottom-color: var(--primary);
    animation: spin 1.8s linear infinite reverse;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.2);
}

/* Ring 3 - Inner */
.loader-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-right-color: var(--accent-light);
    border-bottom-color: var(--accent);
    border-left-color: var(--primary);
    animation: spin 2.5s linear infinite;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.15);
}

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

/* Logo Center */
.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 40px rgba(0, 102, 204, 0.6),
        0 0 80px rgba(0, 102, 204, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: logoPulse 2s infinite;
    z-index: 2;
}

.loader-logo svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes logoPulse {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(0, 102, 204, 0.4),
            0 0 60px rgba(0, 102, 204, 0.2);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow:
            0 0 50px rgba(0, 102, 204, 0.9),
            0 0 100px rgba(0, 170, 255, 0.5);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* ============================================
   LOADING TEXT
   ============================================ */
.loader-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: textFade 1.5s infinite;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 102, 204, 0.3);
}

@keyframes textFade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar-wrap {
    width: 240px;
    height: 4px;
    background: rgba(0, 102, 204, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
        var(--primary-dark),
        var(--primary),
        var(--accent),
        var(--accent-light),
        var(--accent),
        var(--primary)
    );
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.2s ease-out;
    box-shadow:
        0 0 15px rgba(0, 102, 204, 0.5),
        0 0 30px rgba(0, 170, 255, 0.3);
    animation: progressShine 2s linear infinite;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progressGlow 1.5s infinite;
}

@keyframes progressShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes progressGlow {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* ============================================
   LOADING DOTS
   ============================================ */
.loading-dots {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.loading-dots .dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out;
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.5);
}

.loading-dots .dot:nth-child(1) { animation-delay: 0s; }
.loading-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.3;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* ============================================
   LOADER INFO
   ============================================ */
.loader-info {
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.loader-version {
    background: rgba(0, 102, 204, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.7rem;
    border: 1px solid rgba(0, 102, 204, 0.2);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .loader-logo-wrap {
        width: 100px;
        height: 100px;
        margin-bottom: 25px;
    }

    .loader-logo {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .loader-logo svg {
        width: 24px;
        height: 24px;
    }

    .loader-text {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

    .progress-bar-wrap {
        width: 180px;
    }

    .loader-info {
        font-size: 0.7rem;
    }
}

@media (max-width: 320px) {
    .loader-logo-wrap {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .loader-logo {
        width: 35px;
        height: 35px;
        border-radius: 10px;
    }

    .progress-bar-wrap {
        width: 150px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .loader-ring,
    .loader-logo,
    .loader-text,
    .loading-dots .dot,
    .particle,
    .bg-glow-1,
    .bg-glow-2,
    .grid-bg,
    .progress-bar {
        animation-duration: 0s !important;
        animation: none !important;
    }
}