/* ファイルアップロード */
.file-upload-area {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    background: #fafafa;
}
.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #00aacc;
    background: #f0fafd;
}
.file-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.file-upload-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
    color: #666;
    font-size: 15px;
}
.file-upload-label small {
    color: #aaa;
    font-size: 12px;
}

/* プレビューエリア */
#file_preview_area {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

/* カード */
.preview-card {
    position: relative;
    width: 160px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    cursor: pointer;
}
.preview-card img,
.preview-card video {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}
.preview-card .preview-thumb {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    font-size: 36px;
}
.preview-card .file-name {
    font-size: 11px;
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #555;
}

/* 新規ファイルの削除ボタン（×） */
.preview-card .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}
.preview-card .remove-btn:hover {
    background: rgba(200,0,0,0.7);
}

/* 既存ファイルの削除・削除取消ボタン */
.file-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    border-top: 1px solid #eee;
    position: relative;
    z-index: 1;
}
.btn-file-delete {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid #dc3545;
    background: #fff;
    color: #dc3545;
    cursor: pointer;
}
.btn-file-delete:hover {
    background: #dc3545;
    color: #fff;
}
.btn-file-restore {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid #0d6efd;
    background: #fff;
    color: #0d6efd;
    cursor: pointer;
}
.btn-file-restore:hover {
    background: #0d6efd;
    color: #fff;
}