.bg-selector {
    position: absolute;
    bottom: 50px;
    left: 50px;
    padding: 0.5rem 0.6rem;
    opacity: 0;
    font-size: 1rem;
    font-family: sans-serif;
    background-color: rgba(255, 255, 255, 0.8);
    transition: opacity 1s;
    border-radius: 4px;
    min-width: 250px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    --base-opacity: 0;
}

/* Show on resize event (like other elements) */
html.resizing-on .bg-selector {
    opacity: 1;
}

/* Custom opacity control when enabled */
.bg-selector.always-visible {
    opacity: var(--base-opacity);
}

/* Full opacity on hover when enabled */
.bg-selector.always-visible:hover {
    opacity: 1;
}

.bg-selector label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: bold;
    order: 2;
    margin-top: 0.3rem;
    margin-bottom: 0;
}

.bg-selector select {
    width: 100%;
    padding: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9rem;
    background-color: white;
    margin-bottom: 0.3rem;
}

.bg-selector select:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 3px rgba(0, 122, 204, 0.3);
}

.bg-selector:hover {
    opacity: 1;
}

/* Tree view styling */
#media-tree {
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    order: 1;
    flex-grow: 1;
}

.tree-node {
    margin: 0;
}

.tree-toggle {
    cursor: pointer;
    padding: 2px 0;
    user-select: none;
    color: #333;
    font-weight: bold;
}

.tree-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.toggle-icon {
    display: inline-block;
    width: 12px;
    color: #666;
    font-size: 0.8rem;
}

.tree-content {
    margin-left: 12px;
    border-left: 1px dotted #ccc;
    padding-left: 8px;
}

.tree-item {
    cursor: pointer;
    padding: 1px 0;
    color: #555;
    font-weight: normal;
}

.tree-item:hover {
    background-color: rgba(0, 122, 204, 0.1);
    color: #333;
}

.tree-item.selected {
    background-color: rgba(0, 122, 204, 0.2);
    color: #000;
    font-weight: bold;
}

.item-icon {
    display: inline-block;
    width: 12px;
    color: #999;
    font-size: 0.8rem;
}

.error {
    color: #d63031;
    font-style: italic;
}

/* Video background styling */
#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
}