/* Reset and Base Styles */
* {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Custom CTA Button Animations */
.cta-button {
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button-final {
    position: relative;
    overflow: hidden;
    animation: pulse-gold 3s infinite;
}

@keyframes pulse-gold {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(255, 193, 7, 0);
    }
}

/* Problem Cards Hover Effects */
.problem-card {
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.problem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.1), transparent);
    transition: left 0.6s;
}

.problem-card:hover::before {
    left: 100%;
}

.problem-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.5);
}

/* Hero Background Parallax */
.hero-bg {
    will-change: transform;
}

/* Navigation Enhancements */
nav {
    transition: all 0.3s ease;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Smooth Transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FFC107, #FF8F00);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #FFD700, #FFC107);
}

/* Loading States */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Glassmorphism Effects */
.glass {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* Text Gradients */
.text-gradient-gold {
    background: linear-gradient(135deg, #FFD700, #FFC107);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover Animations for Interactive Elements */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Responsive Image Handling */
img {
    max-width: 100%;
    height: auto;
}

/* Focus States for Accessibility */
a:focus,
button:focus {
    outline: 2px solid #FFC107;
    outline-offset: 2px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-button,
    .cta-button-final {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
    }
    
    .problem-card {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .text-4xl {
        font-size: 1.875rem;
    }
    
    .text-5xl {
        font-size: 2.25rem;
    }
}

/* Print Styles */
@media print {
    .fixed,
    nav,
    .cta-button,
    .cta-button-final {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bg-gray-900,
    .bg-gray-950,
    .bg-black {
        background-color: #000 !important;
    }
    
    .text-gray-300,
    .text-gray-400 {
        color: #fff !important;
    }
    
    .border-gray-700,
    .border-gray-800 {
        border-color: #fff !important;
    }
}

/* 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;
    }
    
    .animate-bounce {
        animation: none;
    }
}

/* Selection Styling */
::selection {
    background: rgba(255, 193, 7, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(255, 193, 7, 0.3);
    color: #fff;
}
/* Hero Section Enhancements */
.hero-photo-container {
    position: relative;
    z-index: 10;
}

/* Hero Photo Animations */
.hero-photo img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.hero-photo:hover img {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Hero Floating Badge Animation */
.hero-floating-badge {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, 0px);
    }
    50% {
        transform: translate(-50%, -5px);
    }
}

/* Decorative Elements Animations */
.decorative-blur {
    animation: pulse-blur 4s ease-in-out infinite;
}

@keyframes pulse-blur {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.1);
    }
}

/* Hero Responsive Optimizations */
@media (max-width: 1024px) {
    .hero-two-column {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-photo-container {
        order: -1; /* Photo appears above content on mobile */
        margin-bottom: 2rem;
    }
    
    /* Optimize mobile photo size */
    .hero-mobile-photo img {
        width: min(75vw, 300px);
        height: auto;
    }
    
    /* Aproxima o texto da foto no mobile/tablet */
    .hero-photo-mobile {
        margin-bottom: 0 !important;
    }
    .hero-content-mobile {
        margin-top: -1.5rem !important;
    }
}

@media (max-width: 768px) {
    .hero-photo img {
        width: 250px;
        max-width: 90vw;
    }
    
    .hero-floating-badge {
        font-size: 0.875rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* Improve mobile spacing */
    .hero-mobile-spacing {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-photo img {
        width: 200px;
    }
    
    .hero-floating-badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
    
    /* Smaller decorative elements on very small screens */
    .hero-decorative-small {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Hero Performance Optimizations */
.hero-photo-wrapper {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Hero Badge Enhanced Styling */
.hero-badge-enhanced {
    backdrop-filter: blur(10px);
    box-shadow: 
        0 8px 32px rgba(255, 193, 7, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 193, 7, 0.8);
}

/* Hero Text Responsive Enhancements */
@media (max-width: 640px) {
    .hero-title-mobile {
        font-size: 2.25rem;
        line-height: 1.1;
    }
    
    .hero-subtitle-mobile {
        font-size: 1.125rem;
    }
    
    .hero-description-mobile {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

/* === FIX CIRÚRGICO PARA OVERFLOW HORIZONTAL === */

/* 1. Força overflow-x hidden apenas onde necessário */
html, body {
    overflow-x: hidden !important;
}

/* 2. Remove o max-width global que estava quebrando tudo */
/* NÃO aplica max-width em todos os elementos */

/* 3. Fix APENAS para o botão WhatsApp */
.whatsapp-btn-safe {
    position: fixed !important;
    inset: auto 1rem 1rem auto !important; /* substitui bottom/right por inset */
    z-index: 999 !important;
    max-width: 56px !important;
    max-height: 56px !important;
    width: 56px !important;
    height: 56px !important;
    margin: 0 !important;
    overflow-x: hidden !important; /* previne overflow horizontal */
    box-sizing: border-box !important;
}

/* 4. Fix APENAS para o scroll progress */
.scroll-progress-safe {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* 5. Fix APENAS para notificações que podem vazar */
.fixed.top-4.right-4 {
    right: 1rem !important;
    max-width: calc(100vw - 2rem) !important;
}

/* 6. Mobile adjustments - SEM quebrar o layout */
@media (max-width: 768px) {
    
    /* WhatsApp button menor no mobile */
    .whatsapp-btn-safe {
        width: 52px !important;
        height: 52px !important;
        max-width: 52px !important;
        max-height: 52px !important;
        inset: auto 0.75rem 0.75rem auto !important;
    }
    
    /* Garante que containers muito largos não causem scroll horizontal */
    .max-w-7xl {
        max-width: calc(100vw - 1rem) !important;
    }
    
    /* Fix apenas para elementos que realmente podem vazar */
    .hero-photo img {
        max-width: min(90vw, 400px) !important;
    }
}

/* 7. Fix específico para elementos absolutos que podem causar problema */
.absolute {
    /* Aplica apenas se o elemento estiver saindo da viewport */
    max-width: 100vw;
}

/* 8. Previne overflow em containers de texto muito largos */
.text-4xl,
.text-5xl,
.text-6xl {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 9. Debug mode - descomente APENAS se precisar identificar problemas */
/*
.debug-overflow * {
    outline: 1px solid red !important;
}
*/

/* 10. Fix mínimo para o viewport meta */
@viewport {
    width: device-width;
    initial-scale: 1.0;
}
