/* Row wrapper used in headers */
.module-navigation-row {
    display: block !important;            /* robust against conflicting flex parents */
    text-align: right !important;         /* force content to the right */
    width: 100% !important;
}

/* Ensure the inner nav group aligns right and wraps nicely */
.module-navigation-row .module-navigation {
    display: inline-flex !important;      /* honor text-align on the wrapper */
    justify-content: flex-end !important;
    align-items: center;
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
    float: right !important;              /* bulletproof right alignment */
}

/* Clear float so row height is correct */
.module-navigation-row::after {
    content: "";
    display: block;
    clear: both;
}

/* Module Navigation Styling */

/* Container styling */
.module-navigation,
.btn-group.module-navigation {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 0.25rem !important;
    margin-bottom: 1rem !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Button styling */
.module-navigation .btn {
    border-radius: 4px;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    margin-right: 0.25rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* Active button state */
.module-navigation .btn.active {
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Icon alignment */
.module-navigation .btn i {
    margin-right: 0.25rem;
    width: 16px;
    text-align: center;
    vertical-align: middle;
}

/* Make sure buttons are visible with proper contrast */
.module-navigation .btn-outline-secondary {
    border-color: #6c757d;
    color: #495057;
    background-color: #fff;
}

.module-navigation .btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
}

.module-navigation .btn-outline-secondary.active {
    background-color: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .module-navigation {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0.25rem;
    }
}
