/* Navigation Stylesheet for Chi Zhang's Personal Website */

/* Navigation Container */
.nav {
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid #3498db;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0 1rem;
}

.nav-link {
    color: #444;
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #3498db;
    transform: translateY(-2px);
}

.nav-link.active {
    color: #3498db;
}

/* Active link indicator */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3498db;
    transition: width 0.3s ease;
}

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

.nav-link.active::after {
    width: 100%;
    background-color: #3498db;
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.nav-toggle:hover {
    transform: scale(1.1);
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #3498db;
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 2px;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-toggle {
        display: block;
        align-self: flex-end;
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background-color: #fff;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }
    
    .nav-menu.active {
        max-height: 300px;
        padding: 0.5rem 0;
    }
    
    .nav-item {
        margin: 0.5rem 1rem;
        text-align: center;
    }
    
    .nav-link {
        display: block;
        padding: 0.5rem;
    }
    
    .nav-link:hover {
        background-color: #f5f9ff;
        border-radius: 4px;
    }
    
    /* Hamburger to X animation */
    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: #f39c12;
    }
    
    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background-color: #f39c12;
    }
}
