/* ===========================
   WGIT - Stylus CSS (Final & Otimizado)
   ===========================
   ✅ Correções Aplicadas:
   1. Remoção de !important excessivos no mobile.
   2. Refatoração de regras responsivas para evitar conflitos com Tailwind.
   3. Melhorias de performance e compatibilidade.
   4. Touch targets otimizados para mobile.
   5. Tipografia e espaçamentos ajustados sem sobrescrever utilitários.
   6. Correção do botão "Voltar ao Topo" para não ocupar 90% da tela.
*/

html {
    scroll-behavior: smooth;
}

/* Previne scroll horizontal indesejado */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Animação de gradiente de fundo */
.gradient-bg {
    background: linear-gradient(
        -45deg,
        var(--color-primary),
        var(--color-secondary),
        var(--color-primary),
        #8B1a1a
    );
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

/* Texto com gradiente */
.gradient-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Efeito glassmorphism */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hover nos cards */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(204, 0, 0, 0.2);
}

/* Partículas flutuantes */
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(204, 0, 0, 0.3);
    animation: float 8s infinite;
}

/* Loader */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050508;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(204, 0, 0, 0.3);
    border-top: 3px solid var(--color-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Keyframes Utilizados */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Focus visible para acessibilidade */
*:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Seleção de texto customizada */
::selection {
    background: var(--color-secondary);
    color: #ffffff;
}

/* Smooth image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
}

/* Links com transição suave */
a {
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

/* Botões com efeito de pressão */
button:active,
a:active {
    transform: scale(0.98);
}

/* Placeholder customizado */
input::placeholder,
textarea::placeholder,
select::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Input autofill override para tema escuro */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.05) inset;
    -webkit-text-fill-color: #ffffff;
    transition: background-color 5000s ease-in-out 0s;
}

/* Slider de Parceiros (Loop Infinito) */
@keyframes scroll-partners {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-partners-scroll {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    animation: scroll-partners 80s linear infinite;
}

.animate-partners-scroll:hover {
    animation-play-state: paused;
}

/* ==========================================
   📱 RESPONSIVIDADE MOBILE OTIMIZADA
   ========================================== */
@media (max-width: 767px) {
  html, body {
    -webkit-text-size-adjust: 100%;
  }

  /* Ajusta containers e grids para mobile sem quebrar layouts específicos */
  .grid { 
    gap: 1rem; 
  }

  /* Reduz padding vertical agressivo de seções */
  section.py-24, 
  div[class*="py-24"], 
  .py-16, 
  .py-12 {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  /* Reduz padding interno de cards e formulários */
  .glass-effect, 
  .p-8, 
  .p-6 {
    padding: 1rem;
  }

  /* Ajusta tipografia para leitura mobile */
  h1 { line-height: 1.2; }
  h2 { line-height: 1.3; }
  
  /* Garante que listas com ícones fiquem lado a lado (horizontal) */
  li.flex {
    flex-direction: row;
    align-items: flex-start;
  }

  /* Remove margens/paddings laterais excessivos */
  .px-8, 
  .px-6, 
  .sm\:px-6, 
  .lg\:px-8 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}