/* Icon-Only Navigation Buttons */
nav a {
    position: relative;
    padding: 0 !important;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    height: 60px; /* Fixed height for consistency */
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    box-sizing: border-box;
}

/* Keep top-level nav controls uniform */
nav > .nav-more-container {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    flex: 0 0 60px;
}

/* Hide text labels but keep available for screen readers */
nav a span {
    display: none;
}

/* Make icons larger and centered */
.nav-avatar-icon,
.nav-avatar {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* If no avatar, make emoji fill the tile */
nav a:not(:has(.nav-avatar-icon)):not(:has(.nav-avatar)) {
    font-size: 44px !important;
    line-height: 1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* "More" Menu Container */
.nav-more-container {
    position: relative;
    display: inline-block;
}

/* The 3-dot button */
.nav-more-btn {
    background: var(--bg-nav);
    border: 1px solid var(--border-light); /* Match nav a border if any */
    border-radius: 6px; /* Match nav a radius */
    color: var(--text-link); /* Match nav a color */
    font-size: 34px;
    font-weight: bold;
    width: 100%; /* Will flex in parent */
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
}

.nav-more-btn:hover, .nav-more-btn.active {
    background: var(--bg-nav-hover);
}

/* Dropdown Menu */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-container);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 160px;
    flex-direction: column;
}

.nav-dropdown.show {
    display: flex;
}

/* Dropdown items */
.nav-dropdown a {
    padding: 12px 16px;
    text-align: left;
    height: auto;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-dropdown a:hover {
    background: var(--bg-nav-hover);
}

/* Ensure text is visible in dropdown items */
.nav-dropdown a span {
    display: inline;
}

/* Keep emojis normal size in dropdown */
.nav-dropdown a:not(:has(.nav-avatar-icon)) {
    font-size: 14px;
    justify-content: flex-start;
}
