/* 文件上传相关样式 */

/* 上传成功标记 */
.upload-success-mark {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upload-success-mark i {
    color: white;
    font-size: 8px;
}

/* 已上传文件的特殊样式 */
.file-icon.uploaded {
    position: relative;
    border: 2px solid #28a745 !important;
    background: rgba(40, 167, 69, 0.05) !important;
}

.file-icon.uploaded:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(40, 167, 69, 0.1) 50%, transparent 60%);
    animation: shimmer 2s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 本地文件样式 */
.file-icon.local {
    border: 2px solid #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

/* 上传进度样式优化 */
#uploadProgress {
    backdrop-filter: blur(10px);
    animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 文件预览区域优化 */
.file-mini-preview {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: rgba(248, 249, 250, 0.5);
}

.file-squares {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.file-square {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-square:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.file-square .file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.file-square .file-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #dc3545;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    z-index: 10;
}

.file-square:hover .file-remove {
    opacity: 1;
}

.file-square .file-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* 文件类型图标颜色 */
.file-icon.image { 
    background: rgba(52, 144, 220, 0.1); 
    border-color: #3490dc;
    color: #3490dc;
}

.file-icon.text { 
    background: rgba(72, 187, 120, 0.1); 
    border-color: #48bb78;
    color: #48bb78;
}

.file-icon.document { 
    background: rgba(237, 100, 166, 0.1); 
    border-color: #ed64a6;
    color: #ed64a6;
}

.file-icon.other { 
    background: rgba(160, 174, 192, 0.1); 
    border-color: #a0aec0;
    color: #a0aec0;
}

/* 文件计数徽章 */
.file-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 工具按钮激活状态 */
.input-tool-btn.has-files {
    background: rgba(52, 144, 220, 0.1);
    color: #3490dc;
    border-color: #3490dc;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .file-square {
        width: 36px;
        height: 36px;
    }
    
    .file-mini-preview {
        padding: 6px;
    }
    
    .file-squares {
        gap: 4px;
    }
}
