/* Modern Image Effects - 3D and Hover Animations */

.modern-image-container {
    position: relative;
    perspective: 1000px;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Fazer o container se ajustar ao conteúdo */
    display: inline-block;
    width: auto;
    max-width: 100%;
    /* Padding uniforme em todos os lados */
    padding: 25px;
    /* Centralizar o container */
    margin: 0 auto;
}

.modern-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.modern-image-container:hover::before {
    opacity: 1;
}

.modern-image-container .modern-image {
    /* Ajustar para proporção 1:1 (800x800) sem cortar */
    width: 230px !important;
    height: 230px !important;
    max-width: 230px !important;
    object-fit: contain;
    background-color: #f8f9fa;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    border-radius: 15px;
    display: block;
}

/* Hover Effects */
.modern-image-container:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

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

/* 3D Tilt Effect on Different Containers */
.modern-image-container:nth-child(1):hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(-5deg);
}

.modern-image-container:nth-child(2):hover {
    transform: translateY(-10px) rotateX(-5deg) rotateY(5deg);
}

.modern-image-container:nth-child(3):hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
}

/* Glow Effect */
.modern-image-container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 400% 400%;
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientShift 3s ease infinite;
}

.modern-image-container:hover::after {
    opacity: 0.7;
}

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

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

.modern-image-container {
    animation: float 6s ease-in-out infinite;
}

.modern-image-container:nth-child(2) {
    animation-delay: -2s;
}

.modern-image-container:nth-child(3) {
    animation-delay: -4s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modern-image-container {
        padding: 15px;
    }
    
    .modern-image-container .modern-image {
        width: 240px !important;
        height: 240px !important;
        max-width: 240px !important;
    }
}
    
    .modern-image-container:hover {
        transform: translateY(-5px) rotateX(2deg) rotateY(2deg);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    }
    
    .modern-image-container:hover .modern-image {
        transform: scale(1.02);
    }
}

@media (max-width: 480px) {
    .modern-image-container {
        padding: 10px;
    }
    
    .modern-image-container .modern-image {
        width: 200px !important;
        height: 200px !important;
        max-width: 200px !important;
    }
}

/* Loading animation */
.modern-image {
    opacity: 0;
    animation: fadeInScale 0.8s ease-out forwards;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered animation delays */
.modern-image-container:nth-child(1) .modern-image {
    animation-delay: 0.1s;
}

.modern-image-container:nth-child(2) .modern-image {
    animation-delay: 0.3s;
}

.modern-image-container:nth-child(3) .modern-image {
    animation-delay: 0.5s;
}