/* ================================
   ULTIMATE UPGRADE - Creative Additions
   ================================ */

/* 1. Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 9999;
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.1s;
}

/* 2. Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-light);
    box-shadow: 0 0 10px var(--primary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(139, 92, 246, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-outline {
    opacity: 1;
}

/* Hover State for Cursor */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    backdrop-filter: blur(2px);
}

/* Hide default cursor only when custom cursor is active */
@media (min-width: 1024px) {
    body.custom-cursor-active {
        cursor: none;
    }

    body.custom-cursor-active a,
    body.custom-cursor-active button,
    body.custom-cursor-active .btn,
    body.custom-cursor-active .feature-card,
    body.custom-cursor-active .glass-card {
        cursor: none;
    }
}

/* 3. Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse-logo 2s infinite;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: var(--gradient-primary);
    position: absolute;
    left: 0;
    top: 0;
    animation: load-progress 2s ease-in-out forwards;
}

@keyframes pulse-logo {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(99, 102, 241, 0));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(99, 102, 241, 0));
    }
}

@keyframes load-progress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* 4. Glitch Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(38px, 9999px, 84px, 0);
        transform: skew(0.65deg);
    }

    5% {
        clip: rect(57px, 9999px, 3px, 0);
        transform: skew(0.38deg);
    }

    10% {
        clip: rect(6px, 9999px, 86px, 0);
        transform: skew(0.08deg);
    }

    15% {
        clip: rect(93px, 9999px, 6px, 0);
        transform: skew(0.01deg);
    }

    20% {
        clip: rect(52px, 9999px, 41px, 0);
        transform: skew(0.95deg);
    }

    25% {
        clip: rect(56px, 9999px, 78px, 0);
        transform: skew(0.6deg);
    }

    30% {
        clip: rect(21px, 9999px, 43px, 0);
        transform: skew(0.01deg);
    }

    35% {
        clip: rect(74px, 9999px, 72px, 0);
        transform: skew(0.34deg);
    }

    40% {
        clip: rect(82px, 9999px, 20px, 0);
        transform: skew(0.02deg);
    }

    45% {
        clip: rect(10px, 9999px, 14px, 0);
        transform: skew(0.39deg);
    }

    50% {
        clip: rect(53px, 9999px, 98px, 0);
        transform: skew(0.07deg);
    }

    55% {
        clip: rect(96px, 9999px, 7px, 0);
        transform: skew(0.35deg);
    }

    60% {
        clip: rect(64px, 9999px, 86px, 0);
        transform: skew(0.25deg);
    }

    65% {
        clip: rect(96px, 9999px, 32px, 0);
        transform: skew(0.79deg);
    }

    70% {
        clip: rect(27px, 9999px, 3px, 0);
        transform: skew(0.07deg);
    }

    75% {
        clip: rect(92px, 9999px, 42px, 0);
        transform: skew(0.94deg);
    }

    80% {
        clip: rect(10px, 9999px, 86px, 0);
        transform: skew(0.39deg);
    }

    85% {
        clip: rect(25px, 9999px, 16px, 0);
        transform: skew(0.07deg);
    }

    90% {
        clip: rect(74px, 9999px, 93px, 0);
        transform: skew(0.79deg);
    }

    95% {
        clip: rect(98px, 9999px, 60px, 0);
        transform: skew(0.19deg);
    }

    100% {
        clip: rect(52px, 9999px, 2px, 0);
        transform: skew(0.53deg);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
        transform: skew(0.67deg);
    }

    5% {
        clip: rect(52px, 9999px, 74px, 0);
        transform: skew(0.29deg);
    }

    10% {
        clip: rect(79px, 9999px, 85px, 0);
        transform: skew(0.67deg);
    }

    15% {
        clip: rect(75px, 9999px, 5px, 0);
        transform: skew(0.18deg);
    }

    20% {
        clip: rect(67px, 9999px, 61px, 0);
        transform: skew(0.7deg);
    }

    25% {
        clip: rect(14px, 9999px, 79px, 0);
        transform: skew(0.24deg);
    }

    30% {
        clip: rect(1px, 9999px, 66px, 0);
        transform: skew(0.85deg);
    }

    35% {
        clip: rect(86px, 9999px, 30px, 0);
        transform: skew(0.66deg);
    }

    40% {
        clip: rect(23px, 9999px, 98px, 0);
        transform: skew(0.6deg);
    }

    45% {
        clip: rect(95px, 9999px, 62px, 0);
        transform: skew(0.12deg);
    }

    50% {
        clip: rect(48px, 9999px, 21px, 0);
        transform: skew(0.12deg);
    }

    55% {
        clip: rect(90px, 9999px, 7px, 0);
        transform: skew(0.7deg);
    }

    60% {
        clip: rect(61px, 9999px, 66px, 0);
        transform: skew(0.21deg);
    }

    65% {
        clip: rect(27px, 9999px, 89px, 0);
        transform: skew(0.68deg);
    }

    70% {
        clip: rect(86px, 9999px, 14px, 0);
        transform: skew(0.04deg);
    }

    75% {
        clip: rect(67px, 9999px, 60px, 0);
        transform: skew(0.89deg);
    }

    80% {
        clip: rect(29px, 9999px, 81px, 0);
        transform: skew(0.1deg);
    }

    85% {
        clip: rect(12px, 9999px, 20px, 0);
        transform: skew(0.96deg);
    }

    90% {
        clip: rect(7px, 9999px, 96px, 0);
        transform: skew(0.85deg);
    }

    95% {
        clip: rect(98px, 9999px, 55px, 0);
        transform: skew(0.4deg);
    }

    100% {
        clip: rect(10px, 9999px, 90px, 0);
        transform: skew(0.88deg);
    }
}

/* 5. Typing Effect Cursor */
.typing-cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* 6. Floating Shapes */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    z-index: 0;
    opacity: 0.4;
    animation: floating-shape 10s infinite ease-in-out;
}

.shape-1 {
    top: 20%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    animation-delay: 0s;
}

.shape-2 {
    bottom: 20%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    animation-delay: -5s;
}

.shape-3 {
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--success) 0%, transparent 70%);
    animation-delay: -2s;
    transform: translate(-50%, -50%);
}

@keyframes floating-shape {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* 7. Back To Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.6);
}

/* 8. Spotlight Effect */
.glass-card::after,
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.06),
            transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    border-radius: inherit;
}

.glass-card:hover::after,
.btn-primary:hover::after {
    opacity: 1;
}

/* 9. Particle Explosion */
.click-particle {
    position: fixed;
    border-radius: 50%;
    background: var(--primary-light);
    pointer-events: none;
    z-index: 9999;
}

/* 10. Hero Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 2rem;
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 10;
    text-decoration: none;
    transition: color 0.3s;
}

.scroll-indicator:hover {
    color: var(--primary);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}