/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

header.main-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: 75px;
    background-color: #1d63aa;
    z-index: 9999;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== Branding (White & Gray) ===== */
.profile-link { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.profile-img { width: 62px; height: 62px; border-radius: 50%; margin-right: 12px; object-fit: cover; border: 2px solid rgba(255,255,255,0.2); }
.user-info { display: flex; flex-direction: column; line-height: 1.1; }

.usernam { font-size: 19px; font-weight: bold; color: #ffffff !important; }
.caption { font-size: 14px; color: #d1d1d1 !important; }

/* ===== Desktop Navigation ===== */
header ul.nav { display: flex; list-style: none; gap: 25px; height: 75px; align-items: center; }
header ul.nav li { position: relative; display: flex; align-items: center; height: 100%; }
header ul.nav li a { display: flex; flex-direction: column; align-items: center; color: rgba(255, 255, 255, 0.85); text-decoration: none; padding: 0 10px; transition: 0.3s ease; }

header ul.nav li a i { font-size: 1.4rem; } 
.nav-text { font-size: 13px; font-weight: 500; margin-top: 4px; }

/* ===== Active Underline (Beneath Text) ===== */
header ul.nav li.active::after {
    content: '';
    position: absolute;
    bottom: 5px; /* Sits at the bottom of the header */
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.9);
}
header ul.nav li.active a { color: #ffffff; }

/* ===== Dropdown with Blue Hover ===== */
.dropdown {
    position: absolute; top: 75px; right: 0; width: 195px;
    background: white; display: none; flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25); border-radius: 0 0 8px 8px;
    overflow: hidden;
}
.has-dropdown:hover .dropdown { display: flex; }
.dropdown li a { flex-direction: row !important; color: #333 !important; padding: 14px 20px !important; width: 100%; border-bottom: 1px solid #f0f0f0; }

.dropdown li a:hover { 
    background-color: #1d63aa !important; 
    color: #ffffff !important; 
}
.dropdown li a i { color: #1d63aa; margin-right: 12px; }
.dropdown li a:hover i { color: #ffffff !important; }

/* ===== Mobile (Tight Spacing) ===== */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .header-container { padding: 0 10px; }

    header ul.nav { 
        gap: 0px; 
        flex: 1; 
        justify-content: flex-end; 
        overflow-x: auto; 
    }
    header ul.nav li a { padding: 5px 8px; }
    header ul.nav li a i { font-size: 1.2rem; }
    .nav-text { font-size: 10px; }
    
    header ul.nav li.active::after { width: 25px; bottom: 8px; }

    .has-dropdown { position: static !important; }
    .dropdown { position: fixed; top: 75px; left: 0; right: 0; width: 100%; border-radius: 0; }
}
/* ===== Ultra-Compact Mobile (Small Phones 480px and below) ===== */
@media (max-width: 480px) {
    .header-container { padding: 0 5px; }

    header ul.nav { 
        justify-content: space-around; /* Spreads tabs evenly across the small width */
    }

    header ul.nav li a { 
        padding: 5px 4px; /* Extreme tight padding */
    }

    header ul.nav li a i { 
        font-size: 1.2rem; /* Slightly smaller icons to prevent overlap */
    }

    .nav-text { 
        font-size: 12px; /* Minimum readable text size */
        letter-spacing: -0.2px; /* Tighten letters */
    }

    header ul.nav li.active::after { 
        width: 45px; /* Match the smaller icon footprint */
        bottom: 6px; 
    }
    
    /* Ensure the profile image doesn't take too much space */
    .profile-img {
        width: 62px;
        height: 62px;
        margin-right: 5px;
    }
}

/* Badges */
.icon-container { position: relative; }
.nav-badge {
    position: absolute; top: -8px; right: -12px;
    background: #ff4d4d; color: #fff; font-size: 10px; font-weight: bold;
    min-width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #1d63aa;
}