/* Fix for admin panel visibility and z-index issues */

/* Ensure categorization progress is visible */
#categorization-progress {
    position: relative;
    z-index: 1100 !important;
    margin: 10px 0;
}

#categorization-progress .alert {
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

#categorization-progress .progress {
    background-color: rgba(0,0,0,0.1);
}

/* Fix for any overlapping panels */
.accordion-body {
    position: relative;
    z-index: 1;
}

/* Ensure status messages are visible */
#categorization-status {
    position: relative;
    z-index: 1000;
}

/* Make sure the progress bar is animated */
.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

/* Ensure dropdowns work properly */
#categorization-select {
    position: relative;
    z-index: 10;
}

/* Fix for grey overlay issues */
.modal-backdrop {
    z-index: 1040;
}

/* Remove any stray modal backdrops */
.modal-backdrop:not(.show) {
    display: none !important;
}

/* Admin controls should be above other elements */
#admin-controls,
#admin-command-section,
#admin-goal-categorization-section {
    position: relative;
    z-index: 100;
}

/* Fix info panel overflow and contain background */
#info-panel {
    overflow-x: hidden;
    contain: layout style;
}

/* Ensure admin sections don't overflow */
#admin-categorization-section {
    overflow: visible;
    position: relative;
}

/* Make admin actions accordion fill available space */
#admin-actions-accordion {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

#admin-actions-accordion .accordion-body {
    overflow-y: auto;
    flex: 1 1 auto;
    max-height: calc(100vh - 400px); /* Adjust based on other elements */
}

/* Ensure the info panel content fills height */
#info-panel {
    display: flex;
    flex-direction: column;
}

#info-panel > * {
    flex-shrink: 0;
}

#info-panel .accordion-item:last-child {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}