:root {
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --footer-text: #fff;
    --text-color: #333;
    --menu-bg: rgba(255, 255, 255, 0.98);
    --menu-hover: rgba(74, 144, 226, 0.1);
    --dark-bg: #1a1a2e;
    --dark-text: #e6e6e6;
    --dark-hover: rgba(74, 144, 226, 0.2);
    --transition-speed: 0.4s;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-color);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logo {
    height: 40px;
    transition: transform 0.3s ease;
}
.logo:hover { 
    transform: scale(1.05); 
}

.nav-links {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--footer-text);
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}
nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}
nav a:hover::after {
    width: 100%;
}
nav a:hover {
    color: var(--secondary-color);
}

/* ============= MENU HAMBURGER MODERNO ============= */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    width: 54px;
    height: 54px;
    justify-content: center;
    align-items: center;
    z-index: 2001;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05) rotate(90deg);
}

.menu-toggle:active {
    transform: scale(0.95);
}

/* Ícone hambúrguer animado moderno */
.hamburger {
    width: 26px;
    height: 20px;
    position: relative;
    transform: rotate(0deg);
    transition: 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 3px;
    opacity: 1;
    transform: rotate(0deg);
    transition: 0.25s ease-in-out;
    transform-origin: center;
}

.hamburger span:nth-child(1) {
    transform-origin: left center;
}

.hamburger span:nth-child(2) {
    transition: opacity 0.2s ease;
}

.hamburger span:nth-child(3) {
    transform-origin: left center;
}

/* Animação para X quando aberto */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(2px, -2px);
    width: 110%;
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(2px, 2px);
    width: 110%;
}

/* ============= MENU MOBILE MODERNO ============= */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100vh;
    background: var(--menu-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: right var(--transition-speed) cubic-bezier(0.215, 0.610, 0.355, 1);
    z-index: 2000;
    overflow-y: auto;
}

.mobile-menu.open { 
    right: 0; 
}

/* Header do menu mobile moderno */
.mobile-menu-header {
    padding: 5rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), #3a7bc8);
    color: white;
    position: relative;
    min-height: 180px;
}

.mobile-menu-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M1200 120L0 16.48 0 0 1200 0 1200 120z' fill='%23fff'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
}

.mobile-menu-header h3 {
    color: white;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mobile-menu-header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Links do menu mobile moderno */
.mobile-menu-links {
    flex: 1;
    padding: 2.5rem 0 2rem;
    background: #fff;
}

.mobile-menu a {
    display: flex;
    align-items: center;
    color: #444;
    text-decoration: none;
    padding: 1.2rem 2rem;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-left: 0 solid var(--primary-color);
}

.mobile-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.1), transparent);
    transition: left 0.5s;
}

.mobile-menu a:hover::before {
    left: 100%;
}

.mobile-menu a:hover {
    background: var(--menu-hover);
    color: var(--primary-color);
    border-left-width: 5px;
    padding-left: calc(2rem - 5px);
}

.mobile-menu a:active {
    transform: scale(0.98);
    background: rgba(74, 144, 226, 0.15);
}

.mobile-menu a i {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.mobile-menu a:hover i {
    transform: scale(1.2) translateX(3px);
}

/* Separador moderno */
.mobile-menu hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.3), transparent);
    margin: 0.8rem 2rem;
}

/* Categoria de links */
.menu-category {
    padding: 1rem 2rem 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    font-weight: 600;
}

/* Footer do menu mobile */
.mobile-menu-footer {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
}

.mobile-menu-footer p {
    margin: 0;
    font-size: 0.85rem;
    color: #777;
}

/* Overlay moderno */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) cubic-bezier(0.215, 0.610, 0.355, 1);
    z-index: 1500;
}

.menu-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Efeitos de entrada para os itens do menu */
.mobile-menu.open .mobile-menu-links a {
    animation: slideInRight 0.4s ease forwards;
    opacity: 0;
}

.mobile-menu.open .mobile-menu-links a:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu.open .mobile-menu-links a:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu.open .mobile-menu-links a:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu.open .mobile-menu-links a:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu.open .mobile-menu-links a:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu.open .mobile-menu-links a:nth-child(6) { animation-delay: 0.35s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Adicionando uma pequena animação de flutuação para o header */
@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-header h3 {
    animation: floatIn 0.6s ease forwards;
}

/* Dark mode para o menu mobile */
@media (prefers-color-scheme: dark) {
    .mobile-menu {
        background: var(--dark-bg);
    }
    
    .mobile-menu-links {
        background: transparent;
    }
    
    .mobile-menu a {
        color: var(--dark-text);
    }
    
    .mobile-menu a:hover {
        background: var(--dark-hover);
    }
    
    .mobile-menu-footer {
        background: rgba(30, 30, 40, 0.95);
        border-top: 1px solid #333;
    }
    
    .mobile-menu-footer p {
        color: #aaa;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .nav-links { 
        display: none; 
    }
    .menu-toggle { 
        display: flex; 
    }
    
    nav {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
        max-width: none;
    }
    
    .mobile-menu-header {
        min-height: 160px;
        padding: 4rem 1.5rem 1.5rem;
    }
    
    .menu-toggle {
        width: 46px;
        height: 46px;
    }
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}