/* 1. Primary and Secondary Navigation (Horizontal) */
#buddypress #object-nav ul,
#buddypress #subnav ul,
#buddypress .button-tabs {
    display: flex !important;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    border-bottom: 1px solid #ddd;
}

/* 2. Uniform spacing for all list items */
#buddypress #object-nav ul li,
#buddypress #subnav ul li,
#buddypress .button-tabs li {
    margin: 0;
    float: none !important; /* Overriding legacy BP floats */
}

/* 3. Link Styling for all menus */
#buddypress #object-nav ul li a,
#buddypress #subnav ul li a,
#buddypress .button-tabs li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    font-weight: 600;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: background 0.2s ease;
}

/* 4. Active/Selected States */
#buddypress #object-nav ul li.current.selected a,
#buddypress #subnav ul li.current.selected a,
#buddypress .button-tabs li.current a {
    color: #007cba;
    border-bottom-color: #007cba;
    background: #f1f1f1;
}

/* 5. Specific fix for the 'button-tabs' class in the Profile Edit form */
#buddypress #profile-edit-form .button-tabs {
    background: transparent;
    border: none;
    border-bottom: 1px solid #ddd;
    padding-left: 0;
}

#buddypress #profile-edit-form .button-tabs li a {
    background: none;
    border-radius: 0;
    margin-right: 5px;
}

/* 6. Mobile Responsiveness */
@media screen and (max-width: 600px) {
    #buddypress #object-nav ul,
    #buddypress #subnav ul,
    #buddypress .button-tabs {
        flex-direction: column;
    }
    
    #buddypress #object-nav ul li a,
    #buddypress #subnav ul li a,
    #buddypress .button-tabs li a {
        border-bottom: 1px solid #eee;
        border-left: 3px solid transparent;
    }

    #buddypress #object-nav ul li.current.selected a,
    #buddypress #subnav ul li.current.selected a,
    #buddypress .button-tabs li.current a {
        border-bottom: 1px solid #eee;
        border-left-color: #007cba;
    }
}
/* Profile Table Styling */
#buddypress .profile-fields {
    width: 100%;
    border-collapse: collapse;
}

/* 1st Column: 25% width, Bold, Left Justified */
#buddypress .profile-fields td.label {
    width: 25%;
    font-weight: bold;
    text-align: left;
    vertical-align: top;
    padding: 10px 15px 10px 0; /* Adjust padding for spacing */
}

/* 2nd Column: Left Justified */
#buddypress .profile-fields td.data {
    text-align: left;
    vertical-align: top;
    padding: 10px 0;
}

/* Remove default paragraph margins inside table cells for better alignment */
#buddypress .profile-fields td.data p {
    margin: 0;
    padding: 0;
}

/* Optional: Add a light border between rows for better readability */
#buddypress .profile-fields tr {
    border-bottom: 1px solid #eee;
}
/* Make all legends in the BuddyPress profile edit form bold */
#buddypress #profile-edit-form legend,
#buddypress .standard-form legend {
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em; /* Optional: slightly larger for better hierarchy */
    color: #333;
}

/* Specifically target the field visibility legends if they feel too cluttered */
#buddypress .field-visibility-settings legend {
    font-weight: bold;
    margin-bottom: 5px;
}
#buddypress .standard-form p.description {
    color: #767676;
    font-size: 80%;
    margin: 5px 0;
}
#buddypress .field-visibility-settings legend, #buddypress .field-visibility-settings-toggle {
    font-style: italic;
}
#buddypress .current-visibility-level {
    font-weight: 700;
    font-style: normal;
}
#buddypress .field-visibility-settings, #buddypress .field-visibility-settings-notoggle, #buddypress .field-visibility-settings-toggle {
    color: #707070;
}
#buddypress .profile .standard-form .field_type_checkbox .checkbox-options label {
    display: inline;
    margin-left: 15px;
}
#buddypress .standard-form label, #buddypress .standard-form legend, #buddypress .standard-form span.label {
    display: block;
    font-weight: 700;
    margin: 15px 0 5px;
    width: auto;
}
/* Align the Birthday Day/Month/Year selects horizontally */
#buddypress .datebox-selects {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px; /* Adds consistent spacing between the dropdowns */
    margin-top: 5px;
}

/* Ensure the select boxes themselves have a consistent height */
#buddypress .datebox-selects select {
    display: inline-block;
    width: auto; /* Prevents them from stretching to 100% width */
    padding: 5px 10px;
}

/* Mobile Fix: Allow them to stack if the screen is too narrow */
@media screen and (max-width: 480px) {
    #buddypress .datebox-selects {
        flex-direction: row; /* Keep them horizontal if possible */
        justify-content: flex-start;
    }
    
    #buddypress .datebox-selects select {
        flex: 1; /* Allow them to grow equally to fill the row */
        min-width: 80px;
    }
}
