/* Custom Animations */

/* Fade In Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Floating Animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Glowing Text Effect */
.glow-text {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px var(--primary-color),
                     0 0 10px var(--primary-color),
                     0 0 15px var(--primary-color);
    }
    to {
        text-shadow: 0 0 10px var(--primary-color),
                     0 0 20px var(--primary-color),
                     0 0 30px var(--primary-color);
    }
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 255, 255, 0.2);
}

/* Loading Animations */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Gradient Background Animation */
.gradient-bg {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid var(--primary-color);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

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

/* Particle Animation */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: particle-float 20s linear infinite;
    opacity: 0.6;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Skill Bar Animation */
.skill-bar-animated {
    position: relative;
    overflow: hidden;
}

.skill-bar-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skill-shimmer 2s infinite;
}

@keyframes skill-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

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

.btn-ripple:hover::before {
    width: 300px;
    height: 300px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Custom Selection */
::selection {
    background: var(--primary-color);
    color: var(--bg-primary);
}

::-moz-selection {
    background: var(--primary-color);
    color: var(--bg-primary);
}

/* Loading Screen Animations */
.loading-screen-fade {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-screen-fade.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Navbar Slide Animation */
.navbar-slide {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.navbar-slide.visible {
    transform: translateY(0);
}

/* Hero Content Animation */
.hero-content-animated {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease;
}

.hero-content-animated.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Timeline Item Animation */
.timeline-item-animated {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.timeline-item-animated.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item-animated:nth-child(even) {
    transform: translateX(50px);
}

.timeline-item-animated:nth-child(even).visible {
    transform: translateX(0);
}

/* Testimonial Transition */
.testimonial-slide-in {
    transform: translateX(100%);
    transition: transform 0.5s ease;
}

.testimonial-slide-in.active {
    transform: translateX(0);
}

.testimonial-slide-out {
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

/* Contact Form Animation */
.form-focus-animation {
    position: relative;
}

.form-focus-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.form-focus-animation:focus-within::before {
    opacity: 1;
    transform: scale(1);
}

/* Number Counter Animation */
.counter-animated {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.counter-animated.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom Keyframes for Complex Animations */
@keyframes matrix-rain {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-rain {
    animation: matrix-rain 10s linear infinite;
}

/* Holographic Effect */
.holographic {
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: holographic-shine 3s ease-in-out infinite;
}

@keyframes holographic-shine {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: var(--text-primary);
}

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

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: var(--primary-color);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: var(--secondary-color);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
    }
    15%, 49% {
        transform: translate(-2px, 0);
    }
    50%, 99% {
        transform: translate(2px, 0);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 100% {
        transform: translate(0);
    }
    21%, 62% {
        transform: translate(2px, 0);
    }
    63%, 100% {
        transform: translate(-2px, 0);
    }
}
