/**
 * 物体列表面板样式
 * EasyMapEditor 扩展功能
 */

/* ========== 面板容器 ========== */
#object-list-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 280px;
    max-height: 500px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid #0f3460;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(94, 114, 228, 0.15);
    z-index: 10000;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    font-size: 13px;
    color: #e0e0e0;
    overflow: hidden;
    transition: all 0.3s ease;
}

#object-list-panel.minimized {
    max-height: 40px;
    width: 180px;
}

#object-list-panel.minimized .olp-content {
    display: none;
}

/* ========== 标题栏 ========== */
.olp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(90deg, #0f3460 0%, #533483 100%);
    cursor: move;
    user-select: none;
    border-radius: 11px 11px 0 0;
}

#object-list-panel.minimized .olp-header {
    border-radius: 11px;
}

.olp-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.olp-title-icon {
    font-size: 16px;
}

.olp-header-btns {
    display: flex;
    gap: 6px;
}

.olp-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.olp-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.olp-btn-refresh:hover {
    color: #4ade80;
}

.olp-btn-minimize:hover {
    color: #fbbf24;
}

/* ========== 内容区域 ========== */
.olp-content {
    padding: 12px;
}

/* ========== 搜索框 ========== */
.olp-search-box {
    position: relative;
    margin-bottom: 10px;
}

.olp-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid #0f3460;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.olp-search-input:focus {
    border-color: #5e72e4;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.2);
}

.olp-search-input::placeholder {
    color: #888;
}

.olp-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
}

/* ========== 筛选标签 ========== */
.olp-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.olp-filter-tag {
    padding: 4px 10px;
    border: 1px solid #0f3460;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.olp-filter-tag:hover {
    background: rgba(94, 114, 228, 0.2);
    border-color: #5e72e4;
    color: #fff;
}

.olp-filter-tag.active {
    background: linear-gradient(135deg, #5e72e4 0%, #825ee4 100%);
    border-color: #5e72e4;
    color: #fff;
}

/* ========== 物体列表 ========== */
.olp-list-container {
    max-height: 320px;
    overflow-y: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.olp-list-container::-webkit-scrollbar {
    width: 6px;
}

.olp-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.olp-list-container::-webkit-scrollbar-thumb {
    background: rgba(94, 114, 228, 0.5);
    border-radius: 3px;
}

.olp-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(94, 114, 228, 0.8);
}

/* ========== 空状态 ========== */
.olp-empty {
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

.olp-empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.olp-empty-text {
    font-size: 13px;
}

/* ========== 列表项 ========== */
.olp-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.15s ease;
}

.olp-item:last-child {
    border-bottom: none;
}

.olp-item:hover {
    background: rgba(94, 114, 228, 0.15);
}

.olp-item.selected {
    background: rgba(94, 114, 228, 0.3);
    border-left: 3px solid #5e72e4;
}

.olp-item-icon {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.olp-item-icon.type-npc {
    color: #4ade80;
}

.olp-item-icon.type-monster {
    color: #f87171;
}

.olp-item-icon.type-transfer {
    color: #60a5fa;
}

.olp-item-icon.type-spawnpoint {
    color: #fbbf24;
}

.olp-item-icon.type-sceneobject {
    color: #a78bfa;
}

.olp-item-icon.type-prop {
    color: #fb923c;
}

.olp-item-icon.type-event {
    color: #f472b6;
}

.olp-item-info {
    flex: 1;
    min-width: 0;
}

.olp-item-name {
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.olp-item-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #888;
}

.olp-item-type {
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.olp-item-pos {
    opacity: 0.7;
}

/* ========== 统计信息 ========== */
.olp-stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 11px 11px;
    font-size: 11px;
    color: #888;
}

.olp-stats-count {
    color: #5e72e4;
    font-weight: 600;
}

/* ========== 动画效果 ========== */
@keyframes olp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#object-list-panel {
    animation: olp-fadeIn 0.3s ease;
}

.olp-item {
    animation: olp-fadeIn 0.2s ease;
}

/* ========== 响应式调整 ========== */
@media (max-width: 1200px) {
    #object-list-panel {
        width: 250px;
        max-height: 400px;
    }

    .olp-list-container {
        max-height: 240px;
    }
}

/* ========== 可见性控制 ========== */

/* 筛选标签区域改为带可见性切换的布局 */
.olp-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.olp-filter-row .olp-filter-tag {
    flex: 1;
    text-align: center;
}

/* 类型可见性切换按钮 */
.olp-visibility-toggle {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #4ade80;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.olp-visibility-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.olp-visibility-toggle.hidden {
    color: #666;
    background: rgba(255, 255, 255, 0.05);
}

.olp-visibility-toggle.hidden:hover {
    color: #f87171;
}

/* 批量可见性控制栏 */
.olp-visibility-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 11px;
    color: #888;
}

.olp-visibility-bar-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.olp-visibility-bar-btns {
    display: flex;
    gap: 4px;
}

.olp-visibility-bar-btn {
    padding: 3px 8px;
    border: 1px solid #0f3460;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.olp-visibility-bar-btn:hover {
    background: rgba(94, 114, 228, 0.3);
    border-color: #5e72e4;
    color: #fff;
}

.olp-visibility-bar-btn.show-all:hover {
    background: rgba(74, 222, 128, 0.3);
    border-color: #4ade80;
}

.olp-visibility-bar-btn.hide-all:hover {
    background: rgba(248, 113, 113, 0.3);
    border-color: #f87171;
}

/* 列表项可见性按钮 */
.olp-item-visibility {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #4ade80;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.olp-item-visibility:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.15);
}

.olp-item-visibility.hidden {
    color: #666;
}

.olp-item-visibility.hidden:hover {
    color: #f87171;
}

/* 隐藏状态的列表项样式 */
.olp-item.item-hidden {
    opacity: 0.5;
}

.olp-item.item-hidden .olp-item-name {
    color: #888;
    text-decoration: line-through;
}

.olp-item.item-hidden .olp-item-icon {
    filter: grayscale(100%);
}

/* 筛选标签带可见性指示 */
.olp-filter-tag.type-hidden {
    opacity: 0.5;
    text-decoration: line-through;
}