/* ============================================
   Animation Styles
   Scroll-triggered animations and transitions
   ============================================ */

/* ============================================
   Fade In Animation
   ============================================ */

.fade-in {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.animate-in {
    opacity: 1;
}

/* ============================================
   Slide Up Animation
   ============================================ */

.slide-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-up.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Slide Left Animation
   ============================================ */

.slide-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   Slide Right Animation
   ============================================ */

.slide-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   Stagger Animation Delays
   ============================================ */

.stagger-50 {
    transition-delay: 0.05s;
}

.stagger-100 {
    transition-delay: 0.1s;
}

.stagger-150 {
    transition-delay: 0.15s;
}

.stagger-200 {
    transition-delay: 0.2s;
}

.stagger-250 {
    transition-delay: 0.25s;
}

.stagger-300 {
    transition-delay: 0.3s;
}

.stagger-350 {
    transition-delay: 0.35s;
}

.stagger-400 {
    transition-delay: 0.4s;
}

.stagger-450 {
    transition-delay: 0.45s;
}

.stagger-500 {
    transition-delay: 0.5s;
}

/* ============================================
   Stagger Children Container
   ============================================ */

.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.animate-in > *:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.stagger-children.animate-in > *:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.stagger-children.animate-in > *:nth-child(3) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.stagger-children.animate-in > *:nth-child(4) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.stagger-children.animate-in > *:nth-child(5) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

.stagger-children.animate-in > *:nth-child(6) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

.stagger-children.animate-in > *:nth-child(7) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
}

.stagger-children.animate-in > *:nth-child(8) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.8s;
}

/* ============================================
   Terminal Cursor Blink
   ============================================ */

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.terminal-cursor::after {
    content: '█';
    animation: blink 1s infinite;
    margin-left: 2px;
    color: #00ff9f;
}

/* ============================================
   Typing Animation
   ============================================ */

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

.typing-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #00ff9f;
    animation: typing 3s steps(40, end),
               blink 0.75s step-end infinite;
}

/* ============================================
   Fade In Animations (for modal/overlay)
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Scale Animation
   ============================================ */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Pulse Animation (for emphasis)
   ============================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   Glow Pulse Animation
   ============================================ */

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 159, 0.5),
                    0 0 20px rgba(0, 255, 159, 0.3),
                    0 0 30px rgba(0, 255, 159, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 159, 0.7),
                    0 0 30px rgba(0, 255, 159, 0.5),
                    0 0 40px rgba(0, 255, 159, 0.3);
    }
}

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

/* ============================================
   Floating Animation
   ============================================ */

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

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

/* ============================================
   Skill Bar Animation
   ============================================ */

.skill-bar {
    width: 0%;
    transition: width 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.skill-bar.animate {
    width: var(--skill-width, 0%);
}

/* Shimmer effect for skill bars */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

.animate-shimmer {
    animation: shimmer 2s ease-in-out infinite;
}

/* ============================================
   Timeline Dot Pulse
   ============================================ */

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 255, 159, 0.5);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(0, 255, 159, 0.8);
    }
}

.timeline-dot {
    animation: dotPulse 2s ease-in-out infinite;
}

/* ============================================
   Hover Glow Effect
   ============================================ */

.hover-glow {
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(0, 255, 159, 0.6),
                0 0 25px rgba(0, 255, 159, 0.4),
                0 0 35px rgba(0, 255, 159, 0.2);
}

/* ============================================
   Text Reveal Animation
   ============================================ */

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-reveal {
    animation: textReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================
   Loading Spinner (if needed)
   ============================================ */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* ============================================
   Reduced Motion Preferences
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .terminal-cursor::after {
        animation: none;
    }

    .fade-in,
    .slide-up,
    .slide-left,
    .slide-right {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Mobile Optimizations
   ============================================ */

@media (max-width: 768px) {
    .slide-up,
    .slide-left,
    .slide-right {
        transform: translateY(20px);
    }

    .slide-up.animate-in,
    .slide-left.animate-in,
    .slide-right.animate-in {
        transform: translateY(0);
    }

    /* Reduce animation durations on mobile */
    .fade-in,
    .slide-up,
    .slide-left,
    .slide-right {
        transition-duration: 0.5s;
    }
}
