﻿.treeview ul {
    list-style-type: none;
    padding-left: 20px;
    margin-bottom: 0;
}

.treeview li {
    margin: 5px 0;
    position: relative;
    padding: 2px 0;
    transition: all 0.2s ease;
}

.treeview .collapse-icon {
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.2s ease;
    color: var(--bs-primary);
}

.treeview .location-item {
    cursor: pointer;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

    .treeview .location-item.selected {
        font-weight: bold;
        background-color: rgba(255, 103, 31, 0.1);
        color: var(--bs-primary);
    }

.treeview .location-actions {
    cursor: pointer;
    display: none;
    margin-left: 5px;
    color: var(--bs-secondary);
}

/* Show actions on hover */
.treeview li:hover > .location-actions {
    display: inline-block;
}

.treeview .actions-menu {
    position: absolute;
    background: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-left: 20px;
}

    .treeview .actions-menu button {
        display: block;
        width: 100%;
        margin-bottom: 5px;
        text-align: left;
        border-radius: 4px;
        transition: all 0.2s ease;
    }

.treeview .tenant-root {
    font-weight: 600;
    color: var(--bs-dark);
    font-size: 1.1em;
    cursor: default;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

/* Indent all levels except the root level */
.treeview > ul {
    padding-left: 0;
}

/* Add hover effect for location items */
.treeview .location-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.treeview-container {
    width: var(--bs-sidebar-width);
    height: calc(100vh - 140px); /* Adjust based on your header/footer height */
    padding: 15px;
    overflow: auto;
    background-color: var(--bs-sidebar-bg);
    border-right: 1px solid var(--bs-navbar-border);
    transition: all 0.3s ease;
}

.treeview {
    min-width: 100%;
    width: fit-content; /* Allow content to determine width */
}

/* Customize scrollbar appearance */
.treeview-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.treeview-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.treeview-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.treeview-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Context menu styling */
#context-menu {
    background-color: white !important;
    border: none !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-radius: 6px !important;
    padding: 0 !important;
}

#context-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#context-menu li:hover {
    background-color: rgba(255, 103, 31, 0.1);
}

/* Actions menu styling */
.actions-menu {
    background-color: white !important;
    border: none !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-radius: 6px !important;
    padding: 8px !important;
}

.actions-menu button {
    margin-bottom: 5px;
    width: 100%;
    text-align: left;
}

.actions-menu button:last-child {
    margin-bottom: 0;
}

/* Sidebar toggle button */
#sidebarToggleBtn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0;
    background: var(--bs-primary-gradient);
    color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    transition: all 0.3s ease;
}

#sidebarToggleBtn:hover {
    background: var(--bs-primary-gradient-hover);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

#sidebarToggleBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

.sidebar-toggle-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
    line-height: 1;
}

#sidebar.show + .col-auto .sidebar-toggle-icon {
    transform: rotate(0deg);
}

#sidebar.collapse:not(.show) + .col-auto .sidebar-toggle-icon {
    transform: rotate(180deg);
}
