nav * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Navbar styles */
nav {
    width: 100%;
    left: 0;
    right: 0;
    height: 61px;
    position: fixed;
    top: -1px;
    background-color: #fff;
    display: flex;
    align-items: center;
    padding-inline: 20px;
    padding-top: 1px;
    z-index: 9999 !important;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    /* Ensure navbar stays on top in all scenarios */
    transform: translateZ(0);
    will-change: transform;
    max-width: 100vw;
    overflow-x: hidden;
}

nav #logo-box {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

nav h1 {
    color: #595959 !important;
    font-size: 1.5em !important;
    font-weight: 500 !important;
}

nav #mini-logo {
    width: 40px;
    height: 40px;
}

nav #profile-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #222222;
    height: 46px;
    width: fit-content;
    border-radius: 23px;
    padding-right: 3px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

nav #profile-box img {
    width: 40px;
    height: 40px;
}

.username {
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    margin: 0;
    padding: 0 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

nav #profile-box #xp-box {
    height: 100%;
    width: fit-content;
    border-radius: 23px;
    background-color: #9acbd0;
    display: flex;
    align-items: center;
    gap: 20px;
    padding-right: 20px;
}

nav #profile-box #xp-box #badge-box {
    height: 100%;
    width: fit-content;
    border-radius: 23px;
    background-color: #8e805d;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0px 20px 0px 10px;
}

/* Daily XP Progress Circle */
.daily-xp-circle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: help;
}

.daily-xp-circle svg {
    position: absolute;
    top: 0;
    left: 0;
}

.daily-xp-circle #daily-xp-circle {
    transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease;
}

.daily-xp-circle #daily-xp-text {
    position: absolute;
    font-size: 8px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1;
    pointer-events: none;
}

/* Mobile menu button */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-button span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #595959;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Responsive styles */
@media (max-width: 768px) {
    nav {
        padding-inline: 15px;
    }

    nav h1 {
        font-size: 1.2em;
    }

    /* Show mobile menu button */
    .mobile-menu-button {
        display: block;
    }

    /* Hide full profile box by default on mobile */
    nav #profile-box {
        position: absolute;
        top: 61px;
        right: -100vw; /* Hide off-screen */
        flex-direction: column;
        height: auto;
        width: 250px;
        max-width: 90vw;
        border-radius: 0 0 0 10px;
        padding: 15px;
        transition: right 0.3s ease;
        box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.1);
        box-sizing: border-box;
        overflow-x: hidden;
    }

    nav #profile-box.active {
        right: 0; /* Show when active */
    }

    nav #profile-box #xp-box {
        width: 100%;
        justify-content: space-between;
        padding: 10px;
        border-radius: 15px;
        margin-bottom: 10px;
    }

    nav #profile-box #xp-box #badge-box {
        padding: 5px 10px;
    }

    .username {
        margin: 10px 0;
    }

    #pict {
        margin-top: 5px;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    nav h1 {
        font-size: 1em;
    }

    nav #mini-logo {
        width: 30px;
        height: 30px;
    }

    nav #profile-box {
        width: 220px;
        max-width: 85vw;
    }
}

/* Content placeholder for demo */
.content {
    padding: 20px;
    height: 100vh;
    background-color: #f5f5f5;
}

#pict {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
