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

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #db2777;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #be185d;
}

/* Selection Color */
::selection {
    background: #fbcfe8;
    color: #831843;
}

/* Image Hover Effects */
.portfolio-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    box-shadow: inset 0 0 0 2px transparent;
    transition: box-shadow 0.3s ease;
    pointer-events: none;
}

.portfolio-item:hover::after {
    box-shadow: inset 0 0 0 2px #db2777;
}

/* Form Focus Effects */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.1);
}

/* Button Ripple Effect */
button {
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .5s, opacity 1s;
}

button:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Navigation Transition */
#navbar {
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

/* Loading Animation for Images */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading] {
    opacity: 0;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 400px;
    opacity: 1;
}

/* Testimonial Card Hover */
#testimonial-track > div > div {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#testimonial-track > div > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Instagram Grid Hover Enhancement */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* Service Card Icon Animation */
.group:hover .group-hover\:bg-white\/20 {
    animation: pulse 2s infinite;
}

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

/* Lightbox Transition */
#lightbox {
    transition: opacity 0.3s ease;
}

#lightbox.hidden {
    opacity: 0;
    pointer-events: none;
}

#lightbox:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Filter Button Active State */
.filter-btn.active {
    background-color: #db2777;
    color: white;
}

/* Responsive Typography Adjustments */
@media (max-width: 640px) {
    .font-serif {
        letter-spacing: -0.02em;
    }
}

/* Print Styles */
@media print {
    #navbar, #contacto, footer {
        display: none;
    }
    
    section {
        page-break-inside: avoid;
    }
}