/* LOADING ANIMATIONS - Portfolio Design System */

:root {
    --loader-primary: #ffffff;
    --loader-secondary: #292b2d;
    --loader-accent: #f9f7f4;
}

/* ================================
   MAIN LOADING OVERLAY
   ================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

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

/* ================================
   LOADER CONTAINER
   ================================ */
.loader-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ================================
   STYLE 1: ORBITAL CIRCLES
   (Matches your hero aesthetic)
   ================================ */
.loader-orbital {
    position: relative;
    width: 150px;
    height: 150px;
}

.orbital-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--loader-primary);
    animation: orbitSpin 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.orbital-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: var(--loader-accent);
    animation-duration: 2s;
    animation-direction: reverse;
}

.orbital-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: var(--loader-primary);
    animation-duration: 1.2s;
}

.orbital-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--loader-primary);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.7;
    }
}

/* ================================
   STYLE 2: GEOMETRIC MORPH
   ================================ */
.loader-geometric {
    width: 100px;
    height: 100px;
    position: relative;
}

.geometric-shape {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid var(--loader-primary);
    animation: morphShape 3s ease-in-out infinite;
}

@keyframes morphShape {
    0%, 100% {
        border-radius: 0%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 50%;
        transform: rotate(45deg) scale(0.8);
    }
    50% {
        border-radius: 0%;
        transform: rotate(90deg) scale(1);
    }
    75% {
        border-radius: 50%;
        transform: rotate(135deg) scale(0.8);
    }
}

/* ================================
   STYLE 3: LIQUID WAVE
   ================================ */
.loader-liquid {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 80px;
}

.liquid-bar {
    width: 8px;
    height: 40px;
    background: var(--loader-primary);
    border-radius: 4px;
    animation: liquidWave 1.2s ease-in-out infinite;
}

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

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

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

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

@keyframes liquidWave {
    0%, 100% {
        height: 40px;
        background: var(--loader-primary);
    }
    50% {
        height: 80px;
        background: var(--loader-accent);
    }
}

/* ================================
   STYLE 4: GLITCH TEXT
   ================================ */
.loader-glitch {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 48px;
    letter-spacing: -2px;
    text-transform: uppercase;
    color: var(--loader-primary);
    position: relative;
}

.loader-glitch::before,
.loader-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loader-glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    animation: glitch1 0.6s infinite linear alternate-reverse;
}

.loader-glitch::after {
    left: -2px;
    text-shadow: 2px 0 #00ffff;
    animation: glitch2 0.6s infinite linear alternate-reverse;
}

@keyframes glitch1 {
    0% {
        clip-path: inset(40% 0 61% 0);
    }
    20% {
        clip-path: inset(92% 0 1% 0);
    }
    40% {
        clip-path: inset(43% 0 1% 0);
    }
    60% {
        clip-path: inset(25% 0 58% 0);
    }
    80% {
        clip-path: inset(54% 0 7% 0);
    }
    100% {
        clip-path: inset(58% 0 43% 0);
    }
}

@keyframes glitch2 {
    0% {
        clip-path: inset(65% 0 15% 0);
    }
    20% {
        clip-path: inset(12% 0 61% 0);
    }
    40% {
        clip-path: inset(38% 0 22% 0);
    }
    60% {
        clip-path: inset(78% 0 7% 0);
    }
    80% {
        clip-path: inset(32% 0 61% 0);
    }
    100% {
        clip-path: inset(87% 0 13% 0);
    }
}

/* ================================
   STYLE 5: PARTICLE BURST
   ================================ */
.loader-particle {
    position: relative;
    width: 100px;
    height: 100px;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--loader-primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform-origin: center;
    animation: particleBurst 2s ease-out infinite;
}

.particle:nth-child(1) {
    animation-delay: 0s;
    transform: translate(-50%, -50%) rotate(0deg);
}

.particle:nth-child(2) {
    animation-delay: 0.1s;
    transform: translate(-50%, -50%) rotate(45deg);
}

.particle:nth-child(3) {
    animation-delay: 0.2s;
    transform: translate(-50%, -50%) rotate(90deg);
}

.particle:nth-child(4) {
    animation-delay: 0.3s;
    transform: translate(-50%, -50%) rotate(135deg);
}

.particle:nth-child(5) {
    animation-delay: 0.4s;
    transform: translate(-50%, -50%) rotate(180deg);
}

.particle:nth-child(6) {
    animation-delay: 0.5s;
    transform: translate(-50%, -50%) rotate(225deg);
}

.particle:nth-child(7) {
    animation-delay: 0.6s;
    transform: translate(-50%, -50%) rotate(270deg);
}

.particle:nth-child(8) {
    animation-delay: 0.7s;
    transform: translate(-50%, -50%) rotate(315deg);
}

@keyframes particleBurst {
    0% {
        transform: translate(-50%, -50%) translateY(0) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) translateY(-60px) scale(1);
        opacity: 0;
    }
}

/* ================================
   LOADING TEXT & PERCENTAGE
   ================================ */
.loading-text {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--loader-primary);
    text-transform: uppercase;
}

.loading-percentage {
    margin-left: 10px;
    opacity: 0.6;
}

/* ================================
   PROGRESS BAR
   ================================ */
.loading-progress {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--loader-primary);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--loader-primary);
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .loader-container {
        width: 150px;
        height: 150px;
    }
    
    .loader-orbital {
        width: 120px;
        height: 120px;
    }
    
    .loader-glitch {
        font-size: 36px;
    }
    
    .loading-text {
        font-size: 12px;
    }
}
