/* ===== ADVANCED ANIMATIONS ===== */

/* Hexagon Floating Animation */
@keyframes hexFloat {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    25% {
        transform: translateY(-15px) rotate(90deg) scale(1.05);
        opacity: 1;
    }
    50% {
        transform: translateY(-25px) rotate(180deg) scale(1.1);
        opacity: 0.9;
    }
    75% {
        transform: translateY(-15px) rotate(270deg) scale(1.05);
        opacity: 1;
    }
}

/* Pulse Animation for Interactive Elements */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Glow Effect Animation */
@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6),
            0 0 60px rgba(236, 72, 153, 0.3);
    }
}

/* Digital Media Glow Animation */
@keyframes mediaGlow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    }
    33% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6),
            0 0 60px rgba(6, 182, 212, 0.3);
    }
    66% {
        box-shadow: 0 0 40px rgba(236, 72, 153, 0.6),
            0 0 60px rgba(0, 255, 136, 0.3);
    }
}

/* Slide In Animations */
@keyframes slideInLeft {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Rotate In Animation */
@keyframes rotateIn {
    0% {
        transform: rotate(-180deg) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

/* Background Pattern Movement */
@keyframes patternFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -20px) rotate(90deg);
    }
    50% {
        transform: translate(40px, 0px) rotate(180deg);
    }
    75% {
        transform: translate(20px, 20px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Text Typing Animation */
@keyframes typing {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

@keyframes blinkCursor {
    0%,
    50% {
        border-color: transparent;
    }
    51%,
    100% {
        border-color: var(--primary-cyan);
    }
}

/* Digital Media Loading Animation */
@keyframes mediaSpin {
    0% {
        transform: rotate(0deg) scale(1);
        border-color: var(--primary-purple);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
        border-color: var(--primary-cyan);
        box-shadow: 0 0 30px rgba(6, 182, 212, 0.5);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        border-color: var(--primary-pink);
        box-shadow: 0 0 40px rgba(236, 72, 153, 0.7);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
        border-color: var(--neon-green);
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
    }
    100% {
        transform: rotate(360deg) scale(1);
        border-color: var(--primary-purple);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
}

/* ===== ANIMATION CLASSES ===== */

/* Entrance Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.8s ease-out forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.8s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-rotate-in {
    animation: rotateIn 0.8s ease-out forwards;
}

/* Continuous Animations */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

.animate-media-glow {
    animation: mediaGlow 4s ease-in-out infinite;
}

.animate-float {
    animation: hexFloat 6s ease-in-out infinite;
}

.animate-pattern-float {
    animation: patternFloat 20s linear infinite;
}

.animate-media-spin {
    animation: mediaSpin 2s linear infinite;
}

/* ===== HOVER ANIMATIONS ===== */
.hover-lift {
    transition: transform var(--transition-normal),
        box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.hover-scale {
    transition: transform var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.hover-media-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-media-glow:hover {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4),
        0 0 60px rgba(236, 72, 153, 0.2);
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate-scale.animate {
    opacity: 1;
    transform: scale(1);
}

/* ===== LOADING ANIMATIONS ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(139, 92, 246, 0.3);
    border-top: 4px solid var(--primary-purple);
    border-radius: 50%;
    animation: mediaSpin 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-purple);
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
    background: var(--primary-purple);
}
.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
    background: var(--primary-cyan);
}
.loading-dots span:nth-child(3) {
    animation-delay: 0s;
    background: var(--primary-pink);
}

/* ===== BUTTON ANIMATIONS ===== */
.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-animate:hover::before {
    left: 100%;
}

.btn-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.btn-glow {
    transition: box-shadow var(--transition-normal);
}

.btn-glow:hover {
    box-shadow: var(--shadow-glow);
}

.btn-media-glow {
    transition: box-shadow var(--transition-normal);
}

.btn-media-glow:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5),
        0 0 40px rgba(6, 182, 212, 0.3);
}

/* ===== NAVBAR ANIMATIONS ===== */
.navbar-slide-down {
    transform: translateY(-100%);
    animation: slideInDown 0.5s ease-out forwards;
}

.nav-link-animate {
    position: relative;
    overflow: hidden;
}

.nav-link-animate::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transition: left var(--transition-normal);
}

.nav-link-animate:hover::after {
    left: 0;
}

/* ===== HERO ANIMATIONS ===== */
.hero-title-animate .title-line {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInLeft 0.8s ease-out forwards;
}

.hero-title-animate .title-line:nth-child(1) {
    animation-delay: 0.2s;
}
.hero-title-animate .title-line:nth-child(2) {
    animation-delay: 0.4s;
}
.hero-title-animate .title-line:nth-child(3) {
    animation-delay: 0.6s;
}

.hero-subtitle-animate {
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.8s ease-out 0.8s forwards;
}

.hero-buttons-animate {
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.8s ease-out 1s forwards;
}

/* ===== FORM ANIMATIONS ===== */
.form-group-animate {
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.6s ease-out forwards;
}

.form-group-animate:nth-child(1) {
    animation-delay: 0.1s;
}
.form-group-animate:nth-child(2) {
    animation-delay: 0.2s;
}
.form-group-animate:nth-child(3) {
    animation-delay: 0.3s;
}
.form-group-animate:nth-child(4) {
    animation-delay: 0.4s;
}
.form-group-animate:nth-child(5) {
    animation-delay: 0.5s;
}

.input-focus-animate {
    transition: all var(--transition-normal);
}

.input-focus-animate:focus {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-float,
    .animate-pulse,
    .animate-glow,
    .animate-pattern-float,
    .animate-media-spin {
        animation: none;
    }
}
