.skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    background: #0b1120;
    color: #f8fafc;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    z-index: 1100;
    border-radius: 6px;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 8px;
}

#header.navbar-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #0b1120;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    padding: 0;
    transition: transform 0.3s ease, background 0.3s ease;
}

#header .container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 2rem;
}

nav {
    position: relative;
    width: 100%;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 0;
    min-height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #f8fafc;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.015em;
}

.nav-brand img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    /* transition: transform 0.3s ease; */
}

/* .nav-brand:hover img {
    scale: 1.05;
} */

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(226, 232, 240, 0.25);
    border-radius: 10px;
    cursor: pointer;
    padding: 0.6rem;
    color: #e2e8f0;
    order: 3;
}

.nav-toggle-icon {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    position: relative;
    transition: all 0.3s ease;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
}

.nav-toggle-icon::before {
    top: -6px;
}

.nav-toggle-icon::after {
    bottom: -6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
    transform: rotate(-45deg);
    bottom: 0;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-menu li {
    position: relative;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.25rem;
    text-decoration: none;
    color: rgba(226, 232, 240, 0.78);
    font-weight: 400;
    font-size: 0.95rem;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    border-radius: 999px;
    letter-spacing: -0.01em;
}

.nav-link:hover,
.nav-link:focus {
    color: #f8fafc;
    outline: none;
}

.nav-link.active {
    color: var(--accent-primary);
    font-weight: 500;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.nav-link--pill {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.nav-link--pill:hover {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 3px solid currentColor;
    transition: transform 0.3s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    background: var(--nav-dropdown-bg, #0f1629);
    border-radius: 8px;
    border: 1px solid var(--nav-dropdown-border, rgba(148, 163, 184, 0.18));
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    z-index: 1000;
    margin-top: 0.5rem;
    box-shadow: var(--nav-dropdown-shadow, 0 10px 25px rgba(0, 0, 0, 0.5));
}

/* .dropdown-menu a {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: rgba(59, 130, 246, 0.1);
} */

.dropdown-menu.show {
    display: block;
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: rgba(226, 232, 240, 0.75);
    font-size: 0.9rem;
    transition: background 0.25s ease, color 0.25s ease, padding 0.25s ease;
}

.dropdown-link:hover,
.dropdown-link:focus {
    background: rgba(83, 215, 255, 0.12);
    color: #f8fafc;
    padding-left: 1.75rem;
    outline: none;
}

.messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    max-width: 360px;
}

.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 0.6rem;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 968px) {
    #header .container {
        padding: 0 1.1rem;
    }

    .nav-container {
        position: relative;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(148, 163, 184, 0.12);
        border-radius: 12px;
        padding: 0.55rem;
    }

    .nav-menu {
        position: fixed;
        inset: 0;
        padding: calc(var(--nav-height, 64px) + 1.75rem) 2rem 2.5rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        background: rgba(6, 12, 26, 0.98);
        border-radius: 0;
        border: none;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s ease, opacity 0.3s ease;
        z-index: 999;
    }

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

    .nav-close-container {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }

    .nav-close {
        background: transparent;
        border: none;
        color: rgba(226, 232, 240, 0.85);
        font-size: 1.05rem;
        font-weight: 500;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        padding: 0;
        cursor: pointer;
        transition: color 0.2s ease;
    }

    .nav-close:hover,
    .nav-close:focus {
        color: #ffffff;
        outline: none;
    }

    .nav-close:focus-visible {
        outline: 2px solid rgba(83, 215, 255, 0.8);
        outline-offset: 4px;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.4rem 0;
        border-radius: 0;
        background: transparent;
        color: rgba(241, 245, 249, 0.9);
        font-size: 1.25rem;
        font-weight: 500;
    }

    .nav-link:hover {
        background: transparent;
        color: #ffffff;
    }

    .nav-link--pill {
        padding: 0.6rem 1.4rem;
        border-radius: 999px;
        border: 1px solid rgba(82, 199, 255, 0.45);
        background: rgba(82, 199, 255, 0.12);
        font-size: 1.05rem;
        color: #f8fafc;
    }

    .nav-link--pill:hover {
        background: rgba(82, 199, 255, 0.22);
        box-shadow: none;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-dropdown::after {
        display: none;
    }

    .dropdown-menu {
        position: static;
        margin: 0.2rem 0 0 0;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        display: none;
        gap: 0.75rem;
    }

    .dropdown-menu.show {
        display: flex;
        flex-direction: column;
    }

    .dropdown-link {
        padding: 0.35rem 0 0.35rem 1.25rem;
        font-size: 1.05rem;
        color: rgba(226, 232, 240, 0.85);
    }

    .dropdown-link:hover,
    .dropdown-link:focus {
        padding-left: 1.25rem;
        color: #ffffff;
        background: transparent;
    }

    body.nav-open {
        overflow: hidden;
    }
}

@media (min-width: 969px) {
    .nav-menu li:not(:last-child)::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 20px;
        background: rgba(148, 163, 184, 0.2);
    }

    .nav-dropdown::after {
        display: none;
    }

    .nav-close-container {
        display: none;
    }
}

.nav-link:focus,
.dropdown-link:focus {
    outline: 2px solid rgba(83, 215, 255, 0.55);
    outline-offset: 2px;
}

.nav-menu,
.dropdown-menu {
    transition: all 0.3s ease;
}
