/* ========================================
   JIVABOND Loading Animation - ENHANCED
   Premium Peacock-Themed Loader
   ======================================== */

/* Loader Container */
#jivabond-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    overflow: hidden;
}

#jivabond-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Animated Background Gradient */
#jivabond-loader::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(120, 166, 90, 0.1) 0%, transparent 50%);
    animation: bg-rotate 20s linear infinite;
}

/* Loader Content Wrapper */
.loader-content {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: loader-fade-in 0.6s ease-out;
}

/* Peacock Animation Container */
.peacock-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 30px;
}

/* Outer Glow Ring */
.peacock-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(120, 166, 90, 0.2) 0%,
            rgba(40, 53, 127, 0.15) 40%,
            transparent 70%);
    animation: outer-glow-pulse 3s ease-in-out infinite;
}

/* Peacock Feathers (Animated Circles) */
.peacock-feather {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #78A65A;
    border-right-color: #78A65A;
    animation: peacock-spin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    filter: drop-shadow(0 0 8px rgba(120, 166, 90, 0.4));
}

.peacock-feather:nth-child(1) {
    border-top-color: #78A65A;
    border-right-color: #78A65A;
    animation-delay: 0s;
    filter: drop-shadow(0 0 10px rgba(120, 166, 90, 0.6));
}

.peacock-feather:nth-child(2) {
    border-top-color: #28357F;
    border-right-color: #28357F;
    animation-delay: 0.3s;
    width: 85%;
    height: 85%;
    top: 7.5%;
    left: 7.5%;
    filter: drop-shadow(0 0 10px rgba(40, 53, 127, 0.6));
}

.peacock-feather:nth-child(3) {
    border-top-color: #4A90E2;
    border-right-color: #4A90E2;
    animation-delay: 0.6s;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.6));
}

.peacock-feather:nth-child(4) {
    border-top-color: #FFD700;
    border-right-color: #FFD700;
    animation-delay: 0.9s;
    width: 55%;
    height: 55%;
    top: 22.5%;
    left: 22.5%;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.7));
}

/* Peacock Center Eye */
.peacock-eye {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #78A65A 0%, #28357F 50%, #4A90E2 100%);
    border-radius: 50%;
    box-shadow:
        0 0 25px rgba(120, 166, 90, 0.8),
        0 0 50px rgba(40, 53, 127, 0.6),
        0 0 75px rgba(74, 144, 226, 0.4),
        inset 0 0 15px rgba(255, 255, 255, 0.4);
    animation: peacock-pulse 1.5s ease-in-out infinite;
}

.peacock-eye::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    background: radial-gradient(circle, white 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
    animation: peacock-eye-shine 2s ease-in-out infinite;
}

/* Add sparkle effect to center eye */
.peacock-eye::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 30%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 1);
    animation: sparkle 1.5s ease-in-out infinite;
}

/* Brand Name */
.loader-brand {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 10px;
    background: linear-gradient(135deg, #78A65A 0%, #28357F 30%, #4A90E2 60%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    margin-bottom: 15px;
    animation: brand-shimmer 4s ease-in-out infinite;
    position: relative;
    filter: drop-shadow(0 0 20px rgba(120, 166, 90, 0.3));
}

.loader-brand::before {
    content: 'JIVABOND';
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    opacity: 0;
    animation: brand-glow 4s ease-in-out infinite;
}

/* Loading Text */
.loader-text {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 25px;
    animation: text-fade 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(120, 166, 90, 0.5);
}

/* Progress Bar Container */
.loader-progress {
    width: 280px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(120, 166, 90, 0.2);
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg,
            #78A65A 0%,
            #28357F 25%,
            #4A90E2 50%,
            #FFD700 75%,
            #78A65A 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progress-fill 2.5s ease-in-out infinite, progress-shimmer 3s linear infinite;
    box-shadow:
        0 0 25px rgba(120, 166, 90, 0.8),
        0 0 15px rgba(40, 53, 127, 0.6);
    position: relative;
}

/* Progress bar glow effect */
.loader-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.6) 50%,
            transparent 100%);
    animation: progress-shine 2s linear infinite;
}

/* Decorative Particles */
.loader-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #78A65A;
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 4s ease-in-out infinite;
    box-shadow: 0 0 10px currentColor;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    background: #78A65A;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 0.5s;
    background: #28357F;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 1s;
    background: #4A90E2;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 1.5s;
    background: #FFD700;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 2s;
    background: #78A65A;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: 2.5s;
    background: #28357F;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: 3s;
    background: #4A90E2;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: 3.5s;
    background: #FFD700;
}

/* Percentage Counter */
.loader-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(120, 166, 90, 0.8);
    z-index: 10;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes bg-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes outer-glow-pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes peacock-spin {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }

    50% {
        transform: rotate(180deg) scale(1.15);
        opacity: 0.85;
    }

    100% {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

@keyframes peacock-pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 25px rgba(120, 166, 90, 0.8),
            0 0 50px rgba(40, 53, 127, 0.6),
            0 0 75px rgba(74, 144, 226, 0.4),
            inset 0 0 15px rgba(255, 255, 255, 0.4);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow:
            0 0 35px rgba(120, 166, 90, 1),
            0 0 70px rgba(40, 53, 127, 0.8),
            0 0 100px rgba(74, 144, 226, 0.6),
            inset 0 0 20px rgba(255, 255, 255, 0.6);
    }
}

@keyframes peacock-eye-shine {

    0%,
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.85);
    }
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(0.5);
    }
}

@keyframes brand-shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes brand-glow {

    0%,
    100% {
        opacity: 0;
        background-position: 0% 50%;
    }

    50% {
        opacity: 0.4;
        background-position: 100% 50%;
    }
}

@keyframes text-fade {

    0%,
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@keyframes progress-fill {
    0% {
        width: 0%;
        transform: translateX(0);
    }

    50% {
        width: 100%;
        transform: translateX(0);
    }

    100% {
        width: 100%;
        transform: translateX(100%);
    }
}

@keyframes progress-shimmer {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

@keyframes progress-shine {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

@keyframes particle-float {
    0% {
        bottom: -10px;
        opacity: 0;
        transform: translateX(0) rotate(0deg) scale(0.5);
    }

    25% {
        opacity: 1;
        transform: translateX(25px) rotate(90deg) scale(1);
    }

    50% {
        transform: translateX(-25px) rotate(180deg) scale(1.3);
    }

    75% {
        opacity: 0.6;
        transform: translateX(15px) rotate(270deg) scale(0.9);
    }

    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateX(-15px) rotate(360deg) scale(0.5);
    }
}

@keyframes loader-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .peacock-container {
        width: 170px;
        height: 170px;
    }

    .loader-brand {
        font-size: 2.2rem;
        letter-spacing: 6px;
    }

    .loader-text {
        font-size: 0.9rem;
        letter-spacing: 3px;
    }

    .loader-progress {
        width: 220px;
    }

    .peacock-eye {
        width: 40px;
        height: 40px;
    }

    .peacock-eye::before {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .peacock-container {
        width: 140px;
        height: 140px;
    }

    .loader-brand {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .loader-text {
        font-size: 0.8rem;
        letter-spacing: 2px;
    }

    .loader-progress {
        width: 180px;
        height: 5px;
    }

    .peacock-eye {
        width: 32px;
        height: 32px;
    }

    .peacock-eye::before {
        width: 16px;
        height: 16px;
    }

    .peacock-eye::after {
        width: 6px;
        height: 6px;
    }

    .particle {
        width: 4px;
        height: 4px;
    }
}

/* ========================================
   ADDITIONAL PREMIUM EFFECTS
   ======================================== */

/* Glow effect on hover (for testing) */
#jivabond-loader:hover .peacock-eye {
    box-shadow:
        0 0 45px rgba(120, 166, 90, 1),
        0 0 90px rgba(40, 53, 127, 0.9),
        0 0 120px rgba(74, 144, 226, 0.7),
        inset 0 0 25px rgba(255, 255, 255, 0.6);
}

/* Add subtle pulse to the entire container */
.peacock-container {
    animation: container-breathe 4s ease-in-out infinite;
}

@keyframes container-breathe {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}