/* =============================================
   Header Balance & Alignment Enhancements
   Description: Improved spacing and icon alignment for balanced header
   ============================================= */

/* Header Content - Flex Container */
.header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 2rem;
    /* Space between logo and nav */
}

/* Logo Title - Enforce Single Line */
.logo h1 {
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    font-size: 1.5rem !important;
    /* Adjusted size to fit */
    margin: 0 !important;
}

.logo h1 i {
    margin-right: 0.5rem !important;
}

/* Main Navigation - Split Layout Strategy */
.main-nav {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    /* Take up remaining space */
    gap: 0.5rem;
}

/* Navigation Links - Consistent Icon Spacing */
.main-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border-radius: 8px;
    color: #4A5568;
    /* Neutral color for links */
    font-weight: 600;
}

.main-nav .nav-link:hover {
    background: rgba(58, 11, 97, 0.05);
    /* Subtle hover background */
    color: var(--uitm-purple, #3A0B61);
}

.main-nav .nav-link.active {
    background: rgba(58, 11, 97, 0.1);
    color: var(--uitm-purple, #3A0B61);
}

.main-nav .nav-link i {
    font-size: 1.1rem;
}

/* Admin Link Icon - Shield Style */
.admin-only i.fa-user-shield {
    color: #DC2626;
}

.admin-only:hover i.fa-user-shield {
    color: #B91C1C;
}

/* Notification Wrapper - PUSH TO RIGHT */
/* This is the key to the balanced layout: margin-left: auto pushes this and following items to the far right */
.notification-wrapper {
    display: flex;
    align-items: center;
    margin-left: auto !important;
    padding-left: 1.5rem;
    position: relative;
}

/* Vertical Divider */
.notification-wrapper::before {
    content: '';
    position: absolute;
    left: 0;
    height: 24px;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Welcome Message - Proper Spacing */
.welcome-message {
    margin: 0 0.5rem;
    white-space: nowrap;
}

/* Logout Button - Icon Enhancement */
#logoutBtn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.625rem 1.25rem !important;
    white-space: nowrap;
    margin-left: 0.5rem;
}

#logoutBtn i {
    font-size: 1rem;
}

/* Responsive Header Balance */
@media (max-width: 1024px) {
    .header-content {
        gap: 1rem;
    }

    .logo h1 {
        font-size: 1.25rem !important;
        /* Smaller font on tablets */
    }

    .main-nav {
        gap: 0.25rem;
    }

    .notification-wrapper {
        padding-left: 0.75rem;
    }

    .main-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding-bottom: 1rem;
    }

    .main-nav {
        width: 100%;
        justify-content: space-between;
        gap: 0.25rem;
    }

    /* On mobile, remove the "push right" behavior to center everything */
    .notification-wrapper {
        margin-left: 0 !important;
        padding-left: 0;
        border: none;
    }

    .notification-wrapper::before {
        display: none;
    }

    .main-nav .nav-link {
        padding: 0.5rem;
    }

    /* Hide text labels on mobile, keep icons */
    .main-nav .nav-link span:not(.badge),
    .welcome-greeting,
    .welcome-name {
        display: none;
    }

    .welcome-message {
        margin: 0;
        padding: 0.5rem;
    }

    #logoutBtn span {
        display: none;
    }

    #logoutBtn {
        padding: 0.5rem;
    }
}