/**
 * 聊天窗口面板 - 个人文件拖放缩略图样式
 * 独立样式（仅本面板使用，不与其他面板通用）
 * 小缩略图展示、删除按钮；字体 Microsoft YaHei
 */

/* 输入框中的个人文件小缩略图容器 */
.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb {
    display: inline-flex;
    position: relative;
    vertical-align: middle;
    margin: 2px 6px;
    flex-shrink: 0;
    user-select: none;
    border: 1px solid var(--cw-border, #2e2e2e);
    border-radius: 4px;
    overflow: hidden;
    background: var(--cw-bg-deep, #141414);
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
}

.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb-img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
    pointer-events: none;
    max-width: 48px;
    max-height: 48px;
}

/* 视频缩略图：图标 + 可选 video 首帧 */
.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb-video-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cw-bg-deep, #141414);
}

.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb-video-wrap .chat-window-input-private-thumb-img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb-video-icon {
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    z-index: 1;
    pointer-events: none;
}

.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: auto;
    z-index: 10;
}

.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb:hover .chat-window-input-private-thumb-delete {
    opacity: 1;
}

.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb-delete:hover {
    background: rgba(220, 53, 69, 0.8);
}

/* 拖放后加载占位（处理审核面板/个人文件路径转 Blob 的延迟） */
.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb.chat-window-input-private-thumb-loading {
    width: auto;
    min-width: 120px;
    max-width: 220px;
    height: 32px;
    padding: 0 8px;
    border-radius: 16px;
    gap: 6px;
    background: #1b1b1b;
    border-color: #343434;
}

.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb-loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #444;
    border-top-color: #e74c3c;
    border-radius: 50%;
    animation: chat-window-private-thumb-loading-spin 0.75s linear infinite;
    flex-shrink: 0;
}

.chat-window-panel .chat-window-input-text .chat-window-input-private-thumb-loading-text {
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", Arial, sans-serif;
    font-size: 12px;
    color: #d8d8d8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

@keyframes chat-window-private-thumb-loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
