﻿/** {
    box-sizing: border-box;
}*/

/*body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    background: #f5f5f5;
}*/

/*.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}*/

.tree-dropdown {
    position: relative;
    width: 100%;
    padding: 0px;
    /*margin-bottom: 20px;*/
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .dropdown-header:hover {
        border-color: #007bff;
    }

    .dropdown-header.active {
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

.selected-text {
    color: #333;
    font-weight: normal;
    font-size: 15px;
}

    .selected-text.placeholder {
        color: #000; /* Black */
        font-weight: normal;
        font-size: 15px;
    }

    .selected-text.required-placeholder {
        color: red;
    }

.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    transition: transform 0.3s ease;
}

    .dropdown-arrow.rotated {
        transform: rotate(180deg);
    }

.functionMenu {
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    /* UPDATED: Dynamic width capabilities */
    /*left: 0;
    right: 0;*/
    background: white;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    height: auto;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none; /* ✅ IMPORTANT */
    /* UPDATED: Dynamic width capabilities */
    min-width: 100%;
    width: max-content;
    max-width: 90vw;
}

    .dropdown-content.show {
        display: block;
        animation: slideDown 0.3s ease;
    }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tree-item {
    position: relative;
}

.tree-node {
    display: flex;
    align-items: center;
    /*padding: 10px 16px;*/
    padding: 2px 3px;
    padding-left: calc(32px + (var(--level) * 16px));
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    /*font-size: 10px;*/
    white-space: nowrap; /* Prevents text fragmentation during scaling */ /* UPDATED: Dynamic width capabilities */
}

    .tree-node:hover {
        background-color: #f8f9fa;
    }

    .tree-node.selected {
        background-color: #e3f2fd;
        color: #1976d2;
        font-weight: 500;
    }

    .tree-node.has-children {
        position: relative;
    }

.expand-icon {
    width: 16px;
    height: 16px;
    /*margin-right: 8px;*/
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
}

    .expand-icon.expanded {
        transform: rotate(90deg);
    }

    .expand-icon.leaf {
        opacity: 0;
    }

.tree-children {
    display: none;
    background-color: #fafafa;
}

    .tree-children.expanded {
        display: block;
    }

/*.tree-children .tree-node {
        padding-left: 32px;
    }

    .tree-children .tree-children .tree-node {
        padding-left: 48px;
    }

    .tree-children .tree-children .tree-children .tree-node {
        padding-left: 64px;
    }

    .tree-children .tree-children .tree-children .tree-children .tree-node {
        padding-left: 80px;
    }
    .tree-children .tree-children .tree-children .tree-children .tree-children .tree-node {
        padding-left: 96px;
    }
    .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-node {
        padding-left: 112px;
    }
    .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-node {
        padding-left: 128px;
    }
    .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-node {
        padding-left: 144px;
    }
    .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-children .tree-node {
        padding-left: 160px;
    }*/



.level-indicator {
    font-size: 11px;
    color: #888;
    /*margin-left: auto;*/
    margin-left: 20px; /* Separator gap from flexible text elements */ /* UPDATED: Dynamic width capabilities */
    padding: 2px 6px;
    background: #e9ecef;
    border-radius: 10px;
}

.demo-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.selected-info {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    margin-top: 15px;
}

    .selected-info h4 {
        margin: 0 0 10px 0;
        color: #333;
    }

    .selected-info p {
        margin: 5px 0;
        color: #666;
    }

.reset-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}

    .reset-btn:hover {
        background: #c82333;
    }


/* Sticky search bar */
.tree-search {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    padding: 10px 14px;
    width: 100%; /* ✅ fill dropdown */
    box-sizing: border-box; /* ✅ include padding */
    border: none;
    border-bottom: 1px solid #ddd;
    outline: none;
    font-size: 14px;
}

.tree-Sticky {
    position: sticky;
    top: 0;
    z-index: 10;
}


/* Multi Select CSS */
.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 100px;
    overflow-y: auto;
}

.selected-tag {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
}

    .tag-remove:hover {
        opacity: 1;
    }

.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

    .dropdown-arrow.rotated {
        transform: rotate(180deg);
    }

.multi-select-actions {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    background: #f8f9fa;
}

.action-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: background-color 0.2s ease;
}

    .action-btn:hover {
        background: #5a6268;
    }

    .action-btn.primary {
        background: #007bff;
    }

        .action-btn.primary:hover {
            background: #0056b3;
        }

.checkbox {
    /*width: 16px;
    height: 16px;*/
    /*margin-right: 8px;*/
    margin: 0px !important;
    accent-color: #007bff;
}

.selection-count {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
}
/* End of Multi Select CSS */
