/* Estilos modernos para o site Villaggio Panamby - 2023 */

/* Animações avançadas */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Efeitos modernos para lazy loading de imagens */
img[data-src], img[data-webp], div[data-bg], div[data-bg-webp] {
    opacity: 0;
    filter: blur(10px);
    transform: scale(0.95);
    transition: opacity 0.5s ease-in-out, filter 0.5s ease-in-out, transform 0.5s ease-in-out;
    will-change: opacity, filter, transform;
}

/* Aplicar efeito de fade-in quando a imagem carregar */
img.fade-in, div.fade-in {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

/* Efeito de pulsação para placeholder de imagens */
.image-placeholder {
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
    border-radius: 4px;
    overflow: hidden;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

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

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

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.4); }
    50% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(201, 162, 39, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

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

/* Efeitos de scroll modernos */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: opacity, transform;
}

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

.scroll-fade-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: opacity, transform;
}

.scroll-fade-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-fade-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: opacity, transform;
}

.scroll-fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: opacity, transform;
}

.scroll-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Estilos para links de navegação com efeitos modernos */
.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
    overflow: hidden;
}

.nav-link:hover {
    color: #007bff;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: linear-gradient(90deg, #0062cc, #007bff, #3395ff);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(-50%);
    opacity: 0;
}

.nav-link:hover::after {
    width: 100%;
    opacity: 1;
}

/* Efeito de clique para links */
.link-clicked {
    animation: link-pulse 0.3s ease-out;
}

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

/* Efeito de destaque para elemento alvo do scroll */
.scroll-target {
    animation: highlight-target 2s ease-out;
}

@keyframes highlight-target {
    0% { box-shadow: 0 0 0 rgba(0, 123, 255, 0); }
    20% { box-shadow: 0 0 20px rgba(0, 123, 255, 0.5); }
    100% { box-shadow: 0 0 0 rgba(0, 123, 255, 0); }
}

/* Estilos para contadores animados */
.counter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    border-radius: 8px;
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.counter-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #0062cc, #007bff, #3395ff);
    opacity: 0.8;
}

.counter-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #0062cc, #007bff, #3395ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    transition: all 0.3s ease;
    position: relative;
}

.counter-title {
    font-size: 1rem;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Efeito de conclusão do contador */
.counter-complete {
    animation: counter-pulse 0.5s ease-out;
}

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

/* Decoração para contadores */
.counter-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #007bff;
    opacity: 0.8;
}

/* Layout responsivo para contadores */
.counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .counter-number {
        font-size: 2rem;
    }
    
    .counter-title {
        font-size: 0.9rem;
    }
}

/* Navbar com efeito de scroll moderno */
#navbar {
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

#navbar.scrolled {
    @apply bg-white/90 backdrop-blur-md shadow-elegant;
    transform: translateY(0);
}

#navbar.scrolled .logo-img {
    @apply h-10;
    transition: height 0.3s ease;
}

/* Navbar hide/show animation */
.navbar-hidden {
    transform: translateY(-100%);
}

/* Barra de progresso de rolagem */
.scroll-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    width: 0%;
    transition: width 0.2s ease;
    z-index: 100;
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

/* Estilos para os indicadores de navegação */
.nav-item {
    position: relative;
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    transition: all 0.3s ease;
    opacity: 0;
}

.nav-item:hover + .nav-indicator,
.nav-item:focus + .nav-indicator {
    width: 100%;
    opacity: 1;
}

/* Estilo para item de navegação ativo */
.active-nav-item {
    color: var(--primary-600);
}

.active-nav-item + .nav-indicator {
    width: 100%;
    opacity: 1;
}

/* Estilos para os dropdowns */
.mobile-dropdown {
    overflow: hidden;
}

.mobile-dropdown-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}

.mobile-dropdown-content.hidden {
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
    padding-top: 0;
    padding-bottom: 0;
}

.mobile-dropdown-content:not(.hidden) {
    max-height: 500px;
    opacity: 1;
    transform: scaleY(1);
}

/* Mobile menu animations */
.mobile-menu {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.mobile-menu.menu-active {
    opacity: 1;
    transform: translateY(0);
    max-height: 100vh;
}

/* Active navigation link */
.nav-active {
    @apply text-primary font-semibold relative;
}

.nav-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, theme('colors.primary'), theme('colors.secondary'));
    transform: scaleX(1);
    transform-origin: left;
    transition: transform 0.3s ease;
}

/* Hamburger icon styling and animation */
.hamburger-line:nth-child(1) {
    transform: translateY(-6px);
    top: 50%;
    margin-top: -0.125rem;
}

.hamburger-line:nth-child(2) {
    top: 50%;
    margin-top: -0.125rem;
}

.hamburger-line:nth-child(3) {
    transform: translateY(6px);
    top: 50%;
    margin-top: -0.125rem;
}

.mobile-menu-button.is-active .hamburger-line:nth-child(1) {
    transform: translateY(0) rotate(45deg);
    top: 50%;
    margin-top: -0.125rem;
}

.mobile-menu-button.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-button.is-active .hamburger-line:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
    top: 50%;
    margin-top: -0.125rem;
}

/* Efeitos modernos para cards */
.card-hover {
    @apply shadow-card;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: transform, box-shadow;
}

.card-hover:hover {
    @apply shadow-xl;
    transform: translateY(-8px) scale(1.01);
}

/* WhatsApp button with modern effects */
.whatsapp-icon-wrapper {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-icon-wrapper.pulse {
    animation: pulse 1.5s infinite;
}

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

#whatsapp-button:hover .whatsapp-tooltip {
    opacity: 1;
}

#whatsapp-message.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Pulse effect animation */
.pulse-effect {
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Float animation */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Click effect */
.whatsapp-click-effect {
    animation: click-effect 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes click-effect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Bounce in animation */
.animate-bounce-in {
    animation: bounce-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    70% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Acordeão */
.accordion-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    text-align: left !important;
}

.accordion-header > div:first-child {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.accordion-header > div:last-child {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.accordion-header[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Melhorar alinhamento do texto "Ver detalhes" */
.accordion-header .text-sm.text-gray-500 {
    white-space: nowrap !important;
    margin-right: 0 !important;
    display: inline-block !important;
}

.accordion-header .w-8.h-8 {
    flex-shrink: 0 !important;
}

/* Responsividade para acordeão */
@media (max-width: 768px) {
    .accordion-header .text-sm.text-gray-500 {
        display: none !important;
    }
    
    .accordion-header {
        padding: 1rem !important;
    }
    
    .accordion-header > div:last-child {
        gap: 0 !important;
    }
}

/* Galeria modal com efeitos avançados */
.gallery-modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(0px);
}

.gallery-modal.modal-visible {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(5px);
}

.gallery-modal.modal-closing {
    opacity: 0;
    backdrop-filter: blur(0px);
}

.gallery-modal-content {
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.gallery-modal.modal-visible .gallery-modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Animações de transição de imagens */
.image-transitioning {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.caption-transitioning {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Animações de slide */
.slide-left-out {
    transform: translateX(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.slide-left-in {
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.slide-right-out {
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.slide-right-in {
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Efeito de zoom */
.zoomed {
    transform: scale(2);
    cursor: zoom-out;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Efeito de ripple */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* Efeito de parallax para seções de fundo */
.bg-parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

.bg-parallax::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.4));
    z-index: 1;
}

.bg-parallax > * {
    position: relative;
    z-index: 2;
}

/* Estilos modernos para formulários */
input, textarea, select {
    @apply bg-white/80 backdrop-blur-sm border-0 rounded-lg shadow-inner transition-all duration-300;
}

input:focus, textarea:focus, select:focus {
    @apply outline-none ring-2 ring-primary/50 bg-white shadow-inner transform scale-[1.02];
}

/* Estilos para botões modernos */
.btn-modern {
    @apply relative overflow-hidden transition-all duration-500 shadow-md hover:shadow-xl;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 0.4s ease, background-color 0.4s ease;
}

.btn-modern:hover {
    transform: translateY(-3px);
}

.btn-hover-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0));
    background-size: 200% 100%;
    border-radius: 50px;
    transform: translateX(-100%);
    transition: transform 0.8s ease;
}

.btn-modern:hover .btn-hover-effect {
    transform: translateX(100%);
}

/* Estilos modernos para imagens */
.image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transition: transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 0.5s ease;
}

.image-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.image-wrapper img {
    transition: transform 0.7s cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: scale(1.01);
}

.image-wrapper:hover img {
    transform: scale(1.08);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2), transparent);
    padding: 2rem 1.5rem 1.5rem;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.image-wrapper:hover .image-overlay {
    opacity: 1;
    transform: translateY(0);
}

.image-overlay h3 {
    @apply text-white font-bold mb-2 text-xl;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transform: translateY(10px);
    transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
    transition-delay: 0.1s;
}

.image-wrapper:hover .image-overlay h3 {
    transform: translateY(0);
}

.image-overlay p {
    @apply text-white/90 text-sm;
    transform: translateY(10px);
    transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
    transition-delay: 0.2s;
}

.image-wrapper:hover .image-overlay p {
    transform: translateY(0);
}

/* Estilos modernos para o rodapé */
footer {
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(201, 162, 39, 0.5), transparent);
}

footer a {
    position: relative;
    transition: all 0.3s ease;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

footer a:hover {
    @apply text-primary;
}

footer a:hover::after {
    width: 100%;
}

/* Responsividade moderna */
@media (max-width: 1024px) {
    .container {
        @apply px-6;
    }
    
    h1 {
        @apply text-4xl;
    }
    
    h2 {
        @apply text-3xl;
    }
    
    /* Ajustes para menus em tablets */
    .mobile-dropdown-content {
        padding-left: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        @apply px-4;
    }
    
    h1 {
        @apply text-3xl;
    }
    
    h2 {
        @apply text-2xl;
    }
    
    .whatsapp-tooltip {
        display: none;
    }
    
    .bg-parallax {
        background-attachment: scroll;
    }
    
    /* Melhorias para menu mobile */
    #mobile-menu {
        margin-top: 1rem;
        padding: 1rem;
    }
    
    .mobile-dropdown-toggle {
        padding: 0.75rem 0;
        font-size: 1rem;
    }
    
    .mobile-dropdown-content {
        padding-left: 1.5rem;
        margin-top: 0.5rem;
    }
    
    .mobile-dropdown-content a {
        padding: 0.5rem 0;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    h1 {
        @apply text-2xl;
    }
    
    h2 {
        @apply text-xl;
    }
    
    .btn-modern {
        @apply px-4 py-2 text-sm;
    }
    
    /* Ajustes específicos para telas pequenas */
    #mobile-menu {
        margin-top: 0.75rem;
        padding: 0.75rem;
    }
    
    .mobile-dropdown-toggle {
        padding: 0.5rem 0;
        font-size: 0.9rem;
    }
    
    .mobile-dropdown-toggle .bg-primary-50 {
        padding: 0.375rem;
    }
    
    .mobile-dropdown-content {
        padding-left: 1rem;
    }
    
    .mobile-dropdown-content a {
        padding: 0.375rem 0;
        font-size: 0.85rem;
    }
    
    /* Melhorar espaçamento do botão hamburger */
    .mobile-menu-button {
        padding: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .hamburger-line {
        width: 1.25rem;
    }
}