/* ===== RESET E VARIAVEIS ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== PREVENÇÃO DE FLICKS ===== */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevenir reflow durante carregamento */
.main-header {
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Prevenção global de flicks */
* {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Controle específico para elementos animados */
.floating, [class*="animate-"], [class*="transition-"] {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #00d4ff;
    --text-light: #ffffff;
    --text-dark: #333333;
    --bg-dark: #0a0a0a;
    --bg-light: #ffffff;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-strong: 0 4px 20px rgba(0,0,0,0.3);
    --transition: all 0.15s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

/* ===== HEADER PRINCIPAL ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background-color 0.2s ease, backdrop-filter 0.2s ease;
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

.main-header.scrolled {
    background: rgba(10,10,10,0.95);
    box-shadow: var(--shadow-strong);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* ===== NAVBAR ===== */
.navbar {
    height: 94px;
    display: flex;
    align-items: center;
    width: 100%;
}

/* ===== LOGO/MARCA ===== */
.navbar-brand {
    flex-shrink: 0;
    margin-right: 3rem;
}

.brand-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.brand-link:hover {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== MENU DESKTOP ===== */
.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #d1d5db;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.15rem;
    padding: 0.75rem 0;
    position: relative;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link:hover {
    color: var(--text-light);
}

/* Underline effect */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

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

/* ===== DROPDOWN ===== */
.dropdown {
    position: relative;
}

.dropdown-toggle .fas,
.dropdown-toggle .fa-chevron-down {
    font-size: 0.75rem;
    transition: var(--transition);
    margin-left: 0.25rem;
}

.dropdown:hover .dropdown-toggle .fas,
.dropdown:hover .dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(55, 65, 81, 0.5);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
    min-width: 176px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

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

.dropdown-item {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    display: block;
    text-decoration: none;
    color: #d1d5db;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: rgba(55, 65, 81, 0.5);
    color: #ffffff;
}

/* ===== AÇÕES DO NAVBAR ===== */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Botão Primário (Contato) */
.btn-primary,
.contato-btn,
.btn-contato,
.contact-button,
.contact-btn {
    background: var(--gradient-primary) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.75rem 1.25rem !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

.btn-primary:hover,
.contato-btn:hover,
.btn-contato:hover,
.contact-button:hover,
.contact-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
    color: white !important;
}

/* Botão Secundário (Área do Cliente) */
.btn-secondary,
.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.btn-secondary:hover,
.login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    color: var(--text-light);
}

/* ===== MENU MOBILE ===== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(16px);
    z-index: 999;
    transition: var(--transition);
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.5rem;
}

.mobile-nav {
    margin-top: 3rem;
}

.mobile-nav-link {
    display: block;
    padding: 1rem 0;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition);
}

.mobile-nav-link:hover {
    color: var(--primary-color);
    padding-left: 1rem;
}

.mobile-nav-link.sub-item {
    padding-left: 1.5rem;
    font-size: 1rem;
    color: #ccc;
    line-height: 1.4;
}

.mobile-nav-link.sub-item strong {
    color: #ffffff;
    font-weight: 600;
}

.mobile-nav-link.sub-item small {
    color: #a0aec0;
    font-size: 0.85rem;
}

/* Mobile Dropdown */
.mobile-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    text-align: left;
}

.mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
}

.mobile-dropdown.active .mobile-dropdown-content {
    max-height: 300px;
}

.mobile-dropdown.active .mobile-dropdown-toggle .fas {
    transform: rotate(180deg);
}

.mobile-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-contact-btn,
.mobile-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.mobile-contact-btn {
    background: var(--gradient-primary);
    color: var(--text-light);
}

.mobile-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.mobile-login-btn {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    background: transparent;
}

.mobile-login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .navbar-nav,
    .navbar-actions {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .navbar {
        height: 77px;
    }
    
    .navbar-brand {
        margin-right: 0;
    }
    
    .brand-link {
        font-size: 1.75rem;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .navbar-nav {
        gap: 1.5rem;
    }
    
    .navbar-brand {
        margin-right: 2rem;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
    }
    
    .brand-link {
        font-size: 1.3rem;
    }
}

/* ===== SCROLL EFFECTS ===== */
@media (prefers-reduced-motion: no-preference) {
    .main-header {
        transition: all 0.3s ease-in-out;
    }
}

/* ===== OVERLAY PARA MOBILE ===== */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== UTILIDADES EXTRAS ===== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.interactive-element {
    cursor: pointer;
    transition: var(--transition);
}

.interactive-element:hover {
    transform: translateY(-1px);
}

/* ===== COMPATIBILIDADE TAILWIND ===== */
.hidden {
    display: none !important;
}

.rotate-180 {
    transform: rotate(180deg);
}

.transition-transform {
    transition: transform 0.15s ease;
}

.transition-colors {
    transition: color 0.15s ease;
}

.duration-300 {
    transition-duration: 0.15s;
}

/* ===== PREVENÇÃO DE CONFLITOS TAILWIND ===== */
.main-header * {
    transition-property: color, background-color, border-color, opacity !important;
    transition-duration: 0.15s !important;
    transition-timing-function: ease !important;
}

/* Desabilitar animações desnecessárias do Tailwind */
.main-header .group:hover * {
    transform: none !important;
}

/* Forçar estilo do navbar sobre Tailwind */
.navbar, .navbar * {
    box-sizing: border-box !important;
}

/* ===== ESTADOS ESPECIAIS ===== */
.nav-link.active {
    color: var(--text-light);
}

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

/* ===== ANIMAÇÕES ADICIONAIS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu {
    animation: slideDown 0.2s ease when visible;
}

/* ===== SIDEBAR COLLAPSED HEADER ===== */
.collapsed-header {
    padding-left: 80px !important;
    transition: padding-left 0.3s ease-in-out;
}

@media (max-width: 1023px) {
    .collapsed-header {
        padding-left: 0 !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-default: #000000;
        --text-default: #ffffff;
    }
}