/**
 * Load Search Button & Dropdown Styles
 */

/* Match Save Search button styling */
.ts-form-group.vt_load_search .ts-filter.ts-popup-target {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center;
}

.ts-form-group.vt_load_search .ts-filter.ts-popup-target svg {
    fill: currentColor;
}

/* Button with active indicator */
.vt_load_search .ts-filter.vt-has-active,
.vt-load-search-link.vt-has-active {
    position: relative;
}

.vt_load_search .ts-filter.vt-has-active::after,
.vt-load-search-link.vt-has-active::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--ts-accent-1, #4CAF50);
    border-radius: 50%;
    border: 2px solid var(--ts-shade-8, #fff);
}

.vt-load-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.vt-active-indicator {
    width: 6px;
    height: 6px;
    background: var(--ts-accent-1, #4CAF50);
    border-radius: 50%;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Popup styles - use Voxel CSS variables for theming */
.vt-load-search-popup {
    min-width: 280px;
    max-width: 320px;
}

/* Sticky search header */
.vt-load-search-popup .ts-sticky-top {
    background: var(--ts-shade-8, #fff);
    border-bottom: 1px solid var(--ts-shade-5, #e5e7eb);
}

.vt-load-search-popup .ts-sticky-top .ts-input-icon {
    background: var(--ts-shade-7, #f5f5f5);
    border-radius: 8px;
    margin: 0;
    padding: 0 12px;
}

.vt-load-search-popup .ts-sticky-top .ts-input-icon svg {
    fill: var(--ts-shade-3, #888);
    width: 18px;
    height: 18px;
}

.vt-load-search-popup .ts-sticky-top input {
    background: transparent;
    color: var(--ts-shade-1, #333);
    font-size: 14px;
}

.vt-load-search-popup .ts-sticky-top input::placeholder {
    color: var(--ts-shade-3, #888);
}

.vt-load-search-list {
    max-height: 300px;
    overflow-y: auto;
    background: var(--ts-shade-8, #fff);
}

/* Search items */
.vt-load-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--ts-shade-6, #eee);
    background: var(--ts-shade-8, #fff);
}

.vt-load-search-item:last-child {
    border-bottom: none;
}

.vt-load-search-item:hover {
    background: var(--ts-shade-7, #f5f5f5);
}

.vt-load-search-item.vt-active {
    background: var(--ts-shade-7, #f5f5f5);
}

.vt-load-search-item.vt-clear-item {
    border-bottom: 2px solid var(--ts-shade-5, #ddd);
    color: var(--ts-shade-2, #666);
    background: var(--ts-shade-8, #fff);
}

.vt-load-search-item.vt-clear-item:hover {
    color: var(--ts-shade-1, #333);
    background: var(--ts-shade-7, #f5f5f5);
}

/* Icon */
.vt-load-search-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ts-shade-7, #f5f5f5);
    border-radius: 8px;
    color: var(--ts-shade-2, #666);
}

.vt-load-search-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.vt-clear-item .vt-load-search-icon {
    background: var(--ts-shade-6, #eee);
    color: var(--ts-shade-2, #666);
}

/* Content */
.vt-load-search-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vt-load-search-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--ts-shade-1, #333);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vt-load-search-meta {
    font-size: 12px;
    color: var(--ts-shade-3, #888);
}

/* Check mark */
.vt-load-search-check {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ts-accent-1, #4CAF50);
}

.vt-load-search-check svg {
    fill: currentColor;
}

/* Empty state */
.vt-load-search-empty {
    padding: 30px 15px;
    text-align: center;
    color: var(--ts-shade-3, #888);
    font-size: 14px;
    background: var(--ts-shade-8, #fff);
}

/* Loading state */
.vt-load-search-loading {
    padding: 30px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ts-shade-8, #fff);
}

/* Center align button content */
.ts-form-group.vt_load_search .ts-filter.ts-popup-target {
    justify-content: center;
}

/* Hide when disabled */
.vt_load_search.hidden {
    display: none !important;
}
