/* Sticky Navigation - Modern Redesign */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .sticky-nav {
    background: rgba(15, 23, 42, 0.85);
}

.sticky-nav.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border-bottom-color: var(--border-color);
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .sticky-nav.scrolled {
    background: rgba(15, 23, 42, 0.95);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 72px;
    gap: 2rem;
}

/* Brand Link - Text Only */
.nav-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    padding: 0.5rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    position: relative;
}

.nav-brand:hover {
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.nav-brand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

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

[data-theme="dark"] .nav-brand {
    color: var(--text-primary);
}

[data-theme="dark"] .nav-brand:hover {
    color: var(--accent-primary);
}

/* Navigation Links */
.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
    margin-left: auto;
    margin-right: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 1.1rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link:hover {
    color: var(--accent-primary);
    transform: translateY(-1px);
}

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

.nav-link.active::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(37, 99, 235, 0.1));
}

/* External Link Indicator */
.nav-link-external img {
    width: 10px;
    height: 10px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.nav-link-external:hover img {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* Theme Toggle Button */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* On desktop, nav-actions comes right after nav-links (grouped on right) */
@media (min-width: 1101px) {
    .nav-links {
        margin-right: 0.5rem;
    }
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: transparent;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.theme-toggle:hover::before {
    opacity: 1;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-icon {
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
    opacity: 1;
}

[data-theme="dark"] .theme-toggle {
    border-color: var(--border-color);
}

[data-theme="dark"] .theme-toggle:hover {
    border-color: var(--accent-primary);
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    padding: 0.65rem;
    gap: 5px;
    z-index: 1001;
    position: relative;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.nav-toggle span {
    width: 24px;
    height: 2.5px;
    background: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nav-toggle:hover span {
    background: var(--accent-primary);
}

.nav-toggle.active {
    border-color: var(--accent-primary);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsive Design */

/* Tablet & Small Desktop */
@media (max-width: 1100px) {
    .nav-container {
        height: 68px;
        padding: 0 20px;
    }

    .nav-brand {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }

    .nav-toggle {
        display: flex !important;
    }

    .nav-actions {
        margin-left: auto;
    }

    .nav-links {
        position: fixed;
        top: 68px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 68px);
        background: var(--bg-primary);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 2rem 0;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 0;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        overflow-y: auto;
    }

    [data-theme="dark"] .nav-links {
        background: rgba(15, 23, 42, 0.98);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-link {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.05rem;
        padding: 1.25rem 0;
        width: 100%;
    }

    .nav-link::before {
        display: none;
    }

    .nav-link:hover::before {
        display: block;
        inset: 0;
        background: var(--bg-secondary);
        border-radius: 0;
    }

    .nav-link.active::before {
        display: block;
        background: linear-gradient(90deg, rgba(52, 152, 219, 0.1), rgba(37, 99, 235, 0.1));
        border-radius: 0;
    }

    .nav-link.active::after {
        content: '';
        position: absolute;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--accent-primary);
    }
}

/* Tablet Portrait & Mobile */
@media (max-width: 768px) {
    .nav-container {
        height: 64px;
        padding: 0 16px;
    }

    .nav-brand {
        font-size: 0.8rem;
        padding: 0.5rem 0;
    }

    .nav-toggle {
        display: flex !important;
    }

    .nav-actions {
        margin-left: auto;
    }

    .nav-links {
        position: fixed;
        top: 64px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 64px);
        background: var(--bg-primary);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 2rem 0;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 0;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        overflow-y: auto;
    }

    [data-theme="dark"] .nav-links {
        background: rgba(15, 23, 42, 0.98);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-link {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.1rem;
        padding: 1.35rem 0;
        width: 100%;
    }

    .nav-link::before {
        display: none;
    }

    .nav-link:hover::before {
        display: block;
        inset: 0;
        background: var(--bg-secondary);
        border-radius: 0;
    }

    .nav-link.active::before {
        display: block;
        background: linear-gradient(90deg, rgba(52, 152, 219, 0.1), rgba(37, 99, 235, 0.1));
        border-radius: 0;
    }

    .nav-link.active::after {
        content: '';
        position: absolute;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--accent-primary);
    }
}