/* Animation System for Portfolio Website */

/* ============================================
   KEYFRAMES
   ============================================ */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Fade Down */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade Left */
@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade Right */
@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Popup */
@keyframes popup {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Number Count Up */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Fade Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.fade-up {
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

.fade-down {
    opacity: 0;
    animation: fadeDown 0.6s ease forwards;
}

.fade-left {
    opacity: 0;
    animation: fadeLeft 0.6s ease forwards;
}

.fade-right {
    opacity: 0;
    animation: fadeRight 0.6s ease forwards;
}

/* Scale Animation */
.scale-in {
    opacity: 0;
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Popup Animation */
.popup {
    opacity: 0;
    animation: popup 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Slide Animations */
.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================
   ANIMATION DELAYS
   ============================================ */

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.btn-hover {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

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

.btn-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.btn-hover:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Button Underline Effect */
.btn-underline {
    position: relative;
    transition: color 0.3s ease;
}

.btn-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red, #FF0000);
    transition: width 0.3s ease;
}

.btn-underline:hover::after {
    width: 100%;
}

.btn-underline:hover {
    color: var(--red, #FF0000);
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Image Zoom on Hover */
.image-zoom {
    overflow: hidden;
}

.image-zoom img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* ============================================
   PARALLAX EFFECTS
   ============================================ */

.parallax {
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.parallax-slow {
    transition: transform 0.6s ease-out;
}

.parallax-fast {
    transition: transform 0.15s ease-out;
}

/* ============================================
   TEXT EFFECTS
   ============================================ */

/* Text Reveal */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: textReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Number Counter */
.counter {
    opacity: 0;
    animation: countUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.loading {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading.active {
    opacity: 1;
    pointer-events: all;
}

/* Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

/* ============================================
   PAGE TRANSITIONS
   ============================================ */

.page-transition {
    animation: fadeIn 0.4s ease;
}

/* ============================================
   SCROLL REVEAL (for JS)
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   HOVER GLOW EFFECT
   ============================================ */

.glow-on-hover {
    position: relative;
    transition: all 0.3s ease;
}

.glow-on-hover::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #ff0000, #ff6b6b, #ff0000);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(10px);
}

.glow-on-hover:hover::before {
    opacity: 0.7;
}

/* ============================================
   FORM ANIMATIONS
   ============================================ */

.input-focus {
    transition: all 0.3s ease;
}

.input-focus:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

/* Label Float */
.floating-label {
    position: relative;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    transform: translateY(-25px) scale(0.85);
    color: var(--red, #FF0000);
}

.floating-label label {
    position: absolute;
    top: 15px;
    left: 15px;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.no-animation {
    animation: none !important;
    transition: none !important;
}

.fast-animation {
    animation-duration: 0.3s !important;
}

.slow-animation {
    animation-duration: 1.2s !important;
}

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