/* ==================== ANIMATED GRADIENT BACKGROUND ==================== */

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float-orb 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(113, 58, 190, 0.4) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(162, 89, 255, 0.3) 0%, transparent 70%);
    top: 50%;
    right: -10%;
    animation-delay: 7s;
}

.orb-3 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(113, 58, 190, 0.2) 0%, transparent 70%);
    bottom: -20%;
    left: 30%;
    animation-delay: 14s;
}

@keyframes float-orb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* ==================== MAGNETIC BUTTON EFFECT ==================== */

.button-magnetic {
    transition: transform 0.2s ease-out;
    position: relative;
}

.button-magnetic::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: inherit;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.button-magnetic:hover::before {
    transform: translate(-50%, -50%) scale(1.5);
}

/* ==================== ENHANCED SCROLL ANIMATIONS ==================== */

/* Fade in from bottom */
.reveal-bottom {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-bottom.active {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in from left */
.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in from right */
.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up */
.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* ==================== ENHANCED GLASSMORPHISM ==================== */

.glass-enhanced {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

body.dark-theme .glass-enhanced {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* ==================== PARTICLE CURSOR TRAIL ==================== */

.cursor-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--first-color);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: particle-fade 0.8s ease-out forwards;
}

@keyframes particle-fade {
    0% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
}

/* ==================== SMOOTH SCROLL OFFSET ==================== */

html {
    scroll-padding-top: 5rem;
    /* Offset for fixed header */
}

/* ==================== LOADING ANIMATION ==================== */

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--body-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    animation: pulse-logo 1.5s ease-in-out infinite;
}

@keyframes pulse-logo {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.loader-text {
    font-size: var(--h3-font-size);
    background: var(--gradient-text);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: var(--font-semi-bold);
}

/* ==================== ENHANCED BUTTON EFFECTS ==================== */

.button {
    position: relative;
    overflow: hidden;
}

.button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:active::after {
    width: 300px;
    height: 300px;
}

/* ==================== STAGGERED CHILDREN ANIMATION ==================== */

.stagger-children>* {
    opacity: 0;
    transform: translateY(20px);
    animation: stagger-fade-in 0.6s ease forwards;
}

.stagger-children>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-children>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-children>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-children>*:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-children>*:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-children>*:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes stagger-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */

@media screen and (max-width: 768px) {
    .gradient-orb {
        filter: blur(60px);
    }

    .orb-1,
    .orb-2,
    .orb-3 {
        width: 300px;
        height: 300px;
    }
}