.sub-nav-item.reorder-drop-target,
.sub-sub-item.reorder-drop-target {
    background: rgba(177, 127, 255, 0.12);
}

.sub-nav-item.reorder-enabled,
.sub-sub-item.reorder-enabled {
    padding-right: 32px;
}

.sub-nav-item.reorder-drop-target::after,
.sub-sub-item.reorder-drop-target::after {
    content: '';
    position: absolute;
    left: -24px;
    right: 4px;
    bottom: -2px;
    height: 2px;
    background: rgba(177, 127, 255, 0.75);
    box-shadow: 0 0 10px rgba(177, 127, 255, 0.6);
    border-radius: 2px;
}

.asset-card.reorder-drop-target {
    outline: 2px dashed rgba(177, 127, 255, 0.6);
    outline-offset: -6px;
}

.folder-drag-ghost {
    padding: 6px 12px;
    background: rgba(177, 127, 255, 0.9);
    color: #0b021f;
    font-weight: 600;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.asset-drag-ghost {
    border-radius: 12px;
    box-shadow: 0 15px 32px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    opacity: 0.95;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(to bottom, #443E56 0%, #282631 100%);
    color: #ffffff;
    overflow: hidden;
    /* Prevent ALL page-level scrolling */
    height: 40vh;
    /* Adjusted for 2.5x zoom: 100vh / 2.5 = 40vh */
    margin: 0;
    padding: 0;
    /* Default zoom for VR - prevents "small then zooms" effect on Android */
    /* Can be overridden via URL param ?zoom=X or Unity SetZoom() */
    zoom: 3;
}

.container {
    display: flex;
    height: 40vh;
    /* Adjusted for 2.5x zoom: 100vh / 2.5 = 40vh */
    width: 40vw;
    /* Adjusted for 2.5x zoom: 100vw / 2.5 = 40vw */
    position: absolute;
    /* CRITICAL: Anchor to viewport */
    top: 0;
    left: 0;
}

/* Left Sidebar Navigation */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: auto;
    /* Disable smooth scroll for performance */
}

/* Aggressive scroll optimization */
.sidebar {
    -webkit-overflow-scrolling: touch;
    transform: translate3d(0, 0, 0);
    /* Force GPU */
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Disable all hover effects during scroll */
.sidebar.scrolling * {
    pointer-events: none !important;
}

.sidebar * {
    pointer-events: auto;
}

.sidebar .nav-item::before,
.asset-card::before {
    pointer-events: none;
    will-change: auto;
    /* Disable will-change to save memory */
}

/* Sidebar icon-only mode for News/Wiki views */
.sidebar {
    transition: width 0.3s ease-out;
}

body.sidebar-icons-only .sidebar {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    flex-shrink: 0;
}

body.sidebar-icons-only .sidebar .nav-label,
body.sidebar-icons-only .sidebar .expand-arrow,
body.sidebar-icons-only .sidebar .nav-count {
    display: none;
}

body.sidebar-icons-only .sidebar .sub-nav {
    display: none !important;
}

body.sidebar-icons-only .sidebar .nav-item {
    padding: 12px;
    justify-content: center;
}

body.sidebar-icons-only .sidebar .nav-item.expanded {
    /* Remove expanded state in icon-only mode */
    background: transparent;
    box-shadow: none;
}

.nav-section {
    padding: 16px 0 8px 0;
}

/* Ensure last nav items are reachable */
.sidebar .nav-section:last-child {
    padding-bottom: 60px;
    /* Extra bottom padding */
}

.nav-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    /* No transition by default - prevents flash when active state changes */
    position: relative;
    user-select: none;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(177, 127, 255, 0.2), transparent);
    transition: width 0.3s;
    pointer-events: none;
}

.nav-item:hover::before {
    width: 100%;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s, transform 0.2s; /* Only transition on hover */
}

/* Active indicator - consistent across all levels */
.nav-item.active {
    background: rgba(177, 127, 255, 0.1);
    box-shadow: 0 0 20px rgba(177, 127, 255, 0.2);
    position: relative;
}

/* Use ::after for consistent left border indicator */
.nav-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #B17FFF;
    box-shadow: 0 0 10px rgba(177, 127, 255, 0.5);
}

.nav-item.active .nav-icon {
    color: #B17FFF;
    filter: drop-shadow(0 0 5px rgba(177, 127, 255, 0.5));
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    /* No transition by default - prevents flash when active state changes */
}

.nav-item:hover .nav-icon {
    transition: all 0.3s; /* Only transition on hover */
}

.nav-label {
    flex: 1;
    font-size: 14px;
}

.nav-count {
    font-size: 12px;
    color: #B17FFF;
    background: rgba(177, 127, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(177, 127, 255, 0.3);
}

.nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 8px 20px;
}

.sub-nav {
    padding-left: 32px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}

.nav-item.expanded+.sub-nav {
    max-height: 2000px;
    /* Generous limit for smooth expansion */
    opacity: 1;
    transition: max-height 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}

/* ===== LEGACY FOLDER STYLES =====
 * These styles are kept for backward compatibility with:
 * - Static sidebar items (All My Assets, My Purchases, My Likes, Spawn History)
 * - Block folders (Blocks section uses sub-nav-item and sub-sub-item)
 * - Search history items
 * New API folders (Featured, My Assets) use unified .folder-item[data-depth] system
 */
.sub-nav-item {
    padding: 8px 0;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    /* No transition by default - prevents flash when active state changes */
    user-select: none;
}

.sub-nav-item:hover {
    color: #fff;
    transition: color 0.2s; /* Only transition on hover */
}

/* Create folder button - needs !important to override inline style */
.sub-nav-item.create-folder-btn {
    color: #B17FFF;
    cursor: pointer;
}

.sub-nav-item.create-folder-btn:hover {
    color: #fff !important;
}

.sub-nav-item.active {
    color: #B17FFF;
    font-weight: 600;
    /* Subtle glow effect */
    background: rgba(177, 127, 255, 0.08);
    box-shadow: 0 0 12px rgba(177, 127, 255, 0.2);
    border-radius: 4px;
}

.sub-nav-item.expandable {
    font-weight: 500;
    color: #bbb;
}

/* Override expandable styling when active */
.sub-nav-item.expandable.active {
    color: #B17FFF !important;
    font-weight: 600;
}

/* Unified expand arrow for both .nav-item and .sub-nav-item */
.expand-arrow {
    width: 24px;
    height: 24px;
    min-width: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #666;
    border-radius: 4px;
    margin-left: auto;
    margin-right: 0;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.expand-arrow:hover {
    background: rgba(177, 127, 255, 0.15);
    color: #B17FFF;
}

.expand-arrow:active {
    transform: scale(0.9);
    background: rgba(177, 127, 255, 0.25);
}

/* Prevent item highlight when arrow is hovered */
.nav-item:has(.expand-arrow:hover),
.sub-nav-item:has(.expand-arrow:hover) {
    background: transparent !important;
}

/* Drag-to-open pending state with progress bar */
.nav-item.drag-hover-pending,
.sub-nav-item.drag-hover-pending {
    position: relative;
    box-shadow: inset 0 0 8px rgba(177, 127, 255, 0.2);
}

.nav-item.drag-hover-pending::after,
.sub-nav-item.drag-hover-pending::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #B17FFF, rgba(177, 127, 255, 0.5));
    animation: drag-open-progress 0.4s linear forwards;
    border-radius: 1px;
}

@keyframes drag-open-progress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* Legacy support - keep .expand-icon as alias */
.expand-icon {
    margin-left: auto;
    margin-right: 0;
    padding-left: 8px;
    font-size: 10px;
}

/* Search history items */
.search-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-history-query {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-history-remove {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.search-history-item:hover .search-history-remove {
    opacity: 1;
}

.search-history-remove:hover {
    background: rgba(255, 100, 100, 0.15);
    color: #ff6b6b;
}

.search-history-clear {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sub-sub-nav {
    padding-left: 17px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, padding 0.3s;
    padding-top: 0;
}

.sub-nav-item.expanded+.sub-sub-nav {
    max-height: 1000px;
    opacity: 1;
    padding-top: 4px;
}

/* Legacy: Used by Block folders (sub-items in Blocks section) */
.sub-sub-item {
    padding: 6px 0 6px 8px;
    color: #777;
    font-size: 12px;
    cursor: pointer;
    /* No transition by default - prevents flash when active state changes */
    position: relative;
    user-select: none;
}

.sub-sub-item:hover {
    color: #B17FFF;
    transition: color 0.2s; /* Only transition on hover */
}

.sub-sub-item.custom-folder {
    color: #B17FFF;
    opacity: 0.7;
    font-style: italic;
}

.sub-sub-item.custom-folder:hover {
    opacity: 1;
}

.sub-sub-item::before {
    content: '•';
    position: absolute;
    left: -8px;
    color: #444;
}

/* Active state for nested folders */
.sub-sub-item.active {
    color: #B17FFF !important;
    font-weight: 600;
    /* Subtle glow effect */
    background: rgba(177, 127, 255, 0.08);
    box-shadow: 0 0 12px rgba(177, 127, 255, 0.2);
    border-radius: 4px;
}

.sub-sub-item.active::before {
    /* Hide bullet when active */
    display: none;
}

/* ===== DEPTH-BASED FOLDER STYLING (Levels 3-4) ===== */

/* Folder container for levels 3+ */
.folder-container {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, padding 0.3s;
    padding-top: 0;
    padding-left: 17px;  /* Same indent as level 2 */
}

.folder-item.expanded + .folder-container,
.sub-sub-item.expanded + .folder-container {
    max-height: 1000px;
    opacity: 1;
    padding-top: 4px;
}

/* Level 3 & 4 items - same styling as level 2 */
.folder-item[data-depth="3"],
.folder-item[data-depth="4"] {
    padding: 6px 0 6px 8px;
    color: #777;
    font-size: 12px;
    cursor: pointer;
    /* No transition by default - prevents flash when active state changes */
    position: relative;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-item[data-depth="3"]::before,
.folder-item[data-depth="4"]::before {
    content: '•';
    position: absolute;
    left: -8px;
    color: #444;
}

.folder-item[data-depth="3"]:hover,
.folder-item[data-depth="4"]:hover {
    color: #fff;
    transition: color 0.2s; /* Only transition on hover */
}

/* Active states for depth 3 & 4 */
.folder-item[data-depth="3"].active,
.folder-item[data-depth="4"].active {
    color: #B17FFF !important;
    font-weight: 600;
    /* Subtle glow effect */
    background: rgba(177, 127, 255, 0.08);
    box-shadow: 0 0 12px rgba(177, 127, 255, 0.2);
    border-radius: 4px;
}

.folder-item[data-depth="3"].active::before,
.folder-item[data-depth="4"].active::before {
    /* Hide bullet when active */
    display: none;
}

/* Expandable folder at depth 3+ */
.folder-item[data-depth="3"].expandable,
.folder-item[data-depth="4"].expandable {
    font-weight: 500;
    color: #999;
}

.folder-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* ===== UNIFIED FOLDER ITEM SYSTEM ===== */
/* Base folder item - shared by all depths */
.folder-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    /* No transition by default - prevents flash when active state changes */
    user-select: none;
}

.folder-item:hover {
    color: #fff;
    transition: color 0.2s; /* Only transition on hover, not on active state removal */
}

/* Depth 1: Top-level folders */
.folder-item[data-depth="1"] {
    padding: 8px 0;
    color: #999;
    font-size: 13px;
}

.folder-item[data-depth="1"].expandable {
    font-weight: 600;
    color: #bbb;
}

.folder-item[data-depth="1"].active {
    color: #B17FFF !important;
    font-weight: 600;
    /* Subtle glow effect */
    background: rgba(177, 127, 255, 0.08);
    box-shadow: 0 0 12px rgba(177, 127, 255, 0.2);
    border-radius: 4px;
}

/* Depth 2: Nested folders */
.folder-item[data-depth="2"] {
    padding: 6px 0 6px 8px;
    color: #777;
    font-size: 12px;
}

.folder-item[data-depth="2"]::before {
    content: '•';
    position: absolute;
    left: -8px;
    color: #444;
}

/* Depth 2 active */
.folder-item[data-depth="2"].active {
    color: #B17FFF !important;
    font-weight: 600;
    /* Subtle glow effect */
    background: rgba(177, 127, 255, 0.08);
    box-shadow: 0 0 12px rgba(177, 127, 255, 0.2);
    border-radius: 4px;
}

.folder-item[data-depth="2"].active::before {
    /* Hide bullet when active */
    display: none;
}

/* Folder containers */
.folder-nav {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, padding 0.3s;
    padding-top: 0;
}

.folder-nav[data-depth="2"],
.folder-nav[data-depth="3"],
.folder-nav[data-depth="4"] {
    padding-left: 17px;
}

.folder-item.expanded + .folder-nav {
    max-height: 1000px;
    opacity: 1;
    padding-top: 4px;
}

/* Reorder styling for unified folder items */
.folder-item.reorder-drop-target {
    background: rgba(177, 127, 255, 0.12);
}

.folder-item.reorder-enabled {
    padding-right: 32px;
}

.folder-item.reorder-drop-target::after {
    content: '';
    position: absolute;
    left: -24px;
    right: 4px;
    bottom: -2px;
    height: 2px;
    background: rgba(177, 127, 255, 0.75);
    box-shadow: 0 0 10px rgba(177, 127, 255, 0.6);
    border-radius: 2px;
}

.folder-item.is-reordering {
    opacity: 0.5;
    pointer-events: none;
}

/* Drag-to-open pending state for unified folder items */
.folder-item.drag-hover-pending {
    position: relative;
    box-shadow: inset 0 0 8px rgba(177, 127, 255, 0.2);
}

.folder-item.drag-hover-pending::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #B17FFF, rgba(177, 127, 255, 0.5));
    animation: drag-open-progress 0.4s linear forwards;
    border-radius: 1px;
}

/* Exclude folder items from draggable hover outline */
body.drag-mode-active .folder-item.draggable-item:hover {
    outline: none;
}

/* Expandable folder styling */
.folder-item.expandable {
    font-weight: 500;
    color: #999;
}

/* Create folder button */
.folder-item.create-folder-btn {
    color: #B17FFF;
    cursor: pointer;
}

.folder-item.create-folder-btn:hover {
    color: #fff !important;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
}

/* Offline Indicator Banner */
.offline-banner {
    padding: 12px 24px;
    background: rgba(255, 136, 0, 0.15);
    border-bottom: 1px solid rgba(255, 136, 0, 0.3);
    color: #ff8844;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.offline-icon {
    font-size: 18px;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header Controls */
.content-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    flex-shrink: 0;
    /* IMPORTANT: Prevent header from shrinking */
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #888;
}

.breadcrumb-item {
    transition: all 0.2s;
}

.breadcrumb-item.clickable {
    cursor: pointer;
    text-decoration: underline;
}

.breadcrumb-item.clickable:hover {
    color: #B17FFF;
    text-shadow: 0 0 10px rgba(177, 127, 255, 0.5);
}

.search-count {
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(177, 127, 255, 0.1);
    border-radius: 12px;
    font-size: 12px;
    color: #B17FFF;
}

#multi-select-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #00ff88;
    white-space: nowrap;
    animation: fadeIn 0.2s ease-in;
    position: relative;
}

.multi-select-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

/* Highlight X when hovering the badge or the X itself */
#multi-select-counter:hover .multi-select-clear,
.multi-select-clear:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.search-section-header {
    grid-column: 1 / -1;
    padding: 16px 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #B17FFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Asset Type Filter Dropdown */
.filter-dropdown {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-dropdown:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(177, 127, 255, 0.5);
}

.filter-dropdown option {
    background: #1a1a2e;
    color: #fff;
    padding: 8px;
}

.sort-dropdown {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-dropdown:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(177, 127, 255, 0.5);
}

/* Reorder Mode Button */
.reorder-mode-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
    font-weight: 600;
}

.reorder-mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(177, 127, 255, 0.5);
}

.reorder-mode-btn.active {
    background: rgba(177, 127, 255, 0.2);
    border: 1px solid rgba(177, 127, 255, 0.6);
    color: #B17FFF;
    box-shadow: 0 0 15px rgba(177, 127, 255, 0.2);
}

/* Visual indicator when reorder mode is active */
body.reorder-mode-active .asset-card.reorder-enabled {
    outline: 1px dashed rgba(177, 127, 255, 0.3);
}

/* Custom Dropdowns for VR (replaces native select) */
.custom-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.custom-dropdown-button {
    padding: 8px 24px 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
    position: relative;
}

/* Dropdown arrow indicator */
.custom-dropdown-button::after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
}

.custom-dropdown-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(177, 127, 255, 0.5);
}

.custom-dropdown-menu {
    position: fixed;
    /* Fixed positioning - set via JS */
    /* top, left, min-width set dynamically via JS */
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(177, 127, 255, 0.3);
    border-radius: 8px;
    z-index: 99999;
    /* Very high z-index to ensure it's always on top */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    /* pointer-events controlled by JS - 'none' when hidden, 'auto' when visible */
}

.custom-dropdown-option {
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    user-select: none;
}

.custom-dropdown-option:last-child {
    border-bottom: none;
}

.custom-dropdown-option:hover {
    background: rgba(177, 127, 255, 0.15);
    color: #B17FFF;
}

.custom-dropdown-option.selected {
    background: rgba(177, 127, 255, 0.2);
    color: #B17FFF;
    font-weight: 600;
}

.custom-dropdown-option.selected::before {
    content: '✓ ';
    color: #B17FFF;
}

/* Asset Grid */
.asset-container {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 24px;
    padding-bottom: 60px;
    /* Extra bottom padding to ensure last items are reachable */
    background: rgba(0, 0, 0, 0.1);
    transform: translate3d(0, 0, 0);
    /* Force GPU */
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    /* IMPORTANT: Allow flex item to shrink */
}

/* Disable hover during scroll */
.asset-container.scrolling .asset-card {
    pointer-events: none;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    align-items: start;
    /* Each card can have independent height */
}

/* Filter Active State */
.filter-dropdown.filter-active,
.custom-dropdown-button.filter-active {
    background: rgba(0, 255, 136, 0.15);
    border-color: #00ff88;
    color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.filter-dropdown.filter-active:hover,
.custom-dropdown-button.filter-active:hover {
    background: rgba(0, 255, 136, 0.25);
}

/* Unified Empty State Button */
.empty-state-button.primary-action {
    background: rgba(0, 255, 136, 0.15) !important;
    border: 1px solid rgba(0, 255, 136, 0.4) !important;
    color: #00ff88 !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.15);
}

.empty-state-button.primary-action:hover {
    background: rgba(0, 255, 136, 0.25) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 255, 136, 0.25);
}

/* News view layout overrides */
body.content-mode-news .main-content {
    background: transparent;
}

body.content-mode-news .offline-banner,
body.content-mode-news .content-header {
    display: none;
}

body.content-mode-news .asset-container {
    padding: 0;
    background: transparent;
    overflow: hidden;
}

body.content-mode-news .asset-grid {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

body.content-mode-news .news-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
}

body.content-mode-news .news-panel-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #0f0f12;
}

body.content-mode-news .fab {
    display: none !important;
}

/* Wiki view layout overrides */
body.content-mode-wiki .main-content {
    background: transparent;
}

body.content-mode-wiki .offline-banner,
body.content-mode-wiki .content-header {
    display: none;
}

body.content-mode-wiki .asset-container {
    padding: 0;
    background: transparent;
    overflow: hidden;
}

body.content-mode-wiki .asset-grid {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

body.content-mode-wiki .wiki-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
}

body.content-mode-wiki .wiki-panel-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #0f0f12;
}

body.content-mode-wiki .fab {
    display: none !important;
}

.asset-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: none;
    /* Disable transitions during scroll */
    cursor: pointer;
    position: relative;
    contain: layout style paint;
    /* CSS containment */
}

.asset-card:hover {
    transition: transform 0.15s, border-color 0.15s;
    /* Re-enable on hover */
}

.asset-card:hover {
    transform: translateY(-2px);
    border-color: rgba(177, 127, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* Selected card state - highlighted and shows spawn/buy button */
.asset-card.selected {
    transform: translateY(-2px);
    border-color: rgba(177, 127, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(177, 127, 255, 0.3), 0 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(177, 127, 255, 0.08);
}

/* Multi-selected card state - highlighted with checkmark */
.asset-card.multi-selected {
    transform: translateY(-2px);
    border-color: rgba(0, 255, 136, 0.8);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.3), 0 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(0, 255, 136, 0.08);
}

/* Selection checkmark overlay */
.selection-checkmark {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 255, 136, 1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #000;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    animation: checkmarkAppear 0.2s ease;
}

@keyframes checkmarkAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Show spawn button on multi-selected cards too */
.asset-card.multi-selected .asset-spawn-btn {
    display: block;
}

/* Dim preview for multi-selected cards */
.asset-card.multi-selected .asset-preview-image {
    opacity: 0.4;
}

/* VR Multi-select mode indicator */
body.vr-multi-select-mode::before {
    content: 'MULTI-SELECT MODE';
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 136, 0.9);
    color: #000;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(0, 255, 136, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(0, 255, 136, 0.8);
    }
}

/* Spawn/Buy button on selected card */
.asset-spawn-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(177, 127, 255, 0.95);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 18px 36px;
    font-size: 21px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: none;
    /* Hidden by default */
    transition: all 0.2s ease;
}

.asset-card.selected .asset-spawn-btn {
    display: block;
}

.asset-spawn-btn:hover {
    background: rgba(177, 127, 255, 1);
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* Disable pointer events on cards during drag to prevent hover effects */
body.dragging-active .asset-card {
    pointer-events: none !important;
}

/* ===== WEB PORTAL: no Spawn affordance (Spawn is a Unity/VR-only action) =====
   Belt-and-suspenders backstop for the render-time guard in ui-integration.js -
   covers any render path that might still emit the button markup. */
body.web-portal-active .asset-spawn-btn {
    display: none !important;
}
/* ===== END WEB PORTAL ===== */

.asset-spawn-btn:active {
    transform: translate(-50%, -50%) scale(0.98);
}

/* Multi-select spawn button hover - synchronized pulse effect */
.asset-spawn-btn.multi-spawn-hover {
    background: rgba(177, 127, 255, 1);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 20px rgba(177, 127, 255, 0.8), 0 6px 16px rgba(0, 0, 0, 0.5);
    animation: spawn-pulse 0.8s ease-in-out infinite;
}

@keyframes spawn-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(177, 127, 255, 0.8), 0 6px 16px rgba(0, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 30px rgba(177, 127, 255, 1), 0 8px 20px rgba(0, 0, 0, 0.6);
    }
}

/* Dim the preview when card is selected to highlight the button */
.asset-card.selected .asset-preview-image {
    opacity: 0.4;
}

/* Folder cards - visually distinct from asset cards */
.folder-card {
    border-color: rgba(177, 127, 255, 0.15);
}

.folder-card:hover {
    border-color: rgba(177, 127, 255, 0.7);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(177, 127, 255, 0.3);
}

.folder-card .asset-preview {
    background: rgba(177, 127, 255, 0.05);
}

.folder-card .asset-type-badge {
    background: rgba(177, 127, 255, 0.3);
    color: #000;
    font-weight: 700;
}

.folder-card .asset-title {
    font-weight: 600;
}

/* Audio preview loading state - spinner animation */
@keyframes audioLoading {
    0% {
        box-shadow: 0 0 15px rgba(255, 204, 0, 0.4), 0 0 30px rgba(255, 204, 0, 0.2);
        border-color: rgba(255, 204, 0, 0.6);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 204, 0, 0.6), 0 0 40px rgba(255, 204, 0, 0.3);
        border-color: rgba(255, 204, 0, 0.8);
    }

    100% {
        box-shadow: 0 0 15px rgba(255, 204, 0, 0.4), 0 0 30px rgba(255, 204, 0, 0.2);
        border-color: rgba(255, 204, 0, 0.6);
    }
}

/* Audio preview playing state - pulsing animation */
@keyframes audioPlaying {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(177, 127, 255, 0.6), 0 0 40px rgba(177, 127, 255, 0.3);
        border-color: rgba(177, 127, 255, 0.8);
    }

    50% {
        box-shadow: 0 0 30px rgba(177, 127, 255, 0.8), 0 0 60px rgba(177, 127, 255, 0.4);
        border-color: rgba(177, 127, 255, 1);
    }
}

/* Loading indicator rotation */
@keyframes loadingSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.asset-card.audio-loading {
    z-index: 5;
    transform: translateY(-4px);
    animation: audioLoading 1.5s ease-in-out infinite;
}

.asset-card.audio-playing {
    z-index: 5;
    transform: translateY(-4px);
    animation: audioPlaying 1.5s ease-in-out infinite;
}

/* Reorder handle styles removed - dotted drag icons no longer shown (organize mode always on, use GRIP to drag) */

.sub-nav-item.is-reordering,
.sub-sub-item.is-reordering {
    background: rgba(177, 127, 255, 0.22);
    color: #fff;
    border-radius: 6px;
    opacity: 1;
}

.asset-preview {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Image container for zoom effect */
.asset-preview-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    transform: scale(1);
    /* Full size by default */
}

.asset-card:hover .asset-preview-image {
    transform: scale(1.1);
    /* 10% zoom out on hover */
}

.asset-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Lazy loading image states */
.asset-preview img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.asset-preview img.lazy-loading {
    opacity: 1;
    /* Keep full opacity for the placeholder background */
    color: transparent;
    /* Smoother, wider gradient for less harsh shimmer */
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite ease-in-out;
    /* Slower, smoother animation */
}

.asset-preview img.lazy-loaded {
    opacity: 1;
}

.asset-preview img.lazy-error {
    opacity: 0;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Performance: Skip rendering off-screen cards */
.asset-card {
    content-visibility: auto;
    contain-intrinsic-size: 200px 250px;
    /* Approximate card size */
}

/* Category icons (PNG) should NOT be absolutely positioned */
.asset-preview img.category-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    position: relative;
    /* Override absolute positioning */
    top: auto;
    left: auto;
}

.preview-icon {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
    transition: color 0.2s;
    position: relative;
    z-index: 1;
}

.asset-card:hover .preview-icon {
    color: #B17FFF;
}

.asset-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #B17FFF;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(177, 127, 255, 0.3);
    z-index: 10;
}

.asset-actions {
    position: absolute;
    top: 8px;
    right: 44px;
    /* Left of where price badge would be */
    display: flex;
    gap: 4px;
    opacity: 1;
    /* Always visible for VR */
    transition: opacity 0.2s;
}

.asset-card:hover .asset-actions {
    opacity: 1;
}

.action-btn {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    font-size: 16px;
    z-index: 10;
}

.action-btn:hover {
    background: rgba(177, 127, 255, 0.2);
    border-color: #B17FFF;
    transform: scale(1.1);
    color: #B17FFF;
}

/* Info button - highlighted for easy VR access */
.info-btn {
    background: rgba(177, 127, 255, 0.15);
    border-color: rgba(177, 127, 255, 0.5);
    color: #B17FFF;
}

.info-btn:hover {
    background: rgba(177, 127, 255, 0.3);
    border-color: #B17FFF;
}

.asset-info {
    position: relative;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background 0.2s;
}

.asset-info:hover {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
}

.asset-info-content {
    flex: 1;
    min-width: 0;
    /* Allow text truncation */
    position: relative;
    /* For absolute positioning of description */
}

.asset-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 0;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.asset-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.asset-stats {
    display: flex;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.stat-item:hover {
    color: #B17FFF;
    transform: scale(1.1);
}

.author-tag {
    color: #999;
    font-size: 11px;
    margin-bottom: 2px;
}

/* Info icon in bottom right */
.info-icon {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
    margin-left: 8px;
    margin-top: 2px;
    /* Align with title */
    flex-shrink: 0;
}

.asset-info:hover .info-icon {
    color: #B17FFF;
    transform: scale(1.1);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
}

.context-item {
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.context-item:hover {
    background: rgba(177, 127, 255, 0.1);
    padding-left: 20px;
}

.context-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(177, 127, 255, 0.1);
    border: 1px solid rgba(177, 127, 255, 0.3);
    border-radius: 4px;
    font-size: 11px;
    color: #B17FFF;
    margin-right: 4px;
}

/* Scrollbar Styling - Enhanced for better visibility */
::-webkit-scrollbar {
    width: 8px;
    /* Slightly wider for better visibility */
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(177, 127, 255, 0.3);
    /* Green theme */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(177, 127, 255, 0.5);
    /* Brighter green on hover */
}

/* Specific scrollbar styling for sidebar and asset container */
.sidebar::-webkit-scrollbar-thumb,
.asset-container::-webkit-scrollbar-thumb {
    background: rgba(177, 127, 255, 0.4);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.asset-container::-webkit-scrollbar-thumb:hover {
    background: rgba(177, 127, 255, 0.6);
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.loading {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #B17FFF, #9D66E6);
    border-radius: 50%;
    display: none;
    /* Hidden by default, only shows during drag as trash can */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(177, 127, 255, 0.4);
    transition: all 0.3s;
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(177, 127, 255, 0.6);
}

.fab-icon {
    font-size: 24px;
    color: #000;
    font-weight: bold;
}

/* FAB trash mode - activated during drag */
.fab-trash-mode {
    display: flex !important;
    /* Show FAB when in trash mode */
    background: linear-gradient(135deg, #ff4466, #dd2244) !important;
    animation: fab-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 8px 24px rgba(255, 68, 102, 0.6);
}

.fab-trash-mode:hover,
.fab-trash-hover {
    background: linear-gradient(135deg, #ff6688, #ff4466) !important;
    transform: scale(1.2) !important;
    box-shadow: 0 12px 32px rgba(255, 68, 102, 0.8) !important;
    animation: fab-pulse-fast 0.5s ease-in-out infinite;
}

.fab-trash-mode .fab-icon {
    font-size: 28px;
}

/* Pulse animation for trash mode */
@keyframes fab-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(255, 68, 102, 0.6);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(255, 68, 102, 0.8);
    }
}

@keyframes fab-pulse-fast {

    0%,
    100% {
        transform: scale(1.2);
    }

    50% {
        transform: scale(1.25);
    }
}

/* Delete confirmation modal */
.delete-confirmation-modal .modal {
    max-width: 480px;
}

.delete-confirmation-modal .modal-header {
    color: #ff4466;
}

.delete-item-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.delete-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    word-break: break-word;
}

.delete-item-type {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 4px;
}

.delete-warning-box {
    background: rgba(255, 68, 102, 0.15);
    border: 1px solid rgba(255, 68, 102, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.delete-warning-icon {
    font-size: 20px;
    margin-right: 8px;
}

.delete-warning-text {
    font-size: 14px;
    color: #ffccdd;
    line-height: 1.5;
}

.delete-info-box {
    background: rgba(0, 204, 255, 0.1);
    border: 1px solid rgba(0, 204, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.delete-info-icon {
    font-size: 20px;
    margin-right: 8px;
}

.delete-info-text {
    font-size: 14px;
    color: #ccf0ff;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.modal-button-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-button-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-button-delete {
    background: linear-gradient(135deg, #ff4466, #dd2244);
    color: #fff;
}

.modal-button-delete:hover {
    background: linear-gradient(135deg, #ff6688, #ff4466);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 68, 102, 0.4);
}

.modal-button-delete:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s;
    padding: 20px;
    overflow-y: auto;
}

/* Thumbnail selector should appear above other modals */
#thumbnailSelectorModal {
    z-index: 2100;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    /* Reduced specific padding */
    max-width: 380px;
    /* Slightly narrower */
    width: 90%;
    max-height: 80vh;
    /* Cap height */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s;
}

/* ... existing code ... */

.emoji-picker {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: auto;
    min-height: 150px;
    /* Further reduced min-height */
    max-height: 22vh;
    /* Reduced to ~0.7x of previous 30vh */
    overflow: hidden;
}

.emoji-search-container {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: inherit;
    flex-shrink: 0;
    z-index: 10;
}

.emoji-content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.modal-body {
    margin-bottom: 20px;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 4px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #aaa;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #B17FFF;
    background: rgba(255, 255, 255, 0.08);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

textarea.form-input {
    resize: vertical;
    min-height: 50px;
}

.emoji-category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.emoji-option {
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    text-align: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.emoji-option:hover {
    background: rgba(177, 127, 255, 0.1);
    transform: scale(1.2);
}

.emoji-option.selected {
    background: rgba(177, 127, 255, 0.2);
    border: 2px solid #B17FFF;
}

.color-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Compact Modal */
.modal-compact {
    max-width: 400px;
}

/* Selection Buttons for Icon/Color - More Compact */
.btn-select {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.btn-select:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.btn-select span:first-child {
    font-size: 20px;
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #333;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background: linear-gradient(135deg, #B17FFF, #9D66E6);
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

.toggle-slider:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

input:checked+.toggle-slider:hover {
    background: linear-gradient(135deg, #B17FFF, #9D66E6);
}

/* Form Row */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #B17FFF, #9D66E6);
    color: #000;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(177, 127, 255, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #cc5555);
    color: #fff;
}

.btn-danger:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Success banner for asset info modal */
.success-banner {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 350px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 3000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #B17FFF;
}

.toast.error {
    border-left: 4px solid #ff4444;
}

.toast.warning {
    border-left: 4px solid #ffaa00;
}

/* Simple Loading Screen - Eye Candy Only */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #443E56 0%, #282631 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s;
    pointer-events: none;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: floatPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(177, 127, 255, 0.6));
}

@keyframes floatPulse {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.loading-text {
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(90deg, #fff, #B17FFF, #fff);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 2s linear infinite;
}

@keyframes shimmerText {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.loading-dots {
    display: inline-flex;
    gap: 6px;
    margin-left: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #B17FFF;
    animation: dotPulse 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== Asset Info Modal ========== */
.asset-info-modal {
    max-width: 520px;
    width: 85vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.asset-info-modal .modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.asset-info-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 14px;
}

.asset-info-body {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 14px;
}

.asset-info-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-info-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Allow text overflow to work */
}

.asset-info-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: default;
    transition: all 0.2s ease;
}

.asset-info-preview.clickable {
    cursor: pointer;
}

.asset-info-preview.clickable:hover {
    border-color: rgba(177, 127, 255, 0.5);
    box-shadow: 0 4px 12px rgba(177, 127, 255, 0.2);
}

.asset-info-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.asset-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.asset-info-preview.clickable:hover .asset-thumb-placeholder {
    transform: scale(1.05);
}

.placeholder-icon {
    font-size: 32px;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.asset-info-preview.clickable:hover .placeholder-icon {
    opacity: 0.5;
}

.placeholder-text {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.asset-info-preview.clickable:hover .placeholder-text {
    color: rgba(177, 127, 255, 0.7);
}

.asset-thumb-overlay,
.folder-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.asset-info-preview.clickable:hover .asset-thumb-overlay,
.folder-info-preview.clickable:hover .folder-thumb-overlay {
    opacity: 1;
    pointer-events: auto;
}

.overlay-text {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.asset-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

/* Creator card hover effect */
.creator-card:hover {
    background: rgba(0, 255, 136, 0.15) !important;
}

/* ========== Block Info Modal (Enhanced & Compact) ========== */
/* Fix vertical alignment to prevent cutoff on zoomed screens */
#blockInfoModal {
    align-items: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
}

.block-info-modal {
    max-width: 520px;
    width: 85vw;
    /* Adjusted for 2.5x zoom (body is 40vh), so effective viewport is ~40vh. 
       Using 35vh ensures it fits within the visible area. */
    max-height: 35vh;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: auto;
    /* Safe centering with flex-start parent */
}

/* Block Info Modal Header - matches Asset Info and Folder Info */
.block-info-modal .modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.block-info-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 12px 12px 12px;
    border-radius: 0 0 8px 8px;
    min-height: 0;
}

/* Custom scrollbar for modal */
.block-info-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.block-info-modal .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.block-info-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(177, 127, 255, 0.3);
    border-radius: 3px;
}

.block-info-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(177, 127, 255, 0.5);
}

.block-info-body {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
}

.block-info-left {
    display: flex;
    flex-direction: column;
}

.block-info-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.block-info-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(177, 127, 255, 0.05);
    border: 2px solid rgba(177, 127, 255, 0.2);
}

.block-info-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.block-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.block-thumb-placeholder .placeholder-icon {
    font-size: 32px;
    opacity: 0.4;
}

.block-thumb-placeholder .placeholder-text {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.block-info-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    padding: 5px 8px;
    background: rgba(177, 127, 255, 0.1);
    border-radius: 5px;
    border: 1px solid rgba(177, 127, 255, 0.2);
}

.block-info-category {
    font-size: 9px;
    color: #B17FFF;
    padding: 3px 6px;
    background: rgba(177, 127, 255, 0.05);
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
}

.block-info-description {
    font-size: 10px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* max-height: 120px; Removed to prevent nested scrollbars */
    /* overflow-y: auto; Removed to prevent nested scrollbars */
}

.block-info-description::-webkit-scrollbar {
    width: 4px;
}

.block-info-description::-webkit-scrollbar-thumb {
    background: rgba(177, 127, 255, 0.3);
    border-radius: 2px;
}

.block-parts-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* max-height: 200px; Removed to prevent nested scrollbars */
    /* overflow-y: auto; Removed to prevent nested scrollbars */
    padding-right: 0;
}

.block-parts-list::-webkit-scrollbar {
    width: 4px;
}

.block-parts-list::-webkit-scrollbar-thumb {
    background: rgba(177, 127, 255, 0.3);
    border-radius: 2px;
}

.block-part-item {
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.block-part-item.input {
    border-left-color: #4CAF50;
}

.block-part-item.output {
    border-left-color: #FF9800;
}

.block-part-item.jolt-input {
    border-left-color: #2196F3;
}

.block-part-item.jolt-output {
    border-left-color: #9C27B0;
}

.block-part-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.block-part-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.block-part-name {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
}

.block-part-type {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.block-part-description {
    font-size: 9px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.6);
}

.block-part-meta {
    display: flex;
    gap: 6px;
    margin-top: 3px;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.4);
}

.block-related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.block-related-item {
    padding: 3px 6px;
    background: rgba(177, 127, 255, 0.1);
    border: 1px solid rgba(177, 127, 255, 0.3);
    border-radius: 3px;
    font-size: 9px;
    color: #B17FFF;
    cursor: pointer;
    transition: all 0.2s;
}

.block-related-item:hover {
    background: rgba(177, 127, 255, 0.2);
    border-color: rgba(177, 127, 255, 0.5);
    transform: scale(1.05);
}

.block-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.block-tag-item {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.7);
}

.block-info-example {
    font-size: 10px;
    color: #B17FFF;
    padding: 5px 8px;
    background: rgba(177, 127, 255, 0.05);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.block-info-example:hover {
    background: rgba(177, 127, 255, 0.1);
    transform: scale(1.02);
}

/* Removed sticky footer actions */
/* .block-info-actions was here */

/* ========== Folder Info Modal (matching Asset Info) ========== */
.folder-info-modal {
    max-width: 520px;
    width: 85vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.folder-info-modal .modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.folder-info-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 14px;
}

.folder-info-body {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 14px;
}

.folder-info-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.folder-info-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.folder-info-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: default;
    transition: all 0.2s ease;
}

.folder-info-preview.clickable {
    cursor: pointer;
}

.folder-info-preview.clickable:hover {
    border-color: rgba(177, 127, 255, 0.5);
    box-shadow: 0 4px 12px rgba(177, 127, 255, 0.2);
}

.folder-info-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.folder-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.folder-info-preview.clickable:hover .folder-thumb-placeholder {
    transform: scale(1.05);
}

.folder-info-preview.clickable:hover .placeholder-icon {
    opacity: 0.5;
}

.folder-info-preview.clickable:hover .placeholder-text {
    color: rgba(177, 127, 255, 0.7);
}

.folder-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.folder-info-preview.clickable:hover .folder-thumb-overlay {
    opacity: 1;
}

.stat-box {
    text-align: center;
    padding: 4px;
    background: rgba(177, 127, 255, 0.05);
    border-radius: 3px;
    border: 1px solid rgba(177, 127, 255, 0.1);
    transition: background 0.2s, border-color 0.2s;
}

/* Clickable stat box (like button) hover */
.stat-box[style*="cursor: pointer"]:hover {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.3);
}

.stat-icon {
    font-size: 14px;
    margin-bottom: 1px;
}

.stat-value {
    font-size: 12px;
    font-weight: 600;
    color: #B17FFF;
    margin-bottom: 0px;
}

.stat-label {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

/* Asset Lineage / Remixes Sections */
.asset-lineage-section {
    margin-bottom: 8px;
    background: rgba(177, 127, 255, 0.05);
    border-radius: 6px;
    padding: 6px;
    border: 1px solid rgba(177, 127, 255, 0.1);
}

.lineage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 2px 0;
    transition: opacity 0.2s;
}

.lineage-header:hover {
    opacity: 0.8;
}

.lineage-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lineage-chevron {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.2s;
    display: inline-block;
}

.asset-lineage-section:not(.collapsed) .lineage-chevron {
    transform: rotate(90deg);
}

.asset-lineage-section.collapsed .lineage-scroll {
    display: none;
}

.asset-lineage-section:not(.collapsed) .lineage-header {
    margin-bottom: 6px;
}

.lineage-title {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.lineage-count {
    font-size: 9px;
    background: rgba(177, 127, 255, 0.2);
    color: #B17FFF;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.lineage-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(177, 127, 255, 0.3) transparent;
}

.lineage-scroll::-webkit-scrollbar {
    height: 4px;
}

.lineage-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.lineage-scroll::-webkit-scrollbar-thumb {
    background: rgba(177, 127, 255, 0.3);
    border-radius: 2px;
}

.lineage-card {
    flex-shrink: 0;
    width: 60px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lineage-card:hover {
    transform: translateY(-2px);
}

.lineage-card-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lineage-card-name {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lineage-card-creator {
    font-size: 7px;
    color: rgba(0, 255, 136, 0.7);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-info-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding-top: 6px;
}

.btn-icon-edit {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 2px 5px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-icon-edit:hover {
    background: rgba(177, 127, 255, 0.2);
    border-color: #B17FFF;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

/* Modal type label - subtle context indicator */
.modal-type-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #B17FFF;
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

input:disabled+.toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ===== DRAG & DROP STYLES ===== */

/* Refresh button */
#refreshButton {
    background: rgba(100, 200, 255, 0.15);
    border: 1px solid rgba(100, 200, 255, 0.3);
    color: #64C8FF;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    user-select: none;
    margin-right: 8px;
}

#refreshButton:hover:not(:disabled) {
    background: rgba(100, 200, 255, 0.25);
    border-color: rgba(100, 200, 255, 0.5);
    transform: translateY(-1px);
}

#refreshButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Drag mode active state (always on) */
body.drag-mode-active .draggable-item {
    cursor: grab;
    position: relative;
}

/* Drag handle icon (⋮⋮) removed - organize mode always on, use GRIP to drag */

body.drag-mode-active .draggable-item:hover {
    outline: 2px solid rgba(177, 127, 255, 0.5);
    outline-offset: 2px;
}

/* Exclude folder tree items from draggable hover outline */
body.drag-mode-active .sub-nav-item.draggable-item:hover,
body.drag-mode-active .sub-sub-item.draggable-item:hover {
    outline: none;
}

/* Dragging state */
.is-dragging {
    opacity: 0.3;
    cursor: grabbing !important;
}

.drag-ghost {
    opacity: 0.8 !important;
    transform: scale(0.95);
    transform-origin: center center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(177, 127, 255, 0.5);
    filter: brightness(1.1);
    pointer-events: none;
}

/* Multi-select drag ghost - stacked 3D effect */
.drag-ghost-container {
    position: fixed;
    pointer-events: none;
}

.drag-ghost-stack-layer {
    opacity: 0.8 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    filter: brightness(0.9);
}

.drag-ghost-main {
    opacity: 0.9 !important;
    transform: scale(0.98);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(177, 127, 255, 0.6);
    filter: brightness(1.15);
}

/* Count badge for multi-select drag */
.drag-ghost-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #B17FFF, #9D66E6);
    color: #000;
    font-weight: bold;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

/* Ghost transformation when dragging folder over grid */
.drag-ghost.ghost-transforms-to-card {
    /* Transform tree item to card appearance */
    transition: all 0.3s ease;
    width: 200px !important;
    height: 220px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    border-radius: 12px !important;
    background: rgba(30, 30, 35, 0.95) !important;
    border: 2px solid rgba(177, 127, 255, 0.5) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(177, 127, 255, 0.5) !important;
}

/* Hide tree-specific elements in card mode */
.drag-ghost.ghost-transforms-to-card .expand-arrow,
.drag-ghost.ghost-transforms-to-card .expand-icon,
.drag-ghost.ghost-transforms-to-card .reorder-handle-folder {
    display: none !important;
}

/* Make folder icon large and centered */
.drag-ghost.ghost-transforms-to-card .folder-icon {
    font-size: 64px !important;
    margin: 0 0 16px 0 !important;
    display: block !important;
}

/* Center and style folder name */
.drag-ghost.ghost-transforms-to-card .folder-name {
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
    max-width: 100% !important;
}

/* Droppable grid highlight when dragging over */
.droppable-grid.drag-over {
    background: rgba(177, 127, 255, 0.1);
    border: 4px dashed rgba(177, 127, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(177, 127, 255, 0.5) inset, 0 0 40px rgba(177, 127, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

/* Mode indicator when dragging folder to grid */
.droppable-grid.drag-over::before {
    content: '📁 Drop to nest folder here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(177, 127, 255, 0.95);
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    animation: pulse-indicator 1.5s ease-in-out infinite;
}

@keyframes pulse-indicator {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.9;
    }
}

/* Droppable folders */
body.drag-mode-active .droppable-folder {
    position: relative;
    transition: all 0.2s ease;
}

body.drag-mode-active .droppable-folder::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed transparent;
    border-radius: 4px;
    pointer-events: none;
    transition: all 0.2s ease;
}

.droppable-folder.drag-over {
    background: rgba(177, 127, 255, 0.15) !important;
}

.droppable-folder.drag-over::before {
    border-color: rgba(177, 127, 255, 0.6);
    animation: pulse-border 1s ease infinite;
}

@keyframes pulse-border {

    0%,
    100% {
        border-color: rgba(177, 127, 255, 0.6);
    }

    50% {
        border-color: rgba(177, 127, 255, 0.9);
    }
}

/* Placeholder folder for users with no folders */
.placeholder-folder {
    border: 1px dashed rgba(177, 127, 255, 0.5) !important;
    background: rgba(177, 127, 255, 0.08) !important;
    border-radius: 6px;
    margin: 4px 8px;
    padding: 8px 12px !important;
}

.placeholder-folder:hover,
body.dragging-active .placeholder-folder {
    border-color: rgba(177, 127, 255, 0.8) !important;
    background: rgba(177, 127, 255, 0.15) !important;
}

body.dragging-active .placeholder-folder {
    animation: pulse-placeholder 1.5s ease infinite;
}

@keyframes pulse-placeholder {

    0%,
    100% {
        border-color: rgba(177, 127, 255, 0.5);
        box-shadow: 0 0 0 0 rgba(177, 127, 255, 0.2);
    }

    50% {
        border-color: rgba(177, 127, 255, 0.9);
        box-shadow: 0 0 8px 2px rgba(177, 127, 255, 0.3);
    }
}

/* Drag notifications */
.drag-notification {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Grip indicator (contextual, shown only during grip drag) */
body.grip-organize-active .grip-organize-indicator {
    display: flex;
}

.grip-organize-indicator {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(177, 127, 255, 0.9);
    color: #000;
    padding: 12px 20px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 13px;
    z-index: 10000;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    align-items: center;
    gap: 8px;
    display: none;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== UTILITY CLASSES ===== */

/* Folder count badge */
.folder-count {
    font-size: 11px;
    color: #666;
    margin-left: 6px;
}

/* Item count badge on folder cards */
.folder-item-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(177, 127, 255, 0.8);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 10;
}

/* Owned/Purchased badge */
.badge-purchased {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #B17FFF;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
}

/* Price badge */
.price-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #FF3EBF;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 62, 191, 0.3);
}

/* Deleted badge (for audit trail on purchased assets) */
.deleted-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #FF4444;
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    z-index: 11;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    letter-spacing: 0.5px;
    opacity: 0.95;
}

/* Purchased badge (for assets user has bought) */
.purchased-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #22C55E;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    z-index: 10;
    letter-spacing: 1px;
}

/* When both deleted badge and price badge exist, stack them */
.asset-preview:has(.deleted-badge):has(.price-badge) .price-badge {
    top: 38px;
    /* Move price badge down when deleted badge is present */
}

/* Visually dim deleted assets for better distinction */
.asset-card:has(.deleted-badge) .asset-preview-image {
    opacity: 0.7;
    filter: grayscale(20%);
}

.asset-card:has(.deleted-badge) .asset-info {
    opacity: 0.85;
}

/* Asset like button */
.asset-like-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    transition: all 0.2s;
}

.asset-like-btn.liked {
    color: #ff4444;
}

.asset-like-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
}

/* Asset metadata (description, notes) */
.asset-description {
    display: none;
    /* Description removed from cards - shown in info modal instead */
}

.asset-notes {
    display: none;
    /* Notes removed from cards - shown in info modal instead */
}

/* Loading skeleton styles */
.skeleton-preview {
    background: rgba(255, 255, 255, 0.02);
}

.skeleton-title {
    height: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text {
    height: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    width: 60%;
}

/* Breadcrumb count */
.breadcrumb-count {
    color: #666;
    margin-left: 10px;
}

/* ===== USER LIBRARIES - SOCIAL DISCOVERY ===== */

.user-libraries-container {
    padding: 20px;
}

.user-libraries-container.user-libraries-loading {
    position: relative;
    min-height: 400px;
}

.user-libraries-container.user-libraries-loading .unified-loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #B17FFF;
    margin: 0 0 8px 0;
}

.section-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* User Cards Grid */
.user-libraries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.user-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.user-card:hover {
    border-color: rgba(177, 127, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(177, 127, 255, 0.1);
}

/* User Card Header */
.user-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(177, 127, 255, 0.3);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    color: #B17FFF;
    margin: 0 0 6px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.user-name:hover {
    color: #B17FFF;
    text-decoration: underline;
}

.user-bio {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.user-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.user-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Pin Button */
.pin-button {
    padding: 8px 16px;
    background: rgba(177, 127, 255, 0.1);
    border: 1px solid rgba(177, 127, 255, 0.3);
    border-radius: 8px;
    color: #B17FFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pin-button:hover {
    background: rgba(177, 127, 255, 0.2);
    border-color: rgba(177, 127, 255, 0.5);
    transform: scale(1.05);
}

.pin-button.pinned {
    background: rgba(177, 127, 255, 0.2);
    border-color: rgba(177, 127, 255, 0.5);
}

.pin-button:active {
    transform: scale(0.95);
}

/* User Assets Grid */
.user-assets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* New Asset Thumbnail Cards */
.asset-thumbnail-card {
    transition: all 0.2s ease;
}

.asset-thumbnail-card:hover {
    transform: translateY(-2px);
}

.asset-thumbnail-card:hover .asset-thumbnail-preview {
    border-color: rgba(177, 127, 255, 0.5);
    box-shadow: 0 4px 12px rgba(177, 127, 255, 0.2);
}

/* Legacy styles for old thumbnails (if any remain) */
.asset-thumbnail {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.3);
}

.asset-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(177, 127, 255, 0.2);
}

.asset-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-thumbnail-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.asset-thumbnail:hover .asset-thumbnail-info {
    opacity: 1;
}

.asset-category {
    font-size: 11px;
    color: #B17FFF;
    font-weight: 600;
}

.no-assets {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

/* Loading State */
.user-libraries-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(177, 127, 255, 0.2);
    border-top-color: #B17FFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.user-libraries-loading p {
    font-size: 14px;
    margin: 0;
}

/* Empty State */
.user-libraries-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.user-libraries-empty p {
    font-size: 14px;
    text-align: center;
    max-width: 400px;
    margin: 0;
}

/* Error State */
.user-libraries-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ff4466;
}

.user-libraries-error p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 20px 0;
}

.user-libraries-error button {
    padding: 10px 20px;
    background: rgba(177, 127, 255, 0.1);
    border: 1px solid rgba(177, 127, 255, 0.3);
    border-radius: 8px;
    color: #B17FFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-libraries-error button:hover {
    background: rgba(177, 127, 255, 0.2);
    border-color: rgba(177, 127, 255, 0.5);
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}

.pagination-btn {
    padding: 10px 20px;
    background: rgba(177, 127, 255, 0.1);
    border: 1px solid rgba(177, 127, 255, 0.3);
    border-radius: 8px;
    color: #B17FFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(177, 127, 255, 0.2);
    border-color: rgba(177, 127, 255, 0.5);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* User Header Bar - Inline header between assets */
.user-header-bar {
    grid-column: 1 / -1;
    /* Span full width of grid */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-top: 20px;
    border-bottom: 2px solid rgba(177, 127, 255, 0.2);
}

.user-header-bar:first-child {
    margin-top: 0;
    /* No margin for first user */
}

.user-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.user-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(177, 127, 255, 0.4);
    flex-shrink: 0;
}

.user-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-header-name {
    font-size: 16px;
    font-weight: 600;
    color: #B17FFF;
    margin: 0;
    transition: color 0.2s ease;
}

.user-header-name:hover {
    color: #B17FFF;
    text-decoration: underline;
}

.user-header-stats {
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.user-header-stats span {
    display: flex;
    align-items: center;
    gap: 2px;
    transition: color 0.2s;
}

.user-header-stats span[style*="cursor: pointer"] {
    text-decoration: underline;
}

.user-header-stats span[style*="cursor: pointer"]:hover {
    color: #B17FFF;
}

.user-header-pin-btn {
    padding: 6px 12px;
    background: rgba(177, 127, 255, 0.1);
    border: 1px solid rgba(177, 127, 255, 0.3);
    border-radius: 6px;
    color: #B17FFF;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.user-header-pin-btn:hover {
    background: rgba(177, 127, 255, 0.2);
    border-color: rgba(177, 127, 255, 0.5);
    transform: translateY(-1px);
}

.user-header-pin-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .user-libraries-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .user-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .pin-button {
        align-self: stretch;
    }

    .user-assets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-header-pin-btn {
        width: 100%;
    }
}

/* ===== SEARCH LOADING INDICATOR ===== */

/* ===== NO RESULTS FILTER MESSAGE ===== */
.no-results-filter-message {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    margin: 20px 0;
}

.no-results-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    max-width: 300px;
}

.no-results-icon {
    font-size: 32px;
    opacity: 0.6;
}

.no-results-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
}

.no-results-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    line-height: 1.4;
}

/* ===== UNIFIED LOADING INDICATOR ===== */
/* Search and user libraries now use unified LoadingIndicator utility */

/* ===== THUMBNAIL SELECTOR ===== */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 10px;
    max-height: 450px;
    overflow-y: auto;
}

.thumbnail-option {
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
}

.thumbnail-option:hover {
    border-color: #4CAF50;
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.thumbnail-option img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.thumbnail-option .thumb-name {
    padding: 6px 8px;
    font-size: 11px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumbnail-option.selected {
    border-color: #2196F3;
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.6);
    transform: scale(1.08);
}

.thumbnail-option.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2196F3;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Default icon option in thumbnail grid */
.thumbnail-option.default-icon-option {
    min-height: 140px;
}

/* Thumbnail grid scrollbar */
.thumbnail-grid::-webkit-scrollbar {
    width: 8px;
}

.thumbnail-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.thumbnail-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.thumbnail-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   SKELETON LOADING STYLES
   Provides immediate visual feedback while content loads
   ============================================ */

.skeleton-section {
    padding: 8px 0;
}

.skeleton-nav-item {
    height: 36px;
    margin: 4px 12px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 6px;
}

.skeleton-card {
    aspect-ratio: 1;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.02) 0%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.02) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* When content is ready, hide skeleton elements smoothly */
body.content-ready .skeleton-section,
body.content-ready .skeleton-nav-item,
body.content-ready .skeleton-card {
    display: none;
}

/* Retry button for timeout state */
.retry-btn {
    padding: 12px 24px;
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid #00ff88;
    color: #00ff88;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 16px;
    transition: background 0.2s ease;
}

.retry-btn:hover {
    background: rgba(0, 255, 136, 0.3);
}

/* ===== WEB PORTAL: rubber-band (marquee) selection rectangle =====
   Drawn in a fixed overlay layer using viewport coordinates, so grid scroll
   offsets don't need to be tracked separately - see initWebPortalRubberBand()
   in drag-drop.js. */
.web-selection-rect {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    background: rgba(0, 255, 136, 0.12);
    border: 1px solid rgba(0, 255, 136, 0.6);
    border-radius: 2px;
    pointer-events: none;
    z-index: 9999;
}
/* ===== END WEB PORTAL ===== */