@import url('https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css');

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceInDown {
    0%, 60%, 75%, 90%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: translate3d(0, -3000px, 0);
    }
    60% {
        opacity: 1;
        transform: translate3d(0, 25px, 0);
    }
    75% {
        transform: translate3d(0, -10px, 0);
    }
    90% {
        transform: translate3d(0, 5px, 0);
    }
    100% {
        transform: none;
    }
}

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

/* Animation Classes */
.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animated.delay-1s {
    animation-delay: 1s;
}

.animated.delay-2s {
    animation-delay: 2s;
}

.animated.delay-3s {
    animation-delay: 3s;
}

.animated.slow {
    animation-duration: 2s;
}

.animated.slower {
    animation-duration: 3s;
}

.animated.fast {
    animation-duration: 0.5s;
}

.animated.faster {
    animation-duration: 0.3s;
}

.fadeIn {
    animation-name: fadeIn;
}

.fadeInDown {
    animation-name: fadeInDown;
    animation-duration: 1s;
    animation-fill-mode: both;
}

.fadeInUp {
    animation-name: fadeInUp;
}

.fadeInLeft {
    animation-name: fadeInLeft;
}

.fadeInRight {
    animation-name: fadeInRight;
}

.zoomIn {
    animation-name: zoomIn;
}

.bounceInDown {
    animation-name: bounceInDown;
}

.pulse {
    animation-name: pulse;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

.slideInLeft {
    animation-name: slideInLeft;
}

.slideInRight {
    animation-name: slideInRight;
}

.rotateIn {
    animation-name: rotateIn;
}

.flipInY {
    animation-name: flipInY;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
}

/* Hover Effects */
.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.3s ease;
}

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

.hover-float {
    transition: transform 0.3s ease;
}

.hover-float:hover {
    transform: translateY(-5px);
}

/* Loading Animation */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Particle Effects */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0.5;
    }
}

/* Text Effects */
.text-glow {
    text-shadow: 0 0 10px rgba(0, 123, 255, 0.8);
}

.text-wave {
    animation: wave 2s ease-in-out infinite;
}

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

/* Button Effects */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-animated:hover::before {
    left: 100%;
}

/* Mobile specific animations */
@media (max-width: 768px) {
    .fadeInDown {
        animation-duration: 0.8s;
    }
    
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 576px) {
    .fadeInDown {
        animation-duration: 0.6s;
    }
    
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ====== ENHANCED SECTION ANIMATIONS ====== */

/* About Section Animations */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bounceInScale {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes textRevealLeft {
    0% {
        transform: translateX(-50px);
        opacity: 0;
        filter: blur(5px);
    }
    100% {
        transform: translateX(0);
        opacity: 1;
        filter: blur(0);
    }
}

/* Gallery Section Animations */
@keyframes galleryItemReveal {
    0% {
        transform: translateY(80px) scale(0.8);
        opacity: 0;
        filter: blur(5px);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes galleryItemHover {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    100% {
        transform: translateY(-15px) scale(1.05);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    }
}

@keyframes shimmerEffect {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

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

@keyframes floatingElements {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(2deg);
    }
    66% {
        transform: translateY(5px) rotate(-2deg);
    }
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(0, 123, 255, 0.5),
                     0 0 10px rgba(0, 123, 255, 0.3),
                     0 0 15px rgba(0, 123, 255, 0.2);
    }
    50% {
        text-shadow: 0 0 10px rgba(0, 123, 255, 0.8),
                     0 0 20px rgba(0, 123, 255, 0.6),
                     0 0 30px rgba(0, 123, 255, 0.4);
    }
}

/* Enhanced Animation Classes */
.animate-slide-left {
    animation: slideInFromLeft 1s ease-out forwards;
}

.animate-slide-right {
    animation: slideInFromRight 1s ease-out forwards;
}

.animate-bounce-scale {
    animation: bounceInScale 0.8s ease-out forwards;
}

.animate-text-reveal {
    animation: textRevealLeft 1s ease-out forwards;
}

.animate-gallery-item {
    animation: galleryItemReveal 0.8s ease-out forwards;
}

.animate-title-glow {
    animation: titleGlow 2.5s ease-in-out infinite;
}

.animate-floating {
    animation: floatingElements 6s ease-in-out infinite;
}

/* Section Background Animations */
#about {
    background: linear-gradient(-45deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(248, 249, 250, 0.98), 
        rgba(255, 255, 255, 0.95), 
        rgba(240, 242, 247, 0.98));
    background-size: 400% 400%;
    animation: backgroundWave 12s ease infinite;
    position: relative;
    overflow: hidden;
}

#about::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.08), transparent);
    animation: shimmerEffect 4s infinite;
    z-index: 1;
}

#about .container {
    position: relative;
    z-index: 2;
}

#gallery {
    background: linear-gradient(-45deg, 
        rgba(248, 249, 250, 0.95), 
        rgba(255, 255, 255, 0.98), 
        rgba(248, 249, 250, 0.95), 
        rgba(245, 247, 250, 0.98));
    background-size: 400% 400%;
    animation: backgroundWave 15s ease infinite;
    position: relative;
    overflow: hidden;
}

#gallery::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.08), transparent);
    animation: shimmerEffect 5s infinite reverse;
    z-index: 1;
}

#gallery .container-fluid {
    position: relative;
    z-index: 2;
}

/* Enhanced Gallery Item Effects */
.gallery-item {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 3;
}

.gallery-item:hover::before {
    transform: translateX(100%);
}

.gallery-item:hover {
    animation: galleryItemHover 0.4s ease-out forwards;
}

.gallery-item img {
    transition: all 0.4s ease;
    filter: brightness(0.95) contrast(1.1);
}

.gallery-item:hover img {
    filter: brightness(1.1) contrast(1.2) saturate(1.15);
    transform: scale(1.08);
}

/* Scroll Animation Setup */
.scroll-animate {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Staggered Gallery Animation Delays */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }
.gallery-item:nth-child(9) { animation-delay: 0.9s; }
.gallery-item:nth-child(10) { animation-delay: 1.0s; }
.gallery-item:nth-child(11) { animation-delay: 1.1s; }
.gallery-item:nth-child(12) { animation-delay: 1.2s; }

/* About Section Text Animations */
#about h2 {
    animation: fadeInLeft 1s ease-out 0.2s both;
}

#about p {
    animation: textRevealLeft 1s ease-out 0.4s both;
}

#about img {
    animation: slideInFromRight 1s ease-out 0.6s both;
}

/* Gallery Title Animation */
#gallery h2 {
    animation: bounceInScale 1s ease-out 0.2s both;
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    .animate-slide-left,
    .animate-slide-right {
        animation: fadeInUp 0.8s ease-out forwards;
    }
    
    .gallery-item:hover {
        animation: none;
        transform: translateY(-8px) scale(1.02);
    }
    
    #about::before,
    #gallery::before {
        display: none;
    }
}

@media (max-width: 576px) {
    .gallery-item:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .animate-gallery-item {
        animation-duration: 0.6s;
    }
}