/* =========================
   MENU - PREMIUM
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Empurra o conteúdo da página pra baixo do header */
body {
    padding-top: 68px;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 68px;

    background: rgba(10, 14, 39, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.12);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.4),
        0 1px 0 rgba(0, 212, 255, 0.08);

    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.4s ease;
    animation: headerSlideDown 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Estado escondido */
header.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

@keyframes headerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Linha brilhante no topo do header */
header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 212, 255, 0.6) 20%,
        rgba(123, 94, 255, 0.8) 50%,
        rgba(0, 212, 255, 0.6) 80%,
        transparent 100%);
    animation: scanLine 4s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Glow sutil na base do header */
header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 212, 255, 0.15),
        transparent);
    pointer-events: none;
}

/* =========================
   BOTÃO ESCONDER/MOSTRAR
========================= */

/* Aba que aparece quando o menu está escondido */
.header-reveal {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 999;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 6px 20px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: rgba(0, 212, 255, 0.7);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-reveal.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.header-reveal:hover {
    color: #00d4ff;
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
}

.header-reveal svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.header-reveal:hover svg {
    transform: translateY(2px);
}

/* Botão de esconder dentro do header */
.header-hide-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 8px;
    color: rgba(0, 212, 255, 0.5);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.header-hide-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

.header-hide-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.header-hide-btn:hover svg {
    transform: translateY(-2px);
}

/* =========================
   LOGO / TÍTULO
========================= */

header > p {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    white-space: nowrap;
    position: relative;
    cursor: default;
    user-select: none;
    padding-left: 28px;

    background: linear-gradient(135deg,
        #00d4ff 0%,
        #7b5eff 50%,
        #00d4ff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    animation: gradientFlow 5s ease infinite;
}

header > p::before {
    content: "◈";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    -webkit-text-fill-color: rgba(0, 212, 255, 0.6);
    color: rgba(0, 212, 255, 0.6);
    animation: rotateLogo 6s linear infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rotateLogo {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* =========================
   NAV
========================= */

nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
}

nav ul li {
    position: relative;
}

nav ul li a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.3px;
    text-decoration: none;
    color: #a8bfd9;
    border-radius: 10px;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* Efeito shine ao hover */
nav ul li a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.12) 50%,
        transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

nav ul li a:hover::before {
    transform: translateX(100%);
}

/* Underline brilhante */
nav ul li a::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #7b5eff);
    border-radius: 999px;
    filter: blur(0.5px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    transform: translateX(-50%) scaleX(1);
}

nav ul li a:hover {
    color: #e6f1ff;
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.15);
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(0, 212, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

nav ul li a.active {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.2);
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* =========================
   LINK SAIR - DESTAQUE
========================= */

nav ul li:last-child a {
    color: rgba(255, 68, 102, 0.8);
    border-color: rgba(255, 68, 102, 0.15);
    background: rgba(255, 68, 102, 0.05);
}

nav ul li:last-child a::after {
    background: linear-gradient(90deg, #ff4466, #ff006e);
}

nav ul li:last-child a:hover {
    color: #ff6b9d;
    background: rgba(255, 68, 102, 0.12);
    border-color: rgba(255, 68, 102, 0.3);
    box-shadow:
        0 8px 20px rgba(255, 68, 102, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* =========================
   HAMBURGER - MOBILE
========================= */

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 10px;
    padding: 8px;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #00d4ff;
    border-radius: 999px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 900px) {
    header {
        padding: 0 24px;
    }

    nav ul {
        gap: 2px;
    }

    nav ul li a {
        padding: 7px 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    header {
        padding: 0 20px;
        height: 60px;
    }

    .menu-toggle {
        display: flex;
    }

    .header-hide-btn {
        display: none;
    }

    nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(10, 14, 39, 0.97);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        border-bottom: 1px solid rgba(0, 212, 255, 0.12);
        padding: 16px 20px 24px;
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    }

    nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    nav ul {
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
    }

    nav ul li a {
        padding: 13px 16px;
        font-size: 0.9rem;
        justify-content: flex-start;
        border-radius: 12px;
    }

    nav ul li a::after {
        display: none;
    }

    nav ul li a:hover {
        transform: translateX(4px);
    }
}

@media (max-width: 480px) {
    header {
        padding: 0 16px;
    }

    header > p {
        font-size: 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}