
/* Prevenir scroll horizontal em todos os dispositivos */
html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: 'Montserrat', sans-serif;
}

/* Garantir que todos os elementos respeitem a largura */
* {
    box-sizing: border-box;
}

/* Container global sem overflow */
main {
    max-width: 100vw;
    overflow-x: hidden;
}

section {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Prevenir overflow em mobile */
@media (max-width: 767px) {
    * {
        max-width: 100vw;
    }
    
    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}


/* Estilos da navbar */
nav {
    z-index: 1000 !important; /* Garante que a navbar fique acima de outros elementos */
}

/* Controles de visibilidade para desktop/mobile (fallback caso Tailwind não aplique) */
.desktop-logo {
    display: none;
}

.desktop-button {
    display: none;
}

.mobile-logo {
    display: block;
}

@media (min-width: 768px) {
    .desktop-logo {
        display: block;
    }
    .desktop-button {
        display: block;
    }
    .mobile-logo {
        display: none;
    }
}

/* Estilo dos links da navegação */
.nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: white;
    border-radius: 0.125rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgb(55, 65, 81);
}

@media (min-width: 768px) {
    .nav-link {
        padding: 0;
    }
    
    .nav-link:hover {
        background-color: transparent;
        color: rgb(34, 197, 94);
    }
}

/* Ajustes do container de navegação */
#navbar-sticky {
    background-color: rgb(39, 39, 42);
}

/* A visibilidade agora é controlada pela classe `hidden` (usada pelo JS/Tailwind)
   - No mobile: .hidden => display: none
   - No desktop (>=768px) forçamos que o menu fique visível mesmo que a classe
     `hidden` esteja presente no HTML inicial (isso evita flash/estado incorreto)
*/
.hidden {
    display: none;
}

@media (min-width: 768px) {
    #navbar-sticky {
        background-color: transparent;
        display: flex;
    }

    /* Override: se por algum motivo o elemento ainda tiver a classe `hidden`,
       garantimos que no desktop ele seja exibido */
    #navbar-sticky.hidden {
        display: flex !important;
    }
}

#navbar-sticky ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    #navbar-sticky ul {
        flex-direction: row;
        gap: 2rem;
    }
}

#inicio {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#inicio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url('../img/bg-home.webp'),
        url('../img/bg-home.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

/* Overlay escuro para melhorar contraste do texto */
#inicio::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
    z-index: 0;
}

/* Garantir que o conteúdo fique acima do overlay */
#inicio > * {
    position: relative;
    z-index: 1;
}

/* Animações de entrada da esquerda para direita */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Aplicar animações nos elementos da hero */
#inicio h1 {
    animation: slideInFromLeft 0.8s ease-out 0.2s both;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.5);
}

#inicio p {
    animation: slideInFromLeft 0.8s ease-out 0.4s both;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 0, 0, 0.4);
}

#inicio cite {
    animation: slideInFromLeft 0.8s ease-out 0.6s both;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 0, 0, 0.3);
}

#inicio .hero-buttons {
    animation: slideInFromLeft 0.8s ease-out 0.8s both;
}

/* Hero buttons helper: garante box-sizing e evita quebra indesejada de texto */
.hero-buttons a {
    box-sizing: border-box;
}

/* Ajustes mobile para evitar overflow */
@media (max-width: 640px) {
    .hero-buttons a {
        white-space: normal;
        text-align: center;
        word-wrap: break-word;
    }
}

/* Força o texto do botão a não quebrar entre palavras (apenas desktop) */
@media (min-width: 640px) {
    .hero-buttons a.whitespace-nowrap {
        white-space: nowrap;
    }
}

/* Em telas grandes, permitir que os botões dividam o espaço sem que o texto quebre */
@media (min-width: 768px) {
    .hero-buttons a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}


/* Controles de visibilidade para desktop/mobile */
.desktop-logo {
    display: none;
}

.desktop-button {
    display: none;
}

@media (min-width: 768px) {
    .desktop-logo {
        display: block;
    }
    
    .desktop-button {
        display: block;
    }
    
    .mobile-logo {
        display: none;
    }
}

/* Smooth scroll behavior - melhorado */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Espaço para navbar fixa */
    overflow-x: hidden;
}

/* Scroll mais suave com easing customizado */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
    
    * {
        scroll-margin-top: 80px;
    }
}

/* Transições suaves entre seções */
section {
    position: relative;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: background;
}

/* Scroll animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Navbar scroll effect */
nav.scrolled {
    background-color: rgba(39, 39, 42, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Card hover effects enhancement */
.differential-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.differential-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.testimonial-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    transform: translateY(-3px);
}

/* Solution cards animation */
.solution-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.solution-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Button animations */
a, button {
    transition: all 0.3s ease;
}

a:hover, button:hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth transitions for all interactive elements */
a, button, .nav-link, .differential-card, .testimonial-card, .solution-card {
    will-change: transform;
}

/* Form input focus improvements */
input:focus,
textarea:focus,
select:focus {
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

input, textarea, select {
    transition: all 0.3s ease;
}

/* Loading states */
.button-loading {
    position: relative;
    color: transparent !important;
}

.button-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #16a34a;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #15803d;
    transform: translateY(-5px);
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.4);
}

/* Performance optimization */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility improvements */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Carousel animations */
.carousel-slide {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

/* Navbar link hover effects */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #16a34a;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Image lazy load animation */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Section entrance animations - aplicado apenas quando necessário via JS */

/* Stagger animation for cards */
.solution-card:nth-child(1) { animation-delay: 0.1s; }
.solution-card:nth-child(2) { animation-delay: 0.2s; }
.solution-card:nth-child(3) { animation-delay: 0.3s; }
.solution-card:nth-child(4) { animation-delay: 0.4s; }
.solution-card:nth-child(5) { animation-delay: 0.5s; }

/* Smooth page transitions */
* {
    scroll-behavior: smooth;
}

/* Suavizar transição de cores nas seções */
section {
    background-attachment: local;
    background-size: 100% 100%;
}

/* Loading animation for buttons */
@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(22, 163, 74, 0);
    }
}

.button-loading-pulse {
    animation: buttonPulse 2s infinite;
}

/* Print styles */
@media print {
    nav,
    .back-to-top,
    footer {
        display: none;
    }
}