/* Navigation styles */
nav {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 12.5rem;
    background-color: #00242A;
    padding: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1002;
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
    margin: 0;
    height: 60vh; /* This maintains proportional height */
    justify-content: space-evenly;
    gap: 0;
}

nav li {
    flex: none;
    position: relative;
    width: 100%;
    aspect-ratio: 2/1; /* This maintains 2:1 ratio regardless of width */
    min-height: 2.5rem; /* Add a minimum height */
    max-height: calc(10vh + 1rem); /* Add a maximum height */
    z-index: 1;
}

nav::before,
nav::after {
    content: '';
    height: 20vh;
    background-color: #00242A;
}

nav::after {
    content: var(--current-year);
    height: 20vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #e0e0e0;
}

nav a {
    text-decoration: none;
    color: #e0e0e0;
    font-size: 1.1rem;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 1rem;
    z-index: 1;
    transition: color 0.1s ease;  /* Add smooth transition */
}

/* Add responsive sizing for nav icons and text */
.nav-icon {
    width: clamp(1.5rem, 5vh, 2rem); /* Responsive size that scales with viewport height */
    height: clamp(1.5rem, 5vh, 2rem);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: filter 0.3s ease;
}

.nav-icon img {
    width: 100%;
    height: 100%;
    filter: invert(88%) sepia(0%) saturate(0%) hue-rotate(153deg) brightness(115%) contrast(100%);  /* Makes the SVG light gray */
}

nav a:hover .nav-icon img {
    filter: invert(89%) sepia(61%) saturate(1095%) hue-rotate(359deg) brightness(103%) contrast(94%);  /* Changes to #F0DE1E */
}

/* Add responsive sizing for nav text */
.nav-text {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: clamp(0.7rem, 2.5vh, 0.9rem); /* Responsive font size */
    transition: color 0.1s ease;
}

/* Make the corner highlights scale appropriately */
nav a::before,
nav a::after,
nav li::before,
nav li::after {
    content: '';
    position: absolute;
    width: clamp(0.4rem, 2vh, 0.625rem);
    height: clamp(0.4rem, 2vh, 0.625rem);
    border: 1px solid #e0e0e0;
    z-index: 2;
    transition: border-color 0.3s ease;  /* Add smooth transition */
}

/* Corner highlights */
nav a::before,
nav a::after {
    content: '';
    position: absolute;
    width: 0.625rem;
    height: 0.625rem;
    border: 1px solid #e0e0e0;
}

/* Top left corner */
nav a::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

/* Top right corner */
nav a::after {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

/* Bottom corners using pseudo-elements of nav li */
nav li::before,
nav li::after {
    content: '';
    position: absolute;
    width: 0.625rem;
    height: 0.625rem;
    border: 1px solid #e0e0e0;
    bottom: 0;
}

/* Bottom left corner */
nav li::before {
    left: 0;
    border-right: none;
    border-top: none;
}

/* Bottom right corner */
nav li::after {
    right: 0;
    border-left: none;
    border-top: none;
}

nav a:hover {
    color: #F0DE1E;  /* Change text and icon color on hover */
    background-color: transparent;  /* Remove background highlight */
}

/* Hover state for corners */
nav a:hover::before,
nav a:hover::after,
nav li:hover::before,
nav li:hover::after {
    border-color: #F0DE1E;
}

/* Active state for navigation links */
nav a.active {
    color: #F0DE1E;
    border: 1px solid #F0DE1E;  /* Add yellow border */
    margin: -1px;  /* Compensate for the border to prevent layout shift */
}

nav a.active .nav-icon img {
    filter: invert(89%) sepia(61%) saturate(1095%) hue-rotate(359deg) brightness(103%) contrast(94%);
}

/* Hide corner highlights for active links */
nav a.active::before,
nav a.active::after,
li:has(a.active)::before,
li:has(a.active)::after {
    display: none;
}

/* Adjust nav padding for smaller heights */
@media screen and (max-height: 600px) {
    nav ul {
        gap: 0.2rem; /* Add a small gap between items at smaller heights */
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    nav::before,
    nav::after {
        height: 15vh; /* Reduce spacing before and after */
    }
    
    nav a {
        padding: 0.5rem; /* Smaller padding */
    }
}

/* For extremely small heights */
@media screen and (max-height: 450px) {
    nav ul {
        height: 70vh; /* Increase the proportion for nav items */
    }
    
    nav::before,
    nav::after {
        height: 10vh; /* Further reduce spacing */
    }
}

/* Mobile Navigation Styles */
@media screen and (max-width: 768px) {
    nav {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 80%;
        max-width: 300px;
        box-shadow: 0 0 10px rgba(0,0,0,0.5);
    }
    
    body.mobile-menu-open nav {
        transform: translateX(0);
    }
    
    nav ul {
        height: auto;
        padding: 2rem 1rem;
        margin-top: 3rem; /* Space for the close button */
    }
    
    nav li {
        aspect-ratio: auto;
        height: 3rem;
        margin-bottom: 1rem;
    }
    
    /* Simplify nav items on mobile */
    .nav-icon {
        left: 1.5rem;
        transform: translateY(-50%);
    }
    
    .nav-text {
        position: relative;
        bottom: auto;
        right: auto;
        margin-left: 3rem;
    }
    
    nav a {
        justify-content: flex-start;
        padding: 0.5rem;
    }
    
    nav::before {
        height: 0;
    }
    
    nav::after {
        height: 3rem;
    }
} 