/* ========================================
   LAB2B - Main Stylesheet
   Optimized for Performance
   ======================================== */

/* Reset & Base - Otimizado */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* REMOVIDO: Transições globais que causam lentidão
   *{transition:background-color .3s ease,border-color .3s ease,transform .3s ease}
   Em vez disso, aplicamos transições apenas onde necessário
*/

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header Styles - Otimizado */
.header-modern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, .05);
    /* Transição apenas nas propriedades necessárias */
    transition: background-color .3s ease, box-shadow .3s ease;
    height: 64px;
    /* Otimização: will-change apenas quando necessário */
    will-change: background-color, box-shadow;
}

.header-modern.scrolled {
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    height: 60px;
}

.header-spacer {
    height: 64px;
}

@media (min-width: 768px) {
    .header-modern {
        height: 72px;
    }
    .header-modern.scrolled {
        height: 68px;
    }
    .header-spacer {
        height: 72px;
    }
}

/* Navigation - Transições apenas onde necessário */
.nav-link {
    position: relative;
    color: #1f2937;
    font-weight: 500;
    font-size: 15px;
    /* Transição apenas para color */
    transition: color .2s ease;
}

.nav-link:hover {
    color: #4C50FF;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4C50FF;
    /* Transição apenas para width */
    transition: width .3s ease;
}

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

/* Dropdowns - Otimizado com transform em vez de múltiplas propriedades */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.98);
    /* Usar transform para melhor performance */
    transition: opacity .2s ease, visibility .2s ease, transform .2s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
    /* GPU acceleration */
    will-change: transform, opacity;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown-item {
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #4C50FF 0%, #3d40e6 100%);
    transform: scaleY(0);
    transform-origin: top;
    /* Usar transform em vez de height para melhor performance */
    transition: transform .2s ease;
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

/* REMOVIDO: Animações de Natal pesadas que causam repaints constantes
   Mantidas apenas as essenciais, simplificadas
*/

/* Animação simplificada da estrela - apenas quando necessário */
@keyframes sparkle {
    0%, 100% {
        opacity: .8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Aplicar apenas onde necessário, não globalmente */
.christmas-star {
    position: absolute;
    font-size: 8px;
    color: #dc2626;
    animation: sparkle 2s ease-in-out infinite;
    pointer-events: none;
    /* GPU acceleration */
    will-change: transform, opacity;
}

.christmas-star:nth-child(1) {
    top: -6px;
    right: -6px;
    animation-delay: 0;
}

.christmas-star:nth-child(2) {
    top: -4px;
    left: -6px;
    animation-delay: .5s;
}

.christmas-star:nth-child(3) {
    bottom: -4px;
    right: -4px;
    animation-delay: 1s;
}

.christmas-star:nth-child(4) {
    bottom: -6px;
    left: -4px;
    animation-delay: 1.5s;
}

/* REMOVIDO: Animações pesadas de float, twinkle, glow e shine
   Essas causam repaints constantes e degradam a performance
*/

/* Mobile Menu - Otimizado */
.mobile-menu {
    transform: translateX(100%);
    /* Usar transform em vez de left para melhor performance */
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

.mobile-menu.open {
    transform: translateX(0);
}

body.menu-open {
    overflow: hidden;
}

/* CTA Button - Transições apenas onde necessário */
.cta-button {
    background: linear-gradient(135deg, #4C50FF 0%, #3d40e6 100%);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    /* Transições apenas para transform e box-shadow */
    transition: transform .3s ease, box-shadow .3s ease;
    box-shadow: 0 2px 8px rgba(76, 80, 255, .2);
    /* GPU acceleration */
    will-change: transform, box-shadow;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 80, 255, .3);
}

/* Hero Sections */
.hero-section-desktop {
    padding-top: 2rem;
}

.hero-section-mobile {
    padding-top: 2rem;
}

/* Animations - Otimizadas e reduzidas */
@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(.9);
    }
}

.animate-blob {
    animation: blob 7s infinite;
    /* GPU acceleration */
    will-change: transform;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    /* GPU acceleration */
    will-change: background-position;
}

/* Card Effects - Otimizado */
.hover-card {
    /* Transição apenas para transform */
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

.hover-card:hover {
    transform: translateY(-8px);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section-mobile {
        min-height: auto;
    }
}

/* Reduzir animações para usuários que preferem movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Otimizações adicionais de performance */

/* Containment para melhorar rendering */
.header-modern,
.mobile-menu,
.dropdown-menu {
    contain: layout style paint;
}

/* Otimização de font rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remover transições em elementos estáticos */
img,
svg {
    /* Sem transições em imagens - melhora performance */
}

/* Otimização para elementos que não mudam */
.static-element {
    /* Sem transições desnecessárias */
}
