body {
    font-family: Arial, sans-serif;
    direction: rtl;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background-color: #ffffff;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.tree-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.tree {
    list-style-type: none;
    padding: 0;
}

.tree ul {
    padding-right: 20px;
}

.member-container {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.toggle-children {
    margin-left: 5px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 16px;
}

.name-actions-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.member {
    background-color: #f0f0f0;
    border: 1px solid #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    text-align: center;
}

.member:hover {
    background-color: #e0e0e0;
}

.member.selected {
    background-color: #d0d0d0;
    font-weight: bold;
}

.member-actions {
    display: none;
    margin-right: 10px;
}

.member-actions button {
    margin-left: 5px;
    padding: 2px 5px;
    font-size: 12px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.member-actions button:hover {
    background-color: #e0e0e0;
}

.secondary-parent {
    margin-right: 5px;
    font-size: 0.9em;
    color: #666;
}

.linked-members {
    margin-right: 20px;
    font-size: 0.9em;
    color: #666;
}

.linked-members ul {
    margin: 5px 0;
    padding-right: 20px;
}

.highlight {
    background-color: yellow !important;
    transition: background-color 0.5s ease;
}

.children {
    margin-right: 20px;
    border-right: 1px solid #ccc;
    padding-right: 10px;
}

input[type="text"], input[type="submit"] {
    padding: 5px 10px;
    margin: 5px 0;
}

#searchInput {
    padding: 5px;
    width: 200px;
}

#clearFilterButton, #nextMatchButton {
    display: none;
}

#statusMessage {
    margin-top: 10px;
    font-weight: bold;
}

#expandAllButton, #collapseAllButton, #listFullNamesButton {
    margin-right: 10px;
    padding: 5px 10px;
    font-size: 14px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

#expandAllButton:hover, #collapseAllButton:hover, #listFullNamesButton:hover {
    background-color: #e0e0e0;
}

h1 {
    margin-top: 0;
}

#selected-parent, #selected-full-name {
    margin-bottom: 10px;
}

#searchInput, #searchButton, #nextMatchButton, #clearFilterButton {
    margin-bottom: 10px;
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.popup-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

#fullNamesTable {
    width: 100%;
    border-collapse: collapse;
}

#fullNamesTable th, #fullNamesTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: right;
}

#fullNamesTable th {
    background-color: #f2f2f2;
}

#fullNamesFilter {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
}