/* ===== Glitch Effect ===== */
.glitch {
    position: relative;
}

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

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    color: var(--accent-color);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    color: var(--accent-secondary);
    z-index: -2;
}

@keyframes glitch-1 {
    0% {
        clip-path: inset(20% 0 60% 0);
        transform: translate(-2px, 2px);
    }
    20% {
        clip-path: inset(10% 0 70% 0);
        transform: translate(2px, -2px);
    }
    40% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(-2px, 2px);
    }
    60% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(2px, -2px);
    }
    80% {
        clip-path: inset(30% 0 50% 0);
        transform: translate(-2px, 2px);
    }
    100% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {
    0% {
        clip-path: inset(60% 0 20% 0);
        transform: translate(2px, -2px);
    }
    20% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(-2px, 2px);
    }
    40% {
        clip-path: inset(30% 0 50% 0);
        transform: translate(2px, -2px);
    }
    60% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(-2px, 2px);
    }
    80% {
        clip-path: inset(10% 0 70% 0);
        transform: translate(2px, -2px);
    }
    100% {
        clip-path: inset(5% 0 80% 0);
        transform: translate(-2px, 2px);
    }
}

/* ===== Pulse Glow Animation ===== */
@keyframes pulse-glow {
    0%, 100% {
        text-shadow:
            0 0 10px var(--accent-color),
            0 0 20px var(--accent-color),
            0 0 40px var(--accent-color);
    }
    50% {
        text-shadow:
            0 0 20px var(--accent-color),
            0 0 40px var(--accent-color),
            0 0 80px var(--accent-color),
            0 0 100px var(--accent-color);
    }
}

/* ===== Neon Border Animation ===== */
@keyframes neon-border {
    0%, 100% {
        box-shadow:
            0 0 5px var(--accent-color),
            0 0 10px var(--accent-color),
            inset 0 0 5px rgba(0, 212, 255, 0.1);
    }
    50% {
        box-shadow:
            0 0 10px var(--accent-color),
            0 0 20px var(--accent-color),
            0 0 30px var(--accent-color),
            inset 0 0 10px rgba(0, 212, 255, 0.2);
    }
}

/* ===== Fade In Up Animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ===== Staggered Animation Delays ===== */
.box-card:nth-child(1) { animation-delay: 0.1s; }
.box-card:nth-child(2) { animation-delay: 0.2s; }
.box-card:nth-child(3) { animation-delay: 0.3s; }
.box-card:nth-child(4) { animation-delay: 0.4s; }
.box-card:nth-child(5) { animation-delay: 0.5s; }
.box-card:nth-child(6) { animation-delay: 0.6s; }

/* ===== Shimmer Effect ===== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== Rotating Border Animation ===== */
@keyframes rotate-border {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.rotating-border {
    position: relative;
}

.rotating-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: conic-gradient(
        var(--accent-color),
        var(--accent-secondary),
        var(--accent-tertiary),
        var(--accent-color)
    );
    border-radius: inherit;
    z-index: -1;
    animation: rotate-border 4s linear infinite;
}

/* ===== Typing Animation ===== */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-color); }
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--accent-color);
    white-space: nowrap;
    animation:
        typing 2s steps(30) forwards,
        blink-caret 0.75s step-end infinite;
}

/* ===== Loading Spinner ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== Hover Lift Effect ===== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 212, 255, 0.1);
}

/* ===== Scale In Animation ===== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* ===== Slide In Animation ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease forwards;
}

/* ===== Background Gradient Animation ===== */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(
        -45deg,
        var(--bg-primary),
        var(--bg-secondary),
        var(--bg-tertiary),
        var(--bg-secondary)
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}
