/* --- Styles for the new Universal Animated Index Menu --- */

/* 1. The Index/Close Button Container */
.index-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001; /* Must be higher than the menu overlay */
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    padding: 5px;
    /* This is a common fix for preventing blurriness on transformed elements */
    backface-visibility: hidden;
    /* This creates a space for the icons to live in */
    width: 28px;
    height: 28px;
    position: relative;
}

/* NEW: Style for the icons inside the button */
.index-menu-button svg {
    /* This positions both icons directly on top of each other */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* This makes them fade in and out smoothly */
    transition: opacity 0.2s ease-in-out;
}

/* By default, the close icon is invisible */
#index-close-icon {
    opacity: 0;
}

/* 2. The Rotation Animation and Icon Switch */
.index-menu-button.active {
    transform: rotate(360deg);
}
/* When the menu is active, hide the open icon... */
.index-menu-button.active #index-open-icon {
    opacity: 0;
}
/* ...and show the close icon. */
.index-menu-button.active #index-close-icon {
    opacity: 1;
}

/* 3. The Full-Screen Menu Overlay */
.index-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Refined: A clean, classical light theme */
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}

.index-menu-overlay.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

/* 4. The Content Inside the Menu */
.index-menu-content {
    /* New: A focused, centered single-column layout */
    max-width: 700px;
    margin: 12vh auto 0 auto;
    padding: 2rem 1.5rem;
    height: 75vh;
    display: flex;
    flex-direction: column;
}

/* 5. The Search Box */
.index-search-box {
    width: 100%;
    /* Refined: A more elegant and less intrusive search input */
    font-size: 1.8rem;
    font-weight: 500;
    padding: 1rem 0.5rem;
    border: none;
    border-bottom: 2px solid #d1d5db;
    background-color: transparent;
    outline: none;
    transition: border-color 0.3s;
    color: #1c1e21;
    margin-bottom: 2rem;
}

.index-search-box:focus {
    border-bottom-color: #0073e6;
}

/* 6. The Results List */
#index-results-list {
    list-style: none;
    padding: 0;
    /* New: Let the list grow and scroll naturally */
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 2rem;
}

#index-results-list li a {
    display: block;
    padding: 1rem;
    text-decoration: none;
    /* Refined: Styles for the light theme */
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
    border-bottom: 1px solid #eef0f2;
    transition: background-color 0.2s;
}

#index-results-list li a:hover {
    background-color: #f8f9fa;
}

/* 7. NEW: The Main Navigation Links Section */
.index-main-nav {
    /* New: A classic, horizontal navigation bar */
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.index-main-nav a {
    text-decoration: none;
    /* Refined: Professional and clean link styling */
    color: #606770;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s;
}

.index-main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #0073e6;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.index-main-nav a:hover {
    color: #1c1e21;
}

.index-main-nav a:hover::after {
    transform: scaleX(1);
}

/* Responsive adjustments for the new menu */
@media (max-width: 768px) {
    .index-menu-content {
        margin-top: 10vh;
        height: 80vh;
        padding: 1rem;
    }
    .index-main-nav {
        gap: 1.8rem;
    }
    .index-main-nav a {
        font-size: 1rem;
    }
    .index-search-box {
        font-size: 1.5rem;
    }
}

/* --- Styles for the Page Fade-out on Login Click --- */
body.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}