/* Bootstrap Tree View Styles - Nucor Branding */

.org-hierarchy-tree {
    max-height: 600px;
    overflow-y: auto;
}

.org-hierarchy-tree .table {
    margin-bottom: 0;
}

.org-hierarchy-tree thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #D9E8E2; /* Nucor pale green */
    color: #213B34; /* Nucor dark green */
}

.tree-row {
    transition: background-color 0.15s ease-in-out;
}

.tree-row:hover {
    background-color: #F5F4F0; /* Nucor light gray */
}

.tree-row.selected,
.tree-row.table-active {
    background-color: #BFE2F6 !important; /* Nucor light blue */
}

.tree-row td {
    vertical-align: middle;
    padding: 0.5rem;
}

.tree-row .btn-link {
    color: #006325; /* Nucor medium green */
    text-decoration: none;
    padding: 0;
}

.tree-row .btn-link:hover {
    color: #213B34; /* Nucor dark green */
}

.tree-row .btn-group-sm .btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.875rem;
}

/* Tree expand/collapse button */
.tree-row .btn-expand {
    width: 20px;
    height: 20px;
    padding: 0;
    line-height: 1;
    border: none;
    background: transparent;
    color: #006325; /* Nucor medium green */
    cursor: pointer;
    transition: transform 0.2s ease;
}

.tree-row .btn-expand:hover {
    color: #213B34; /* Nucor dark green */
}

.tree-row.expanded .btn-expand i {
    transform: rotate(0deg);
}

/* Bootstrap Dropdown Filter */
.bootstrap-dropdown-filter .dropdown-menu {
    min-width: 100%;
}

.bootstrap-dropdown-filter .dropdown-item.active {
    background-color: #006325; /* Nucor medium green */
    color: white;
}

.bootstrap-dropdown-filter .dropdown-item:hover {
    background-color: #D9E8E2; /* Nucor pale green */
}

/* Modal Enhancements */
.modal-content {
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 2px solid #A1CEAD; /* Nucor light green */
    background-color: #D9E8E2; /* Nucor pale green */
}

.modal-footer {
    border-top: 2px solid #A1CEAD; /* Nucor light green */
    background-color: #F5F4F0; /* Nucor light gray */
}

/* Toast Container */
.toast-container .toast {
    min-width: 300px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-header {
    font-weight: 600;
}

.toast-header.bg-success .btn-close,
.toast-header.bg-danger .btn-close,
.toast-header.bg-info .btn-close {
    filter: invert(1);
}

/* Card Styles for Hierarchy */
.card-header.bg-white {
    background-color: #fff !important;
}

/* Sticky table header */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Tree indentation helper */
.tree-indent {
    display: inline-block;
    width: 30px;
}

/* Loading spinner customization */
.spinner-border.text-primary {
    color: #006325 !important; /* Nucor medium green */
}

/* Form control sizing in tree */
.tree-row .form-control-sm,
.tree-row .form-select-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

/* Action buttons styling */
.btn-toolbar {
    gap: 0.5rem;
}

/* Hierarchy model tree */
.hierarchy-model-tree .tree-row {
    cursor: default;
}

/* Nucor brand colors integration */
.border-nucor-mediumgreen {
    border-color: #006325 !important;
}

.btn-nucor-mediumgreen {
    background-color: #006325;
    color: white;
    border-color: #006325;
}

.btn-nucor-mediumgreen:hover {
    background-color: #213B34; /* Nucor dark green */
    border-color: #213B34;
}

.text-nucor-mediumgreen {
    color: #006325 !important;
}

.bg-nucor-mediumgreen {
    background-color: #006325 !important;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .org-hierarchy-tree {
        max-height: 400px;
    }

    .tree-row .btn-group-sm .btn {
        padding: 0.2rem 0.3rem;
        font-size: 0.75rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Animation for row expansion */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tree-row.expanded + .tree-row {
    animation: slideDown 0.2s ease-out;
}

/* Focus states for accessibility */
.tree-row:focus-within {
    outline: 2px solid #006325; /* Nucor medium green */
    outline-offset: -2px;
}

.dropdown-item:focus {
    background-color: #D9E8E2; /* Nucor pale green */
    outline: 2px solid #006325; /* Nucor medium green */
    outline-offset: -2px;
}

/* Checkbox styling in org selection modal */
.form-check-input:checked {
    background-color: #006325; /* Nucor medium green */
    border-color: #006325;
}

/* Table hover state enhancement */
.table-hover tbody tr:hover {
    background-color: #F5F4F0; /* Nucor light gray */
}

/* Scrollbar styling for webkit browsers */
.org-hierarchy-tree::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.org-hierarchy-tree::-webkit-scrollbar-track {
    background: #F5F4F0; /* Nucor light gray */
}

.org-hierarchy-tree::-webkit-scrollbar-thumb {
    background: #A1CEAD; /* Nucor light green */
    border-radius: 4px;
}

.org-hierarchy-tree::-webkit-scrollbar-thumb:hover {
    background: #006325; /* Nucor medium green */
}
