/* Kashmir Junction - Animations & Visual Effects */

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

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

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

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

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Animation Classes */
.animate-fade-up {
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-up {
    opacity: 0;
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-right {
    opacity: 0;
    animation: slideRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.animate-float {
    opacity: 0;
    animation: float 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.animate-rotate-in {
    opacity: 0;
    animation: rotateIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-900 { animation-delay: 900ms; }
.delay-1000 { animation-delay: 1000ms; }

/* Scroll-triggered Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-rotate {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Loading Animations */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

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

.bounce-animation {
    animation: bounce 1s infinite;
}

/* Gradient Animations */
.gradient-shift {
    background: linear-gradient(-45deg, var(--primary-color), var(--success-color), var(--secondary-color), var(--accent-color));
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

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

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

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

.image-blur:hover {
    filter: blur(2px);
    transition: filter 0.3s ease;
}

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

.btn-ripple::after {
    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.3s, height 0.3s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Text Animations */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s 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); }
}

.fade-in-words {
    opacity: 0;
    animation: fadeInWords 0.8s ease-in-out forwards;
}

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

/* Card Flip Animation */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    transition: transform 0.6s;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Parallax Effect */
.parallax {
    position: relative;
    overflow: hidden;
}

.parallax::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: inherit;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    z-index: -1;
    transform: translateZ(0);
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 100ms; }
.stagger-item:nth-child(3) { animation-delay: 200ms; }
.stagger-item:nth-child(4) { animation-delay: 300ms; }
.stagger-item:nth-child(5) { animation-delay: 400ms; }
.stagger-item:nth-child(6) { animation-delay: 500ms; }

/* Morphing Animations */
.morph {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.morph:hover {
    border-radius: 50px;
    transform: rotate(360deg) scale(1.1);
}

/* Progress Bar Animation */
.progress-bar {
    position: relative;
    background: var(--bg-light);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transform-origin: left;
    animation: progressFill 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes progressFill {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* Counter Animation */
.counter {
    font-weight: bold;
    color: var(--primary-color);
}

.counter[data-target]::after {
    content: '+';
    opacity: 0.7;
}

/* Floating Elements */
.float-element {
    animation: floatUpDown 6s ease-in-out infinite;
}

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

/* Reveal Animations */
.reveal-up {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%);
    animation: revealUp 1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes revealUp {
    to { clip-path: polygon(0 100%, 100% 100%, 100% 0%, 0% 0%); }
}

.reveal-right {
    clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    animation: revealRight 1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes revealRight {
    to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%); }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Intersection Observer Helpers */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Responsive Animations */
@media (max-width: 768px) {
    .animate-fade-up,
    .animate-slide-up,
    .animate-slide-right,
    .animate-slide-left,
    .animate-float,
    .animate-scale-in,
    .animate-rotate-in {
        animation-duration: 0.6s;
    }
    
    .stagger-item {
        animation-duration: 0.4s;
    }
    
    .hover-lift:hover {
        transform: translateY(-4px);
    }
}

/* Reduced Motion Support */
@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;
    }
}